Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bot(threading.Thread):
- def __init__(self, token=""):
- super().__init__()
- self.bot = botogram.create(token)
- self.bot.run()
- def mainBot(self):
- @self.bot.command("start")
- def hello_command(chat, message, args):
- btn = botogram.Buttons()
- btn[0].callback("Avanti", "muovi", "avanti")
- btn[1].callback("Sinistra", "muovi", "sx")
- btn[1].callback("Destra", "muovi", "dx")
- btn[2].callback("Indietro", "muovi", "indietro")
- chat.send("Comando Robot", attach=btn)
- @self.bot.callback("muovi")
- def muovi(query, data):
- if data == "avanti":
- query.notify("Avanti")
- elif data == "dx":
- query.notify("Destra")
- elif data == "sx":
- query.notify("Sinistra")
- elif data == "indietro":
- query.notify("Indietro")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement