Ejemplo n.º 1
0
 async def configuration(self):
     guild = discordbot.get_guild(445948207638511616)
     return TournamentConfig(guild=guild,
                             racetime_category='smz3',
                             racetime_goal='Beat the games',
                             event_slug="smz3",
                             room_open_time=60)
Ejemplo n.º 2
0
 async def configuration(self):
     guild = discordbot.get_guild(307860211333595146)
     return TournamentConfig(guild=guild,
                             racetime_category='alttpr',
                             racetime_goal='Beat the game',
                             event_slug="alttprdaily",
                             room_open_time=60)
Ejemplo n.º 3
0
    async def _init(self):
        guild_id = await config.get(0, 'AlttprLeagueServer')
        self.guild = discordbot.get_guild(int(guild_id))

        if self.week is None:
            self.week = await config.get(guild_id, 'AlttprLeagueWeek')

        if self.week not in WEEKDATA:
            raise WeekNotFoundException(f'Week {self.week} was not found!')

        self.episode = await speedgaming.get_episode(self.episodeid)
        self.type = WEEKDATA[self.week]['type']
        self.friendly_name = WEEKDATA[self.week]['friendly_name']

        if self.type == 'preset':
            self.preset = WEEKDATA[self.week]['preset']
            self.seed, self.preset_dict = await preset.get_preset(self.preset,
                                                                  nohints=True)
        elif self.type == 'mystery':
            self.weightset = WEEKDATA[self.week]['weightset']
            self.seed, self.preset_dict = await mystery.generate_random_game(
                self.weightset)
        elif self.type == 'spoiler':
            self.preset = WEEKDATA[self.week]['preset']
            self.studyperiod = WEEKDATA[self.week]['studyperiod']
            self.seed, self.preset_dict, self.spoiler_log_url = await spoilers.generate_spoiler_game(
                WEEKDATA[self.week]['preset'])
        else:
            raise SahasrahBotException(
                'Week type not found, something went horribly wrong...')
Ejemplo n.º 4
0
    async def construct(cls, episodeid, week=None, create_seed=True):
        league_race = cls(episodeid, week, create_seed)
        guild_id = await config.get(0, 'AlttprLeagueServer')
        league_race.guild = discordbot.get_guild(int(guild_id))

        if league_race.week is None:
            league_race.week = await config.get(guild_id, 'AlttprLeagueWeek')

        if league_race.week not in WEEKDATA and not league_race.week == 'playoffs':
            raise WeekNotFoundException(
                f'Week {league_race.week} was not found!')

        league_race.episode = await speedgaming.get_episode(
            league_race.episodeid)

        for player in league_race.episode['match1']['players']:
            # first try a more concrete match of using the discord id cached by SG
            looked_up_player = await league_race.make_league_player_from_sg(
                player)
            league_race.players.append(looked_up_player)

        if league_race.create_seed:
            if league_race.is_playoff:
                await league_race._roll_playoffs()
            else:
                await league_race._roll_general()

        return league_race
Ejemplo n.º 5
0
 async def configuration(self):
     guild = discordbot.get_guild(307860211333595146)
     return TournamentConfig(guild=guild,
                             racetime_category='alttpr',
                             racetime_goal='Beat the game',
                             event_slug="sgl21alttpr",
                             coop=False,
                             stream_delay=20)
