Beispiel #1
0
    def sendRawCommand(self, rawCommand):
        # create MSG object from rawCommand
        message = MSG(rawCommand)

        # trying to get message (to be sure rawCommand is a MSG action)
        try:
            messageString = message.getMessage()
        except CommandException:
            return

        # trying to find substring with word 'bor'
        if messageString.find("bor") == 0:
            # construct outgoing message to send it to chat
            self.sendMessageToChat(u"Кто-то жаждит бор!")
        return