diff --git a/cogs/messages.py b/cogs/messages.py index 1c1d98c..ac22747 100644 --- a/cogs/messages.py +++ b/cogs/messages.py @@ -7,6 +7,7 @@ class Messages(commands.Cog): def __init__(self, bot): self.bot = bot + self.channel = self.bot.get_channel(int(os.getenv('MSG_CHANNEL'))) def find_team(self, user): return load_cog(self.bot, 'Teams').find_team(user) @@ -28,10 +29,9 @@ async def ask(self, ctx, *, msg=None): elif not msg: await ctx.send('You must supply a message to send to the organizers!') else: - channel = self.bot.get_channel(int(os.getenv('CHANNEL'))) team_name = team['NAME'] team_id = team['ID'] - await channel.send(f'💬 **Message from {ctx.author.mention} of team `{team_name}` (Team ID: `{team_id}`)**\n**' + '\~' * 31 + f'**\n{msg}', allowed_mentions=AllowedMentions(everyone=False, users=[ctx.author], roles=False)) + await self.channel.send(f'💬 **Message from {ctx.author.mention} of team `{team_name}` (Team ID: `{team_id}`)**\n**' + '\~' * 31 + f'**\n{msg}', allowed_mentions=AllowedMentions(everyone=False, users=[ctx.author], roles=False)) await ctx.send(f'Message successfully delivered! The organizers will get back to you soon.') @organizer_channel() diff --git a/cogs/novice.py b/cogs/novice.py index 7175133..6a9b600 100644 --- a/cogs/novice.py +++ b/cogs/novice.py @@ -8,7 +8,7 @@ class Novice(commands.Cog): def __init__(self, bot): self.bot = bot - self.channel = self.bot.get_channel(int(os.getenv('CHANNEL'))) + self.channel = self.bot.get_channel(int(os.getenv('NOV_CHANNEL'))) self.problems = 26 self.tests = 10 self.submissions = data.get('SUBMISSIONS') diff --git a/core/util.py b/core/util.py index 609e2c5..ef73433 100644 --- a/core/util.py +++ b/core/util.py @@ -5,7 +5,7 @@ def new_id(): def organizer_channel(): async def check(ctx): - return str(ctx.channel.id) == os.getenv('CHANNEL') + return str(ctx.channel.id) in (os.getenv('NOV_CHANNEL'), os.getenv('MSG_CHANNEL')) return discord.ext.commands.check(check) def load_cog(bot, cog_name):