Ejemplo n.º 6
0
    async def _init(self):
        guild_id = await config.get(0, 'AlttprLeagueServer')
        self.guild = discordbot.get_guild(int(guild_id))

        if self.week is None:
            self.week = await config.get(guild_id, 'AlttprLeagueWeek')

        if self.week not in WEEKDATA and not self.week == 'playoffs':
            raise WeekNotFoundException(f'Week {self.week} was not found!')

        self.episode = await speedgaming.get_episode(self.episodeid)


        if self.week == 'playoffs':
            sheet_settings = await settings_sheet(self.episodeid)
            self.type = PLAYOFFDATA[sheet_settings.row['Game Number']]['type']
            self.friendly_name = PLAYOFFDATA[sheet_settings.row['Game Number']]['friendly_name']
            self.spoiler_log_url = None

            if self.type == 'preset':
                self.preset = PLAYOFFDATA[sheet_settings.row['Game Number']]['preset']
                self.seed, self.preset_dict = await preset.get_preset(self.preset, nohints=True)
                self.goal_after_start = f"vt8 randomizer - {self.preset_dict.get('goal_name', 'vt8 randomizer - misc')}"
                self.twitch_mode_command = f"The preset for this race is {self.preset}!  It is game number {sheet_settings.row['Game Number']} of this series."
            elif self.type == 'gsheet':
                self.preset = None
                self.preset_dict = None
                self.seed = await alttpr_discord.alttpr(
                    settings=sheet_settings.settings
                )
                self.goal_after_start = f"vt8 randomizer - {self.seed.generated_goal}"
                self.twitch_mode_command = f"The settings for this race is \"{self.seed.generated_goal}\"!  It is game number {sheet_settings.row['Game Number']} of this series."
            await sheet_settings.write_gen_date()
        else:
            self.type = WEEKDATA[self.week]['type']
            self.friendly_name = WEEKDATA[self.week]['friendly_name']
            self.spoiler_log_url = None
            self.twitch_mode_command = "THIS IS A PLACEHOLDER DO SOMETHING HERE"

            if self.type == 'preset':
                self.preset = WEEKDATA[self.week]['preset']
                self.seed, self.preset_dict = await preset.get_preset(self.preset, nohints=True)
                self.goal_after_start = f"vt8 randomizer - {self.preset_dict.get('goal_name', 'unknown')}"
            elif self.type == 'mystery':
                self.weightset = WEEKDATA[self.week]['weightset']
                self.seed = await mystery.generate_random_game(weightset=self.weightset, spoilers="mystery", tournament=True)
                self.goal_after_start = f"vt8 randomizer - mystery {self.weightset}"
            elif self.type == 'spoiler':
                self.preset = WEEKDATA[self.week]['preset']
                self.studyperiod = WEEKDATA[self.week]['studyperiod']
                self.seed, self.preset_dict, self.spoiler_log_url = await spoilers.generate_spoiler_game(WEEKDATA[self.week]['preset'])
                self.goal_after_start = f"vt8 randomizer - spoiler {self.preset_dict.get('goal_name', 'unknown')}"
            else:
                raise SahasrahBotException('Week type not found, something went horribly wrong...')

            if WEEKDATA[self.week].get('coop', False):
                self.goal_after_start += ' - DO NOT RECORD'
Ejemplo n.º 7
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='sgl',
         racetime_goal="Beat the game",
         event_slug="sgl21alttpr",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=False)
Ejemplo n.º 8
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='sgl',
         racetime_goal="Pokemon Mystery Dungeon Sky Randomizer",
         event_slug="sgl21pkmnredrando",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=False,
         gsheet_id=os.environ.get("SGL_RESULTS_SHEET"),
         auto_record=True)
Ejemplo n.º 9
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='twwr',
         racetime_goal="Spoiler Log Race",
         event_slug="sgl21twwr",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=False,
         stream_delay=60,
         gsheet_id=os.environ.get("SGL_RESULTS_SHEET"))
Ejemplo n.º 10
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='sgl',
         racetime_goal="Minecraft 2v2",
         event_slug="sgl21minecraft2v2",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=True,
         gsheet_id=os.environ.get("SGL_RESULTS_SHEET"),
         auto_record=True)
Ejemplo n.º 11
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='sgl',
         racetime_goal="Super Metroid Link to the Past Combo Randomizer",
         event_slug="sgl21smz3",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=False,
         gsheet_id=os.environ.get("SGL_RESULTS_SHEET"),
         auto_record=True)
Ejemplo n.º 12
0
 async def configuration(self):
     guild = discordbot.get_guild(508335685044928540)
     return TournamentConfig(
         guild=guild,
         racetime_category='test',
         racetime_goal='Beat the game',
         event_slug="test",
         audit_channel=discordbot.get_channel(537469084527230976),
         commentary_channel=discordbot.get_channel(659307060499972096),
         scheduling_needs_channel=discordbot.get_channel(
             835699086261747742),
         create_scheduled_events=True)
Ejemplo n.º 13
0
 async def configuration(self):
     guild = discordbot.get_guild(590331405624410116)
     return TournamentConfig(
         guild=guild,
         racetime_category='sgl',
         racetime_goal="Ocarina of Time Randomizer",
         event_slug="sgl21ootr",
         audit_channel=discordbot.get_channel(772351829022474260),
         commentary_channel=discordbot.get_channel(631564559018098698),
         coop=False,
         stream_delay=15,
         gsheet_id=os.environ.get("SGL_RESULTS_SHEET"),
         auto_record=True)
