diff --git a/example_config.ini b/example_config.ini index 757ea69..84d5fd0 100644 --- a/example_config.ini +++ b/example_config.ini @@ -15,6 +15,8 @@ port = 3001 ; if you don`t use local TelegramBotAPI Server + WebHooks -> Set settings in bot.py link = https://example.com/parse_me +chat_id = 1234 +; For feedback [Users] ;Uncomment this variable, if you use filters to users @@ -30,3 +32,8 @@ database_link = sqlite:///db.sqlite3 ;Seconds only/ time = 14400 ;//////////// + + +[payment] +payment_link = https://send.monobank.ua/jar/7nXV3s5Txd +card_number = 5375411204430461 diff --git a/handlers/private/__init__.py b/handlers/private/__init__.py index 8d06294..b9b25a2 100644 --- a/handlers/private/__init__.py +++ b/handlers/private/__init__.py @@ -1,4 +1,5 @@ from . import main from . import admin from . import timetable -from . import support \ No newline at end of file +from . import support +from . import donate diff --git a/handlers/private/donate.py b/handlers/private/donate.py new file mode 100644 index 0000000..14ea2a8 --- /dev/null +++ b/handlers/private/donate.py @@ -0,0 +1,11 @@ +from aiogram import types + +from load import dp, bot, config + +@dp.message_handler(commands=["donate"]) +async def donate(message: types.Message): + await bot.send_message( + message.chat.id, + (f"Оплптити онлайн: {config.payment_link}\n" + f"Переказ на карту: {config.card_number}\n") + ) diff --git a/handlers/private/support.py b/handlers/private/support.py index f97b279..34a42d7 100644 --- a/handlers/private/support.py +++ b/handlers/private/support.py @@ -9,9 +9,12 @@ async def feedback(message: types.Message, state): await bot.send_message(message.chat.id, "Напишіть ваше повідомлення!") await state.set_state(state="wait_for_support_message") + @dp.message_handler(state="wait_for_support_message") async def send_admins(message: types.Message, state): await message.copy_to(config.chat_id, reply_markup=await answer_kb(message.from_user.id)) + await message.answer("Дякую!") + @dp.message_handler(state="answer_support") async def send_answer(message: types.Message, state): diff --git a/keyboards/inline/donate.py b/keyboards/inline/donate.py index c090741..214c306 100644 --- a/keyboards/inline/donate.py +++ b/keyboards/inline/donate.py @@ -1,4 +1,6 @@ from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton +from load import config + donate = InlineKeyboardMarkup() -donate.add(InlineKeyboardButton("☕", url="https://send.monobank.ua/jar/7nXV3s5Txd")) +donate.add(InlineKeyboardButton("☕", url=config.payment_link)) diff --git a/utils/bot_commands.py b/utils/bot_commands.py index 3de6ed1..d3d5974 100644 --- a/utils/bot_commands.py +++ b/utils/bot_commands.py @@ -5,6 +5,7 @@ async def set_commands(dp): await dp.bot.set_my_commands([ types.BotCommand("start", "получить список замен"), types.BotCommand("help", "информация"), + types.BotCommand("donate", "Підтримка автора"), types.BotCommand("link", "получить ссылку на файл"), types.BotCommand('timetable', "Розклад"), types.BotCommand('feedback', "Звязок з адміністратором"),