Skip to content

Commit

Permalink
feat(bot): add lacking texts
Browse files Browse the repository at this point in the history
  • Loading branch information
exmanka committed Jan 16, 2024
1 parent 569c82d commit 379c9db
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 33 deletions.
22 changes: 16 additions & 6 deletions src/handlers/other.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from aiogram import Dispatcher
from aiogram.types import Message
from aiogram.types import Message, CallbackQuery
from aiogram.utils import markdown
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from src.keyboards import user_authorized_kb, user_unauthorized_kb
from src.keyboards import user_authorized_kb, user_unauthorized_kb, other_kb
from src.database import postgres_dbms
from src.services import gpt4free, localization as loc
from bot_init import bot
Expand All @@ -16,7 +16,16 @@ async def command_help(message: Message):

async def show_project_info(message: Message):
"""Send message with information about project."""
await bot.send_photo(message.from_user.id, loc.other.tfids['project_info'], loc.other.msgs['project_info'])
await bot.send_photo(message.from_user.id, loc.other.tfids['project_info'], loc.other.msgs['project_info'], 'HTML', reply_markup=other_kb.faq_inline)
# if client is registered
if await postgres_dbms.is_user_registered(message.from_user.id):
await message.answer(markdown.hide_link('https://github.com/exmanka/ksiVPN-telegram-bot') + loc.other.msgs['github'], parse_mode='HTML')


async def show_faq(call: CallbackQuery):
"""Send message with F.A.Q. information."""
await call.message.answer(loc.other.msgs['faq_info'], parse_mode='HTML')
await call.answer()


async def answer_unrecognized_messages(message: Message):
Expand All @@ -41,11 +50,11 @@ async def answer_unrecognized_messages(message: Message):

async def command_start(message: Message, state: FSMContext = None):
"""Send message when user press /start."""
await bot.send_photo(message.from_user.id, loc.other.tfids['hello_message'], loc.other.msgs['hello_message'])
await bot.send_photo(message.from_user.id, loc.other.tfids['hello_message'], loc.other.msgs['hello_message'], 'HTML')

# if user isn't in db
if not await postgres_dbms.is_user_registered(message.from_user.id):
await message.answer(loc.other.msgs['price_info'], reply_markup=user_unauthorized_kb.welcome)
await message.answer(loc.other.msgs['more_info'], reply_markup=user_unauthorized_kb.welcome, parse_mode='HTML')

# if user is already in db
else:
Expand All @@ -55,12 +64,13 @@ async def command_start(message: Message, state: FSMContext = None):


def register_handlers_other(dp: Dispatcher):
dp.register_message_handler(command_start, commands=['start'], state='*')
dp.register_message_handler(command_help, commands=['help'])
dp.register_message_handler(command_help, commands=['help'], state='*')
dp.register_message_handler(command_help, Text(loc.other.btns['help'], ignore_case=True))
dp.register_message_handler(command_help, Text(loc.other.btns['help'], ignore_case=True), state='*')
dp.register_message_handler(show_project_info, Text(loc.other.btns['about_project'], ignore_case=True))
dp.register_message_handler(show_project_info, Text(loc.other.btns['about_service'], ignore_case=True))
dp.register_message_handler(command_start, commands=['start'], state='*')
dp.register_callback_query_handler(show_faq, Text(loc.other.btns['faq_inline_callback']), state='*')
dp.register_message_handler(answer_unrecognized_messages)
dp.register_message_handler(answer_unrecognized_messages, state="*")
2 changes: 1 addition & 1 deletion src/handlers/user_authorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def account_configurations_fsm_start(message: Message, state: FSMContext):
async def account_ref_program_fsm_start(message: Message, state: FSMContext):
"""Start FSM for account referral program menu and show account referral program menu keyboard."""
await state.set_state(user_authorized_fsm.AccountMenu.ref_program)
await message.answer(loc.auth.msgs['ref_program_info'], parse_mode='HTML', reply_markup=user_authorized_kb.ref_program)
await bot.send_photo(message.from_user.id, loc.auth.tfids['ref_program_info'], loc.auth.msgs['ref_program_info'], parse_mode='HTML', reply_markup=user_authorized_kb.ref_program)


@user_mw.authorized_only()
Expand Down
2 changes: 1 addition & 1 deletion src/keyboards/admin_kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
add(KeyboardButton(loc.admn.btns['reset_fsm_2']))


async def configuration(telegram_id: int) -> InlineKeyboardMarkup:
async def configuration_inline(telegram_id: int) -> InlineKeyboardMarkup:
"""Return dynamic inline keyboard with specified telegram_id as callback_data."""
return InlineKeyboardMarkup().add(InlineKeyboardButton(loc.admn.btns['config_answer_inline'], callback_data=telegram_id))
5 changes: 5 additions & 0 deletions src/keyboards/other_kb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from src.services import localization as loc


