Banned users env, access validator, removed silent command, code quality improvements

This commit is contained in:
miloszowi
2021-10-08 15:25:47 +02:00
parent d05d0c0904
commit 431b004284
28 changed files with 268 additions and 261 deletions

View File

@@ -0,0 +1,29 @@
from telegram import Update
from telegram.utils.helpers import mention_markdown
from bot.message.messageData import MessageData
from logger import Logger
class Replier:
@staticmethod
def interpolate(content: str, message_data: MessageData):
return content.format(
mention_markdown(message_data.user_id, message_data.username),
message_data.group_name
)
@staticmethod
def markdown(update: Update, message: str) -> None:
try:
update.effective_message.reply_markdown_v2(message)
except Exception as err:
Logger.error(str(err))
@staticmethod
def html(update: Update, html: str) -> None:
try:
update.effective_message.reply_html(html)
except Exception as err:
Logger.error(str(err))