|
|
@ -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() |