예제 #1
0
    def __init__(self):
        '''
        Constructor.
        '''
        self.greets = {}

        # Load the greets
        self.file = get_storage_dir(self) + 'greets.json'
        self._load()
예제 #2
0
파일: greet.py 프로젝트: Xion/seejoo
    def __init__(self):
        '''
        Constructor.
        '''
        self.greets = {}

        # Load the greets
        self.file = get_storage_dir(self) + 'greets.json'
        self._load()
예제 #3
0
파일: memo.py 프로젝트: gosuwachu/seejoo
 def __init__(self):
     '''
     Constructor
     '''
     self.dir = get_storage_dir(self)
예제 #4
0
파일: seen.py 프로젝트: Xion/seejoo
    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
예제 #5
0
파일: memo.py 프로젝트: Xion/seejoo
 def __init__(self):
     self.dir = get_storage_dir(self)