From 9c3d34f51cc13b7a1202583ac2ff6a0cdf6b8cdf Mon Sep 17 00:00:00 2001 From: Misaki Date: Tue, 14 Nov 2023 20:49:15 +0100 Subject: [PATCH] commiting to da gitz with da rizz --- README.md | 0 bot.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 README.md create mode 100644 bot.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bot.py b/bot.py new file mode 100644 index 0000000..7dbfc9f --- /dev/null +++ b/bot.py @@ -0,0 +1,62 @@ +#Mau mau das wird der Funi Bot +from telegram.ext import Updater, CommandHandler, MessageHandler, filters +import logging + +logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + level=logging.INFO) +logger = logging.getLogger(__name__) + +def start(update, context): + """Send a message when the command /start is issued.""" + update.message.reply_text('Hallo! Ich bin dein Echo-Bot. Sende mir eine Nachricht und ich werde sie wiederholen.') + +#def brithday(update, context) + # print("Welcom Furry, Happy Birthday Generator") + + #name = input("Name Luck Furry: ") + #age = input("Age the Furry: ") + #sender = input("You Furry Name: ") + #print(" \n\n") + #print("Hallo " + name + ",") + #print("I Wish you a Yiff " + age + " Birthday.") + #print("You are Welcome and E621 is the best") + #print("Happy 9/11") + #print("Yiff " + sender) + #print(" \n\n") + #input("Enter to end") + +def echo(update, context): + """Echo the user message.""" + update.message.reply_text(update.message.text) + +def error(update, context): + """Log Errors caused by Updates.""" + logger.warning('Update "%s" caused error "%s"', update, context.error) + +def main(): + """Start the bot.""" + # Ersetzen Sie 'YOUR_TOKEN' mit Ihrem Bot-Token + updater = Updater("6885365398:AAHhgMRbUGfeS0VzKRmJvjKxSHfi18xESC4", use_context=True) + + # Get the dispatcher to register handlers + dp = updater.dispatcher + + # on different commands - answer in Telegram + dp.add_handler(CommandHandler("start", start)) + + # on noncommand i.e message - echo the message on Telegram + dp.add_handler(MessageHandler(Filters.text, echo)) + + # log all errors + dp.add_error_handler(error) + + # Start the Bot + updater.start_polling() + + # Run the bot until you press Ctrl-C or the process receives SIGINT, + # SIGTERM or SIGABRT. This should be used most of the time, since + # start_polling() is non-blocking and will stop the bot gracefully. + updater.idle() + +if __name__ == '__main__': + main()