faq_inline = InlineKeyboardMarkup().add(InlineKeyboardButton(loc.other.btns['faq_inline'], callback_data=loc.other.btns['faq_inline_callback']))
27 changes: 16 additions & 11 deletions src/localizations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},

"telegram_file_ids": {

"easter_egg": "IAMHACKERMAN"
}
},

Expand Down Expand Up @@ -63,7 +63,7 @@
"client_info": "👾 That's what I know:\n\n{username_str}<b>Name</b>: {0}\n{surname_str}<b>Telegram ID</b>: {1}\n<b>Registration date</b>: {2}",
"subscription_info": "🌟 Subscription information:\n\n<b>{0}</b>\n{1}\n\n<b>Cost</b>: {2:g}₽ per month.",
"go_config_menu": "<i>Going to the configuration menu</i>",
"ref_program_info": "<b>Wow! We have a referral program!</b>\n\nWriting-referral-program-in-development",
"ref_program_info": "<b>Invite your friends to join the project and get a subscription for free!</b>\n\nWhen registering, ask for your referral promo code: a friend will immediately receive a month of use for free, as well as your subscription level. When he makes the payment for the first time, you will receive a month of subscription for free!",
"go_promo_menu": "<i>Going to the promo codes menu</i>",
"enter_promo": "<b>🎟 Send me the promo code by message!</b>",
"go_settings": "<i>Going to settings</i>",
Expand Down Expand Up @@ -94,11 +94,12 @@
"who_was_invited": "🕊 The users you invited who joined the project:\n\n{invited_str}",
"nobody_was_invited": "You haven't invited any users yet. Tell your friends about our project and get free months of subscription!",
"ref_program_invites_texts": [
"Darova, Father. I'm throwing you an invite to a very cool VPN project (go to the tg bot https://t.me/ksiVPN_bot )!\nWhen registering, go there, enter my referral promo code <code>{0}</code>. You will get a month of use for free!",
"Uh, Brother SubhanaLlah. Are you using a VPN? In any case, go to the tg bot https://t.me/ksiVPN_bot and register!First, enter my referral promo code <code>{0}</code>. You will use the VPN for free for a whole month!",
"Are you guys kidding me? I understand that you just want to go on Instagram and enjoy life. But why do you use such terrible VPN services?I am recruiting a team of guys, we will make a cache on foreign services: https://t.me/ksiVPN_bot.\n\nПри after registration, enter my referral promo code <code>{0}</code> and you will get a month of use for free!",
"In short, Marked, I saved you and I will not play nobility: you will register in the service https://t.me/ksiVPN_bot – and we're even.At the same time, let's see how quickly your head clears up after using free VPNs. And I will try to find out about referral promo codes.Who knows why you gave up this month of free subscription, but I'm not meddling in other people's business, if you want to use my referral promo code <code>{0}</code>, then there's something...",
"A man is being asked:\n- What do you like?\n- I love Instagrammer! Instagrammer I love pussy..ec! I would sit in the insta bl.t 24 hours a day, I would just look at all the rils of the world, I love rils already, I can't live without rils, I love instagramchik pussy..ec!\n- Hmm, I see. And what else do you like?\n- I love ChatGPT! ChatGPT I love pussy..ec! Dr.. I would chill him for days, d.. I would, d.. I would, etc..I would like to get into the OpenAI staff, just so that my head sticks out!\n- Uh.. And why the head?\n- I like to watch Rils..ec!\n\nThe panecdote is provided by the service https://t.me/ksiVPN_bot .\nEnter my referral promo code <code>{0}</code> and get a month of use for free upon registration!"
"Hello! I use a VPN, which is really convenient and secure. If you want to try it, enter my referral code <code>{0}</code> at registration https://t.me/ksiVPN_bot . Both will benefit! 🚀\n\n<tg-spoiler><i>This text is generated by the ChatGPT neural network, which can be easily accessed through the above VPN service 😉</i></tg-spoiler>",
"Greetings! I am opening the doors to the world of unlimited Internet with a cool VPN service. Register by following the link https://t.me/ksiVPN_bot and enter my referral code <code>{0}</code>. Both will receive bonuses for safe online surfing! 🌐🔒\n\n<tg-spoiler><i>This text is generated by the ChatGPT neural network, which can be easily accessed through the above VPN service 😉</i></tg-spoiler>",
"Hello there! I want to share my discovery – an excellent VPN service. Register using the link https://t.me/ksiVPN_bot and specify my referral promo code <code>{0}</code>. I promise you won't regret it! 🌍🔐\n\n<tg-spoiler><i>This text is generated by the ChatGPT neural network, which can be easily accessed through the above VPN service 😉</i></tg-spoiler>",
"Wow! This is one of several secrets hidden in the bot in honor of its launch, congratulations on finding it! Promo code: <code>BLADERUNNER</code>"
],
"your_ref_code": "🕊 Your referral promo code: <b><code>{0}</code></b>",
"error_promo_entered_ref_code": "Unfortunately, you can only enter referral promo codes when registering 😪",
Expand Down Expand Up @@ -145,7 +146,7 @@
"return_to_configs_menu": "Cancel selection",
"used_promos": "Used promo codes",
"ref_program_participation": "Participation in referral program",
"generate_invite": "Generate an invitation *",
"generate_invite": "Generate an invitation",
"show_ref_code": "Referral promo code",
"settings_chatgpt_mode": "ChatGPT mode",
"settings_notifications": "Notifications",
Expand All @@ -162,7 +163,7 @@
},

