Move the roles blurb to the web endpoint as well
This commit is contained in:
parent
41b07e7deb
commit
46df8f4e0d
38
app/bot.py
38
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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user