def __init__(self): ''' Constructor. ''' self.greets = {} # Load the greets self.file = get_storage_dir(self) + 'greets.json' self._load()
def __init__(self): ''' Constructor ''' self.dir = get_storage_dir(self)
if event == 'command': # .seen command user_arg = kwargs['args'].strip() if user_arg == irc.get_nick(kwargs['user']): return "You might wanna look in the mirror..." if user_arg == bot.nickname: return "Looking for me?" return handle_seen_command(user_arg) track_activity(event, **kwargs) seen_plugin.commands = {'seen': "Reports last time when user was seen"} register_plugin(seen_plugin) storage_dir = get_storage_dir(seen_plugin) # .seen command def handle_seen_command(user): ''' Handle the .seen command, returning the answer: when given user has been last seen. ''' if not user: return "You haven't said who you're looking for." user_file = os.path.join(storage_dir, user) if not os.path.exists(user_file): return "Sorry, I have never heard of '%s'." % user
def __init__(self): self.dir = get_storage_dir(self)