"telegram_file_ids": {

"ref_program_info": "AgACAgIAAxkBAAIBt2T4tvKfh4vtyw9E0esmv5ez8oipAAJH0jEba5XBS205NYeWh2RdAQADAgADcwADMAQ"
}
},

Expand Down Expand Up @@ -227,19 +228,23 @@
"other":
{
"messages": {
"hello_message": "👋 <b>Hi! I am a bot of the ksiVPN project — an unlimited, fast and completely secure VPN service for 200</b>₽<b>/month!</b>\n\n I will help you configure the connection, pay for the subscription, extend it for free, as well as solve many other tasks! If desired, you can even discuss <code>human</code> topics with me!",
"more_info": "More information about the service is available by clicking the <b>«About project»</b> button from below",
"help": "You can easily write to my creator if you have any problems, as well as if you have ideas to improve my work!\n\n<b>If I do not perceive button clicks, reset my state using the /start command</b>",
"project_info": "Unlimited, fast and completely secure service that allows you to establish a VPN connection in various countries of the world through your own VPS for 200₽ per month.",
"faq_info": "💬 <b>How much does the subscription cost?The cost of a basic subscription is 200rubles per month.\n\n💬 <b>What do I get for this cost?</b>\nVPN connection at maximum speed with no traffic limit on all project servers. The number of VPN connections is also unlimited within reason! And additional bot functions will be available.\n\n💬 <b>How does the connection work?In the question-answer mode, the BOT learns the necessary information from you, sends instructions and configuration. You need to download the application from the official store (PlayMarket or App Store) and, following the instructions, add the configuration (usually you just need to scan the QR code).\n\n💬 <b>Is the subscription price fixed?No, the cost of a subscription depends on its type, there are several of them. For example, a discounted subscription is available to testers and some others. The final subscription price will be displayed after entering the referral promo code.\n\n💬 <b>Are ChatGPT-type services available with this VPN?</b>\n are always available! Do not forget to specify their use when answering the bot's questions when creating the configuration.\n\n💬 <b>Which operating systems are supported?The service is available on all possible operating systems, including Android, iOS, Windows, macOS, Linux.\n\n💬 <b>Which servers are provided?</b>\n There are currently four servers available:\n1. Netherlands, Amsterdam — speed up to 1 GB/s, ping 30 ms.\n2. Germany, Nuremberg — speed up to 500 Mb/s, ping 40 ms.\n3. Latvia, Riga — speed up to 100 Mb/s, ping 20 ms.\n4. USA, Silicon Valley — speed up to 50 MB/s, ping 150 ms.",
"chatgpt_only_for_active_sub": "ChatGPT mode is available only to clients with an active subscription!",
"unrecognized_message": "<b>Sorry, I don't understand you</b> 🤔\n\n<tg-spoiler><i>You can give me unlimited power by enabling ChatGPT mode in the settings or by entering the command /chatgpt_mode</i></tg-spoiler>",
"hello_message": "Welcome-message-in-development",
"price_info": "The cost of a basic subscription is 200₽/month!",
"already_registered": "✨ Wow! You are already in our system! I'm teleporting to my personal account!"
"already_registered": "✨ Wow! You are already in our system! I'm teleporting to my personal account!",
"github": "<b>Special thanks</b>\n\n<b>to the UX/UI designer of the project:</b>\n🦩 to Olga @KoberO https://band.link/Dmt3l\n\n <b>The testing team:</b>\n🍒 Egor @Y0gu4t <code>EASTEREGGPROMO1032201661</code>\n🎀 Karina @Howtofindmee\n🍆 Denis @seregin_denis\n— they tried very hard to find bugs, but they never found them."
},

"keyboard_buttons": {
"help": "Help",
"about_project": "About project",
"about_service": "About service"
"about_service": "About service",
"faq_inline": "FAQ",
"faq_inline_callback": "faq"
},

"telegram_file_ids": {
Expand Down
Loading

0 comments on commit 379c9db

Please sign in to comment.