def send_message(self, chatid, content, tts=False): """ sends a message to a specific channel or a person """ return Messages(self.token).send_message(chatid, content) if tts: return Messages(self.token).send_message_with_tts(chatid, content)
def __init__(self, bot_client): self.bot_client = bot_client self.bot_id = self.bot_client.bot_id self.messages = Messages(self.bot_id) self.sym_message_parser = SymMessageParser() self.data_service = DataService()
def __init__(self, sym_bot_client): self.bot_client = sym_bot_client self.bot_id = self.bot_client.bot_id self.messages = Messages(self.bot_id) self.action_processor = ActionProcessor(self.bot_client)
def get_author_id(self, chatid): """ gets the id of the last user who typed in the specific text channel (chatid) """ return Messages(self.token).get_author_id(chatid, self.proxy)
def get_author(self, chatid): """ gets the last message author from the specific channel """ return Messages(self.token).get_author(chatid, self.proxy)
def get_message(self, chatid): """ gets the last message that has been sent from the specific channel """ return Messages(self.token).get_message(chatid, self.proxy)
def sendFile(self, chatid, file, content): """ sends a file to the specific channel """ return Messages(self.token).sendFile(chatid, file, content, self.proxy)
def editMessage(self, chatid, messageid, text): """ it edits the message from the specific channel id """ return Messages(self.token).editMessage(chatid, messageid, text, self.proxy)
def deleteMessage(self, chatid, messageid): """ deletes the message from the specific channel """ return Messages(self.token).deleteMessage(chatid, messageid, self.proxy)
def pinMessage(self, chatid, msgid): """ pins a the specific message id to the specifc channel """ return Messages(self.token).pinMessage(chatid, msgid, self.proxy)
def typing_action(self, chatid): """ sends the typing message to the specific channel """ return Messages(self.token).typing_action(chatid, self.proxy)
def help_handler(message): """Handle "/help" command call""" text = Messages.help_message() bot.send_message(message.chat.id, parse_mode="Markdown", text=text)
def start_handler(message): """Handle "/start" command call""" chat_id = message.chat.id text = Messages.start_message() bot.send_message(chat_id, text, parse_mode="Markdown")
def __init__(self, bot_client): self.bot_client = bot_client self.bot_id = self.bot_client.bot_id self.messages = Messages(self.bot_id)
def send_message(self, chatid, content): """ sends a message to a specific channel or a person """ return Messages(self.token).send_message(chatid, content, self.proxy)
def __init__(self, username, password): self.username = username self.password = password self.logged_in = False self.messages = Messages()