Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import botogram
- import random
- bot = botogram.create("API-KEY")
- @bot.command("random")
- def random_command(chat, minimum: int = 0, maximum: int = 100):
- """Get a random number between <code>minimum</code> and <code>maximum</code>."""
- try:
- chat.send(str(random.randint(minimum, maximum)))
- except (TypeError, ValueError):
- chat.send("Invalid values.")
- @bot.command("hello")
- def hello_world(chat):
- """Say hello to the world!"""
- chat.send("Hello world!")
- @bot.command("say_hello")
- def say_hello(chat, args):
- """Say hello to a group of people. If no person is provided, it will just say hello."""
- if args:
- chat.send("Hello " + ", ".join(args) + "!")
- else:
- chat.send("Hello!")
- if __name__ == "__main__":
- bot.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement