Ejemplo n.º 1
0
    def broadcast(self, channelId, message):
        if not len(message) or message.isspace():
            return
        message = message.rstrip()
        if not isCommandMessage(message):
            try:
                self.__baseChannelChatCommand(channelId,
                                              CHAT_COMMANDS.broadcast,
                                              stringArg1=message,
                                              ignoreCooldown=False)
            except ChatError as ex:
                self._processChatError(CHAT_ACTIONS.broadcast, channelId, ex)

        else:
            try:
                command, int64Arg, int16Arg, stringArg1, stringArg2 = parseCommandMessage(
                    message)
                self.__baseChannelChatCommand(channelId,
                                              command,
                                              int64Arg,
                                              int16Arg,
                                              stringArg1,
                                              stringArg2,
                                              ignoreCooldown=False)
            except ChatCommandError as ex:
                self._processChatError(CHAT_ACTIONS.userChatCommand, channelId,
                                       ex)
Ejemplo n.º 2
0
 def broadcast(self, channelId, message):
     if not len(message) or message.isspace():
         return 
     message = message.rstrip()
     if not isCommandMessage(message):
         try:
             self.__baseChannelChatCommand(channelId, CHAT_COMMANDS.broadcast, stringArg1=message, ignoreCooldown=False)
         except ChatError as ex:
             self._processChatError(CHAT_ACTIONS.broadcast, channelId, ex)
     else:
         try:
             (command, int64Arg, int16Arg, stringArg1, stringArg2,) = parseCommandMessage(message)
             self.__baseChannelChatCommand(channelId, command, int64Arg, int16Arg, stringArg1, stringArg2, ignoreCooldown=False)
         except ChatCommandError as ex:
             self._processChatError(CHAT_ACTIONS.userChatCommand, channelId, ex)