Example #1
0
    def check_auth(self, auth):
        if auth['channel_id'] != get_guild_channel_board():
            self.auth_warning = '請到登記區登記'
            return False

        user_nickname = get_guild_member_nickname(auth['user_id'])
        if user_nickname:
            return True
        else:
            return False
Example #2
0
    def run(self, user_auth, param):
        user_id = user_auth['user_id']
        channel_id = user_auth['channel_id']

        user_nickname = get_guild_member_nickname(user_id)

        boss_id = get_guild_channel_index(channel_id)
        result = line_off(user_id, boss_id)
        if result:
            return f'{user_nickname} {result}'
        else:
            return '隊伍設定錯誤'
Example #3
0
    def run(self, user_auth, param):
        user_id = user_auth['user_id']
        channel_id = user_auth['channel_id']

        user_nickname = get_guild_member_nickname(user_id)

        comment = ' '.join(param) if param else ''
        boss_id = get_guild_channel_index(channel_id)
        result = line_up(user_id, boss_id, comment)
        if result:
            return f'{user_nickname} {result}'
        else:
            return '隊伍設定錯誤'
Example #4
0
    def run(self, user_auth, param):
        channel_id = user_auth['channel_id']

        boss_id = get_guild_channel_index(channel_id)
        players = get_line(boss_id, self.offset, self.list_all)

        result = ''
        if players:
            if self.list_all:
                for player in players:
                    player_nickname = get_guild_member_nickname(player.id)
                    result += f'{player_nickname} {player.comment}\n'
            else:
                for player in players:
                    result += f'<@{player.id}> {player.comment}\n'
        else:
            result = '目前沒有人在排隊'
        return result
Example #5
0
    def run(self, user_auth, param):
        user_id = user_auth['user_id']
        author_nickname = get_guild_member_nickname(user_id)

        where = f"play_date='{self.date}' AND user_id={user_id}"
        result = query('UserTable', where)
        report = {}
        if result:
            report["title"] = f"{self.date}出刀狀況"
            report["description"] = "已用閃退" if int(
                result[0]['missing_play']) > 0 else "未用閃退"

            details = query('TimeTable', where)
            for record in details:
                boss_info = f"{record['rounds']}周目{record['boss']}王"
                play_info = f"{self.play_type(record['play_type'])}{record['damage']}"
                if boss_info in report:
                    report[boss_info] += f"\n{play_info}"
                else:
                    report[boss_info] = play_info
        else:
            report = f'{author_nickname}還沒出刀呢...是不是肚子餓了?'

        return report
Example #6
0
 def check_auth(self, auth):
     user_nickname = get_guild_member_nickname(auth['user_id'])
     if user_nickname:
         return True
     else:
         return False