Skip to content

Instantly share code, notes, and snippets.

View pedromaironi's full-sized avatar
Looking for Job

Pedro Toribio pedromaironi

Looking for Job
View GitHub Profile
@pedromaironi
pedromaironi / superlog
Created June 23, 2022 02:02 — forked from gollum23/superlog
Superlog Curso git platzi
git config --global alias.superlog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
@pedromaironi
pedromaironi / jsonToMap.java
Created May 4, 2021 14:46 — forked from maheshkelkar/jsonToMap.java
Simple example on how to convert Json string to Hash Map<String, Object>
//http://stackoverflow.com/questions/21720759/convert-a-json-string-to-a-hashmap
public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException {
Map<String, Object> retMap = new HashMap<String, Object>();
if(json != JSONObject.NULL) {
retMap = toMap(json);
}
return retMap;
}
@pedromaironi
pedromaironi / region.py
Created March 14, 2021 00:34
Adding Buttons
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} region.py importado.{/cyan}'))
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
markup.add(types.KeyboardButton('EUW'),
types.KeyboardButton('EUNE'),
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} keyboard.py importado.{/cyan}'))
markup_es = types.ReplyKeyboardMarkup(resize_keyboard=True)
markup_es.add(
types.KeyboardButton('AYUDA'),
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} inline_skins.py importado.{/cyan}'))
backward = {
'Chogath': 'ChoGath',
@pedromaironi
pedromaironi / info
Created March 14, 2021 00:30
Add buttons to bot
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} info.py importado.{/cyan}'))
markup = types.InlineKeyboardMarkup()
b1 = types.InlineKeyboardButton(
"Channel", url="https://telegram.me/league_of_legends_channel")
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} github.py importado.{/cyan}'))
@bot.message_handler(commands=['github'])
def command_github(m):
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} get_user.py importado.{/cyan}'))
@bot.message_handler(commands=['get_user'], func=lambda m: m.text and len(m.text.split()) == 2)
def command_get_user_info(m):
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} all.py importado.{/cyan}'))
@bot.message_handler(commands=['all_es'])
def command_all_es(m):
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} admin.py importado.{/cyan}'))
@bot.message_handler(commands=['admin'])
def command_admin(m):