Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Commit

Permalink
open channel after announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
Wonderfall committed May 29, 2020
1 parent 7b8adc8 commit bbb8afb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,6 @@ async def annonce_inscription():
inscriptions_channel = bot.get_channel(inscriptions_channel_id)
inscriptions_role = inscriptions_channel.guild.get_role(gamelist[tournoi['game']]['role']) if tournoi["restrict_to_role"] else inscriptions_channel.guild.default_role

if tournoi['reaction_mode']:
await inscriptions_channel.set_permissions(inscriptions_role, read_messages=True, send_messages=False, add_reactions=False)
else:
await inscriptions_channel.set_permissions(inscriptions_role, read_messages=True, send_messages=True, add_reactions=False)
await inscriptions_channel.edit(slowmode_delay=60)

await inscriptions_channel.purge(limit=None)

annonce_msg = await inscriptions_channel.send(annonce)
Expand All @@ -464,6 +458,12 @@ async def annonce_inscription():

await annonce_msg.pin()

if tournoi['reaction_mode']:
await inscriptions_channel.set_permissions(inscriptions_role, read_messages=True, send_messages=False, add_reactions=False)
else:
await inscriptions_channel.set_permissions(inscriptions_role, read_messages=True, send_messages=True, add_reactions=False)
await inscriptions_channel.edit(slowmode_delay=60)

await bot.get_channel(annonce_channel_id).send(f"{server_logo} Inscriptions pour le **{tournoi['name']}** ouvertes dans <#{inscriptions_channel_id}> ! Consultez-y les messages épinglés. <@&{gamelist[tournoi['game']]['role']}>\n"
f":calendar_spiral: Ce tournoi aura lieu le **{format_date(tournoi['début_tournoi'], format='full', locale=language)} à {format_time(tournoi['début_tournoi'], format='short', locale=language)}**.")

Expand Down

0 comments on commit bbb8afb

Please sign in to comment.