Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
teleexit/callbackQuery/reason.py
2020-11-07 13:18:24 +01:00

16 lines
622 B
Python

from telegram import Update
from telegram.ext import CallbackContext
from callbackQuery.new import new
from main import reasons
def reason(update: Update, context: CallbackContext):
data = update.callback_query.data.replace("reason_", "")
if data in reasons[update.effective_chat.id][update["_effective_user"]["id"]]:
del reasons[update.effective_chat.id][update["_effective_user"]["id"]]\
[reasons[update.effective_chat.id][update["_effective_user"]["id"]].index(data)]
else:
reasons[update.effective_chat.id][update["_effective_user"]["id"]].append(data)
new(update, context)