Removing previous code, adding register and cancelRegister buttons with DM replies
This commit is contained in:
+7
-26
@@ -1,6 +1,6 @@
|
||||
# [ IMPORTS ] #
|
||||
from telegram import Update
|
||||
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
|
||||
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes, CallbackQueryHandler, Application
|
||||
import configparser
|
||||
import json
|
||||
import os
|
||||
@@ -28,35 +28,16 @@ def main():
|
||||
app = ApplicationBuilder().token(config['telegram']['bot_token']).build()
|
||||
|
||||
# Admin commands
|
||||
app.add_handler(CommandHandler("liste", liste))
|
||||
app.add_handler(CommandHandler("reset", reset))
|
||||
app.add_handler(CommandHandler("newEvent", newEvent))
|
||||
|
||||
# User commands
|
||||
app.add_handler(CommandHandler("start", hilfe))
|
||||
app.add_handler(CommandHandler("hilfe", hilfe))
|
||||
app.add_handler(CommandHandler("anmeldung", anmeldung))
|
||||
app.add_handler(CommandHandler("abmeldung", abmeldung))
|
||||
app.add_handler(CommandHandler("status", status))
|
||||
app.add_handler(CommandHandler("error", error))
|
||||
# app.add_handler(CommandHandler("start", start))
|
||||
|
||||
# buttons
|
||||
app.add_handler(CallbackQueryHandler(button))
|
||||
|
||||
print("Bot läuft...")
|
||||
app.run_polling()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
||||
######### NEEDS TO BE MOVED #####
|
||||
# Lade die Liste, falls vorhanden
|
||||
if os.path.exists(list_file):
|
||||
with open(config['list']['default'], "r") as f:
|
||||
event_list = json.load(f)
|
||||
else:
|
||||
event_list = []
|
||||
|
||||
# Hilfsfunktion zum Speichern
|
||||
def save_list():
|
||||
with open(config['list']['default'], "w") as f:
|
||||
json.dump(event_list, f)
|
||||
|
||||
Reference in New Issue
Block a user