1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Move more strings to strings.py

This commit is contained in:
Steffo 2019-01-28 23:02:50 +01:00
parent baafe5278a
commit 9c537480a5

View file

@ -316,7 +316,7 @@ def cmd_mm(bot: Bot, update: Update):
try: try:
user = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).one_or_none() user = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).one_or_none()
if user is None: if user is None:
bot.send_message(update.message.chat.id, strings.TELEGRAM.ERRORS.TELEGRAM_NOT_LINKED, parse_mode="Markdown") bot.send_message(update.message.chat.id, s(strings.TELEGRAM.ERRORS.TELEGRAM_NOT_LINKED), parse_mode="Markdown")
return return
match = re.match(r"/(?:mm|matchmaking)(?:@royalgamesbot)?(?: (?:([0-9]+)-)?([0-9]+))? (?:per )?([A-Za-z0-9!\-_\. ]+)(?:.*\n(.+))?", match = re.match(r"/(?:mm|matchmaking)(?:@royalgamesbot)?(?: (?:([0-9]+)-)?([0-9]+))? (?:per )?([A-Za-z0-9!\-_\. ]+)(?:.*\n(.+))?",
update.message.text) update.message.text)
@ -333,7 +333,7 @@ def cmd_mm(bot: Bot, update: Update):
creator=user) creator=user)
session.add(db_match) session.add(db_match)
session.flush() session.flush()
inline_keyboard = InlineKeyboardMarkup([([InlineKeyboardButton(strings.MATCHMAKING.BUTTONS[key], inline_keyboard = InlineKeyboardMarkup([([InlineKeyboardButton(s(strings.MATCHMAKING.BUTTONS[key]),
callback_data=key)]) callback_data=key)])
for key in strings.MATCHMAKING.BUTTONS]) for key in strings.MATCHMAKING.BUTTONS])
message = bot.send_message(config["Telegram"]["announcement_group"], db_match.generate_text(session=session), message = bot.send_message(config["Telegram"]["announcement_group"], db_match.generate_text(session=session),
@ -364,7 +364,7 @@ def on_callback_query(bot: Bot, update: Update):
user = session.query(db.Telegram).filter_by(telegram_id=update.callback_query.from_user.id).one_or_none() user = session.query(db.Telegram).filter_by(telegram_id=update.callback_query.from_user.id).one_or_none()
if user is None: if user is None:
bot.answer_callback_query(update.callback_query.id, show_alert=True, bot.answer_callback_query(update.callback_query.id, show_alert=True,
text=strings.TELEGRAM.ERRORS.TELEGRAM_NOT_LINKED, text=s(strings.TELEGRAM.ERRORS.TELEGRAM_NOT_LINKED),
parse_mode="Markdown") parse_mode="Markdown")
return return
question = session.query(db.VoteQuestion)\ question = session.query(db.VoteQuestion)\