def __init__(self, owner, channel_manager): self.owner = owner self.channel_manager = channel_manager self.mod_commands = CommandSet() self.commands = CommandSet(exact_match_commands={ '!requestjoin': self.request_join, '!requestleave': self.request_leave })
def set_commands(self): self.commands = CommandSet( exact_match_commands={ '!left': lambda display_name: self.move(display_name, 'left'), '!right': lambda display_name: self.move(display_name, 'right') })
def set_commands(self): commands = {} for party_member in self.quest.party[1:]: # Due to party_member changing every iteration, we have to copy the value of party_member # to something else, or the same reference will be used for every iteration commands['!{}'.format(party_member.lower())] = ( lambda display_name, target=party_member: self.pick(display_name, target)) self.commands = CommandSet(exact_match_commands=commands)
def initialize(self): log('Initializing channel manager...') self.channel_manager = ChannelManager(self) log('Initializing player manager...') self.player_manager = PlayerManager(self) # Commands for direct whispers to the bot self.whisper_commands = CommandSet()
def __init__(self, quest_manager): self.quest_manager = quest_manager self.party = quest_manager.party self.commands = CommandSet() # Quest segment ordering self.starting_segment = None self.current_segment = None
def set_commands(self): self.commands = CommandSet( exact_match_commands={ '!north': lambda display_name: self.guard(display_name, 'north'), '!south': lambda display_name: self.guard(display_name, 'south'), '!east': lambda display_name: self.guard(display_name, 'east'), '!west': lambda display_name: self.guard(display_name, 'west') })
def initialize(self): log('Initializing channel manager...') self.channel_manager = QuestChannelManager(self) log('Initializing player manager...') self.player_manager = QuestPlayerManager(self) # Commands for direct whispers to the bot self.whisper_commands = CommandSet( exact_match_commands={ '!xelabot': self.faq_whisper, '!help': self.faq_whisper, '!gold': self.stats_whisper, '!exp': self.stats_whisper, '!stats': self.stats_whisper, '!items': self.stats_whisper, '!prestige': self.try_prestige })
def set_commands(self): self.commands = CommandSet(exact_match_commands={ '!left': self.enter, '!right': self.enter })
def set_commands(self): self.commands = CommandSet(exact_match_commands={ self.quest.duel_word: self.attack })
def set_commands(self): """ Sets the commands available to players when they reach this quest segment. By default, nothing. Override this! """ self.commands = CommandSet()
def set_commands(self): self.commands = CommandSet(exact_match_commands={ self.quest.escape_word: self.escape })
def set_commands(self): self.commands = CommandSet(exact_match_commands={ '!attack': self.attack, '!flee': self.flee })