From 46df8f4e0da1165424d0bc2d0d34ca3b01101aed Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Wed, 1 May 2024 13:06:51 -0700 Subject: [PATCH] Move the roles blurb to the web endpoint as well --- app/bot.py | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/app/bot.py b/app/bot.py index 5af12914..1ce2303f 100755 --- a/app/bot.py +++ b/app/bot.py @@ -21,59 +21,35 @@ cogfiles = [ for cogfile in cogfiles: bot.load_extension(cogfile) +welcome_blurb = requests.get(core_utils.json_endpoint + "roles.json").json() + @bot.event async def on_ready(): print(f"{bot.user.name} has connected to Discord!") - # for server in bot.guilds: - # if server.name in [ - # "no officer it's hi how r u", - # ]: - # await server.leave() - # print("Left %s" % server.name) - if os.getenv("DRAGON_ENV") == "prod": # await bot.get_channel(152921472304676865).send("I have reconnected") # Waiting-room in zoid's server channel_id = 1026281775984549958 message_id = 1099374735428681758 - blurb = """# Please react to this message with one of the following emojis to be granted the appropriate role(s): -🚀 for Star Citizen + # Testing + # channel_id = 932476007439552522 + # message_id = 1235280116087787530 -<:helldivers:1205747460287504424> for HellDivers - -🐀 for Darktide/Vermintide - -:gear: for Lethal Company - -🤖 for Warframe - -🚔 for Ready or Not/Ground Branch - -🔫 for Tarkov or Grayzone - """ # message = await bot.get_channel(channel_id).send(blurb) # Update the message on_ready to match the content we always want to be there message = await bot.get_channel(channel_id).fetch_message(message_id) - await message.edit(content=blurb) + await message.edit(content=welcome_blurb["welcome_message"]) @bot.event async def on_raw_reaction_add(payload): guild = bot.get_guild(payload.guild_id) - role_map = { - "🔫": "Tarkov Gamers", - "🤖": "Warframe Enjoyers", - "🐀": "Dorktide Gamers", - "helldivers": "Hell Divers", - "🚀": "Star Citizens", - "⚙️": "Lethal Gamers", - "🚔": "Ready or Notters", - } + role_map = welcome_blurb["role_map"] if payload.channel_id == 1026281775984549958: role = discord.utils.get(guild.roles, name=role_map[payload.emoji.name])