Skip to content

Commit

Permalink
update to 2021 version
Browse files Browse the repository at this point in the history
  • Loading branch information
96-LB committed Dec 1, 2021
1 parent 124a7aa commit c8c129f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cogs/cogs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, discord
import os
from core.util import organizer_channel
from discord.ext import commands

Expand Down
8 changes: 4 additions & 4 deletions cogs/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def __init__(self, bot):
@commands.command()
async def help(self, ctx):
await ctx.send(
'**Welcome to QuHacks 2020!**\n' +
'All FreddyBot commands are only usable in this direct message channel. If a command is followed by `<arguments>`, fill in the additional info in the same message (e.g. `q!team create Advanced Freddy\'s Team`).\n' +
'**Welcome to QuHacks 2021!**\n' +
'All FreddyBot commands are only usable in this direct message channel. If a command is followed by `<arguments>`, fill in the additional info in the same message (e.g. `q!team create Project Freddy\'s Team`).\n' +
'```asciidoc\n' +
'= Command List =\n' +
'q!help :: displays this command\n' +
Expand All @@ -19,8 +19,8 @@ async def help(self, ctx):
'q!team join <id> :: adds you to the specified team\n' +
'q!team leave :: removes you from your team\n' +
'q!ask <message> :: sends a message to the organizers\n' +
'q!submit <problem> :: submits the code file attached to the message for judging\n' +
'q!test <problem> <test> :: shows the input for the specified test case'
# DISABLED 'q!submit <problem> :: submits the code file attached to the message for judging\n' +
# DISABLED 'q!test <problem> <test> :: shows the input for the specified test case'
'```'
)

Expand Down
1 change: 1 addition & 0 deletions cogs/novice.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ async def judge(self, ctx, submission_id=None, verdict=None):
await ctx.send('Verdict successfully submitted!')

def setup(bot):
return # DISABLED
bot.add_cog(Novice(bot))
16 changes: 8 additions & 8 deletions cogs/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ async def team(self, ctx):
'\n'.join([f'- <@{user}>' for user in team['USERS'].split('|')])
)
else:
message = 'You are not yet registered for QuHacks 2020! Use the `q!team create` command to register a new team or the `q!team join` command to join an already existing team.'
message = 'You are not yet registered for QuHacks 2021! Use the `q!team create` command to register a new team or the `q!team join` command to join an already existing team.'
await ctx.send(message)

@team.command()
async def create(self, ctx, division=None, *, name=None):
if self.find_team(ctx.author.id):
await ctx.send('You are already on a team! Use the `q!team leave` command if you want to switch teams.')
elif not division or division.upper() not in ['ADVANCED', 'NOVICE']:
await ctx.send('You must specify which division (`Novice` or `Advanced`) you wish to enter!')
elif not division or division.upper() not in ['PROJECT', 'BEGINNER']:
await ctx.send('You must specify which division (`Project` or `Beginner`) you wish to enter!')
elif not name:
await ctx.send('You must specify a team name!')
elif '`' in name:
Expand All @@ -56,7 +56,7 @@ async def create(self, ctx, division=None, *, name=None):
'TYPE': division.upper(),
'USERS': str(ctx.author.id)
})
await ctx.send(f'Welcome to QuHacks 2020! Your team has been registered under the name `{name}`! Your teammates can use the following team ID to join: `{team_id}`. Best of luck!')
await ctx.send(f'Welcome to QuHacks 2021! Your team has been registered under the name `{name}`! Your teammates can use the following team ID to join: `{team_id}`. Best of luck!')
self.update()

@team.command()
Expand All @@ -69,15 +69,15 @@ async def join(self, ctx, team_id=None):
team = self.find_team(team_id)
if not team:
await ctx.send('No team with that ID was found. Try creating a team with the `q!team create` command.')
elif len(team['USERS'].split('|')) >= 4:
await ctx.send('Sorry, that team is full! Teams can only have up to 4 members.')
elif len(team['USERS'].split('|')) >= 5:
await ctx.send('Sorry, that team is full! Teams can only have up to 5 members.')
else:
team['USERS'] += f'|{ctx.author.id}'
name = team['NAME']
self.update()

await self.broadcast(team, f'{ctx.author.mention} has just joined your team!', ctx.author.id)
await ctx.send(f'Welcome to QuHacks 2020! You have successfully joined the team `{name}`. Use the `q!team` command to see more. Best of luck!')
await ctx.send(f'Welcome to QuHacks 2021! You have successfully joined the team `{name}`. Use the `q!team` command to see more. Best of luck!')

@team.command()
async def leave(self, ctx):
Expand All @@ -92,7 +92,7 @@ async def leave(self, ctx):
self.update()

await self.broadcast(team, f'{ctx.author.mention} has just left your team!', ctx.author.id)
await ctx.send('You have successfully left your team. Make sure to create or join a new team to participate in QuHacks 2020!')
await ctx.send('You have successfully left your team. Make sure to create or join a new team to participate in QuHacks 2021!')
else:
self.teams.remove(team)
self.update()
Expand Down
1 change: 1 addition & 0 deletions cogs/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ async def test(self, ctx, problem=None, test=None):
await ctx.send(file=discord.File(f'test/{problems[problem - 1]}/{tests[test]}'))

def setup(bot):
return # DISABLED
bot.add_cog(Tests(bot))

0 comments on commit c8c129f

Please sign in to comment.