예제 #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)
예제 #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()
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #9
0
    def deleteMessage(self, chatid, messageid):
        """
		deletes the message from the specific channel
		"""
        return Messages(self.token).deleteMessage(chatid, messageid,
                                                  self.proxy)
예제 #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)
예제 #11
0
    def typing_action(self, chatid):
        """
		sends the typing message to the specific channel
		"""
        return Messages(self.token).typing_action(chatid, self.proxy)
예제 #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)
예제 #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)
예제 #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)
예제 #16
0
 def __init__(self, username, password):
     self.username = username
     self.password = password
     self.logged_in = False
     self.messages = Messages()