Browse Source

sudo kill

pull/4/head
angerstoner 6 years ago
parent
commit
54ab8419d6
  1. 32
      schneiderbot.py

32
schneiderbot.py

@ -74,7 +74,6 @@ MODES = {
"full" : HIDE_CATEGORIES_FULL
}
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
@ -127,13 +126,35 @@ def sendDog(bot, update):
dog = pydog.PyDog()
bot.send_photo(chat_id=update.message.chat_id, photo=dog.get_random_image())
def kill(bot, update):
def kill(bot, update, sudocall = False):
"""kill me pls"""
update.message.reply_text(update.message.from_user.first_name + " died")
message = update.message.from_user.first_name + " died"
if sudocall:
message += " for real"
update.message.reply_text(message)
def revive(bot, update):
def revive(bot, update, sudocall = False):
"""unkill me pls"""
update.message.reply_text(update.message.from_user.first_name + " is no longer dead!")
message = update.message.from_user.first_name + " is living again"
if sudocall:
message += " for real"
update.message.reply_text(message)
SUDOCMDS = {
"kill" : kill,
"revive" : revive
}
def sudo(bot, update, args):
"""for real"""
if not args :
update.message.reply_text("Unknown command")
return
for arg in args:
if arg in SUDOCMDS:
SUDOCMDS[arg](bot, update, True)
else:
update.message.reply_text("Unknown command")
def sendCatDog(bot, update):
"""Best of both worlds!"""
@ -238,6 +259,7 @@ def main():
dp.add_handler(CommandHandler("manta", manta))
dp.add_handler(CommandHandler("goodlife", goodlife))
dp.add_handler(CommandHandler("mensa", mensa, pass_args=True))
dp.add_handler(CommandHandler("sudo", sudo, pass_args=True))
dp.add_handler(CommandHandler("cat", sendCat))
dp.add_handler(CommandHandler("dog", sendDog))
dp.add_handler(CommandHandler("catdog", sendCatDog))

Loading…
Cancel
Save