Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
    def get_author(self, chatid):
        """
		gets the last message author from the specific channel
		"""
        return Messages(self.token).get_author(chatid, self.proxy)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
    def sendFile(self, chatid, file, content):
        """
		sends a file to the specific channel
		"""
        return Messages(self.token).sendFile(chatid, file, content, self.proxy)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
    def deleteMessage(self, chatid, messageid):
        """
		deletes the message from the specific channel
		"""
        return Messages(self.token).deleteMessage(chatid, messageid,
                                                  self.proxy)
Ejemplo n.º 10
0
    def pinMessage(self, chatid, msgid):
        """
		pins a the specific message id to the specifc
		channel
		"""
        return Messages(self.token).pinMessage(chatid, msgid, self.proxy)
Ejemplo n.º 11
0
    def typing_action(self, chatid):
        """
		sends the typing message to the specific channel
		"""
        return Messages(self.token).typing_action(chatid, self.proxy)
Ejemplo n.º 12
0
def help_handler(message):
    """Handle "/help" command call"""
    text = Messages.help_message()
    bot.send_message(message.chat.id, parse_mode="Markdown", text=text)
Ejemplo n.º 13
0
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)
Ejemplo n.º 15
0
 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)
Ejemplo n.º 16
0
 def __init__(self, username, password):
     self.username = username
     self.password = password
     self.logged_in = False
     self.messages = Messages()