Move the roles blurb to the web endpoint as well
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
97323d2a2f
commit
ce36281fee
38
app/bot.py
38
app/bot.py
@ -21,59 +21,35 @@ cogfiles = [
|
|||||||
for cogfile in cogfiles:
|
for cogfile in cogfiles:
|
||||||
bot.load_extension(cogfile)
|
bot.load_extension(cogfile)
|
||||||
|
|
||||||
|
welcome_blurb = requests.get(core_utils.json_endpoint + "roles.json").json()
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print(f"{bot.user.name} has connected to Discord!")
|
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":
|
if os.getenv("DRAGON_ENV") == "prod":
|
||||||
# await bot.get_channel(152921472304676865).send("I have reconnected")
|
# await bot.get_channel(152921472304676865).send("I have reconnected")
|
||||||
|
|
||||||
# Waiting-room in zoid's server
|
# Waiting-room in zoid's server
|
||||||
channel_id = 1026281775984549958
|
channel_id = 1026281775984549958
|
||||||
message_id = 1099374735428681758
|
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)
|
# message = await bot.get_channel(channel_id).send(blurb)
|
||||||
# Update the message on_ready to match the content we always want to be there
|
# 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)
|
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
|
@bot.event
|
||||||
async def on_raw_reaction_add(payload):
|
async def on_raw_reaction_add(payload):
|
||||||
guild = bot.get_guild(payload.guild_id)
|
guild = bot.get_guild(payload.guild_id)
|
||||||
|
|
||||||
role_map = {
|
role_map = welcome_blurb["role_map"]
|
||||||
"🔫": "Tarkov Gamers",
|
|
||||||
"🤖": "Warframe Enjoyers",
|
|
||||||
"🐀": "Dorktide Gamers",
|
|
||||||
"helldivers": "Hell Divers",
|
|
||||||
"🚀": "Star Citizens",
|
|
||||||
"⚙️": "Lethal Gamers",
|
|
||||||
"🚔": "Ready or Notters",
|
|
||||||
}
|
|
||||||
|
|
||||||
if payload.channel_id == 1026281775984549958:
|
if payload.channel_id == 1026281775984549958:
|
||||||
role = discord.utils.get(guild.roles, name=role_map[payload.emoji.name])
|
role = discord.utils.get(guild.roles, name=role_map[payload.emoji.name])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user