Ejemplo n.º 14
0
 async def configuration(self):
     guild = discordbot.get_guild(155487315530088448)
     return TournamentConfig(
         guild=guild,
         racetime_category='sm',
         racetime_goal='Triple Bingo',
         event_slug="smbingo",
         audit_channel=discordbot.get_channel(871187586687856670),
         helper_roles=[
             guild.get_role(404395533482983447),
             guild.get_role(338121128004288513),
             guild.get_role(173917459785449472),
         ])
Ejemplo n.º 15
0
 async def configuration(self):
     guild = discordbot.get_guild(470200169841950741)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttprfr",
         audit_channel=discordbot.get_channel(856581631241486346),
         commentary_channel=discordbot.get_channel(470202208261111818),
         helper_roles=[
             guild.get_role(482266765137805333),
             guild.get_role(507932829527703554),
         ],
         lang='fr')
Ejemplo n.º 16
0
 async def configuration(self):
     guild = discordbot.get_guild(469300113290821632)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttprcd",
         audit_channel=discordbot.get_channel(473668481011679234),
         commentary_channel=discordbot.get_channel(469317757331308555),
         helper_roles=[
             guild.get_role(534030648713674765),
             guild.get_role(469300493542490112),
             guild.get_role(623071415129866240),
         ],
         lang='de')
Ejemplo n.º 17
0
 async def configuration(self):
     guild = discordbot.get_guild(477850508368019486)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttpres",
         audit_channel=discordbot.get_channel(859058002426462211),
         commentary_channel=discordbot.get_channel(838011943000080395),
         scheduling_needs_channel=discordbot.get_channel(
             863771537903714324),
         scheduling_needs_tracker=True,
         helper_roles=[
             guild.get_role(479423657584754698),
             guild.get_role(477968190606016528),
         ],
         lang="es")
Ejemplo n.º 18
0
 async def configuration(self):
     guild = discordbot.get_guild(535946014037901333)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game (glitched)',
         event_slug="alttprhmg",
         audit_channel=discordbot.get_channel(850226062864023583),
         commentary_channel=discordbot.get_channel(549709098015391764),
         scheduling_needs_channel=discordbot.get_channel(
             863817206452977685),
         scheduling_needs_tracker=True,
         helper_roles=[
             guild.get_role(549709214000480276),
             guild.get_role(535962854004883467),
             guild.get_role(535962802230132737),
         ])
Ejemplo n.º 19
0
 async def configuration(self):
     guild = discordbot.get_guild(753727862229565612)
     return TournamentConfig(
         guild=guild,
         racetime_category='smw-hacks',
         racetime_goal='Any%',
         event_slug="smwde",
         audit_channel=discordbot.get_channel(826775494329499648),
         scheduling_needs_channel=discordbot.get_channel(
             835946387065012275),
         helper_roles=[
             guild.get_role(754845429773893782),
             guild.get_role(753742980820631562),
         ],
         lang='de',
         gsheet_id='1BrkmhNPnpjNUSUx5yGrnm09XbfAFhYDsi-7-fHp62qY',
     )
Ejemplo n.º 20
0
 async def configuration(self):
     guild = discordbot.get_guild(460905692857892865)
     return TournamentConfig(
         guild=guild,
         racetime_category='smz3',
         racetime_goal='Beat the games',
         event_slug="smz3coop",
         audit_channel=discordbot.get_channel(516808047935619073),
         commentary_channel=discordbot.get_channel(687471466714890296),
         scheduling_needs_channel=discordbot.get_channel(
             864249492370489404),
         scheduling_needs_tracker=True,
         helper_roles=[
             guild.get_role(464497534631542795),
         ],
         coop=True,
     )
Ejemplo n.º 21
0
 async def configuration(self):
     guild = discordbot.get_guild(469300113290821632)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttprmini",
         audit_channel=discordbot.get_channel(473668481011679234),
         commentary_channel=discordbot.get_channel(469317757331308555),
         helper_roles=[
             guild.get_role(534030648713674765),
             guild.get_role(469300493542490112),
             guild.get_role(623071415129866240),
         ],
         lang='de',
         stream_delay=10,
         gsheet_id='1dWzbwxoErGQyO4K1tZ-EexX1bdnTGuxQhLJDnmfcaR4',
     )
Ejemplo n.º 22
0
async def sgl_message():
    secret = request.args.get("secret")

    if not secret == os.environ.get('SGL_DATA_ENDPOINT_SECRET'):
        abort(401, description="secret required")

    payload = await request.get_json()

    guild_id = await config.get(0, 'SpeedGamingLiveGuild')
    guild = discordbot.get_guild(int(guild_id))

    member = guild.get_member_named(payload['discordTag'])

    if member is None:
        abort(404, description=f"{payload['discordTag']} user not found.")

    await member.send(payload['message'])

    return jsonify(success=True)
Ejemplo n.º 23
0
 async def configuration(self):
     guild = discordbot.get_guild(334795604918272012)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttpr",
         audit_channel=discordbot.get_channel(647966639266201620),
         commentary_channel=discordbot.get_channel(408347983709470741),
         scheduling_needs_channel=discordbot.get_channel(434560353461075969),
         scheduling_needs_tracker=True,
         helper_roles=[
             guild.get_role(334797023054397450),
             guild.get_role(435200206552694794),
             guild.get_role(482353483853332481),
             guild.get_role(426487540829388805),
             guild.get_role(613394561594687499),
             guild.get_role(334796844750209024)
         ]
     )
Ejemplo n.º 24
0
 async def configuration(self):
     guild = discordbot.get_guild(543577975032119296)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="invleague",
         audit_channel=discordbot.get_channel(546728638272241674),
         commentary_channel=discordbot.get_channel(611601587139510322),
         scheduling_needs_channel=discordbot.get_channel(
             878075812996337744),
         scheduling_needs_tracker=True,
         helper_roles=[
             guild.get_role(543596853871116288),
             guild.get_role(543597099649073162),
             guild.get_role(676530377812082706),
             guild.get_role(553295025190993930),
             guild.get_role(674109759179194398),
         ],
         stream_delay=10)
Ejemplo n.º 25
0
async def can_gatekeep(rtgg_id):
    guild_id = await config.get(0, 'AlttprLeagueServer')
    guild = discordbot.get_guild(int(guild_id))
    nicknames = await srlnick.get_discord_id_by_rtgg(rtgg_id)

    if not nicknames:
        return False

    discord_user = guild.get_member(nicknames[0]['discord_user_id'])

    if not discord_user:
        return False

    if discord.utils.find(
            lambda m: m.name in [
                'Admin', 'Mods', 'Restream Mod', 'Crew Mod', 'Reporting Mod',
                'SG Mods', 'Bot Overlord', 'Speedgaming', 'Restreamers'
            ], discord_user.roles):
        return True

    return False
Ejemplo n.º 26
0
 async def configuration(self):
     guild = discordbot.get_guild(334795604918272012)
     return TournamentConfig(
         guild=guild,
         racetime_category='alttpr',
         racetime_goal='Beat the game',
         event_slug="alttpr",
         audit_channel=discordbot.get_channel(647966639266201620),
         commentary_channel=discordbot.get_channel(947095820673638400),
         scheduling_needs_channel=discordbot.get_channel(
             434560353461075969),
         scheduling_needs_tracker=True,
         create_scheduled_events=True,
         stream_delay=10,
         gsheet_id='1epZRDXfe-O4BBerzOEZbFMOVCFrVXU6TCDNjp66P7ZI',
         helper_roles=[
             guild.get_role(334797023054397450),
             guild.get_role(435200206552694794),
             guild.get_role(482353483853332481),
             guild.get_role(426487540829388805),
             guild.get_role(613394561594687499),
             guild.get_role(334796844750209024)
         ])
Ejemplo n.º 27
0
    async def construct(cls, episode_id):
        sgl_race = cls()

        guild_id = await config.get(0, 'SpeedGamingLiveGuild')
        sgl_race.guild = discordbot.get_guild(int(guild_id))

        sgl_race.episode_data = await speedgaming.get_episode(episode_id)

        sgl_race.players = []
        for player in sgl_race.episode_data['match1']['players']:
            if player.get('streamingFrom', '') in ['sssrestream1']:
                continue

            sgl_race.players.append(SpeedGamingUser(sgl_race.guild, player))

        sgl_race.commentators = []
        for commentator in [c for c in sgl_race.episode_data['commentators'] if c.get('approved', False)]:
            sgl_race.commentators.append(SpeedGamingUser(sgl_race.guild, commentator))

        sgl_race.trackers = []
        for tracker in [c for c in sgl_race.episode_data['trackers'] if c.get('approved', False)]:
            sgl_race.trackers.append(SpeedGamingUser(sgl_race.guild, tracker))

        return sgl_race