Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #75 from yannickgloster/queue-disabled-fix
Browse files Browse the repository at this point in the history
Fixed the enabling and disabling of the queue
  • Loading branch information
lexesj authored Oct 19, 2020
2 parents c35a1e5 + e5f89bf commit 49c0ea8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from utils.server import WebServer
from utils.csgo_server import CSGOServer

__version__ = '1.1.2'
__version__ = '1.1.3'
__dev__ = 745000319942918303

class Discord_10man(commands.Bot):
Expand Down
10 changes: 8 additions & 2 deletions cogs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ async def setup_queue(self, ctx: commands.Context, enabled: bool = False):
self.bot.queue_voice_channel = ctx.author.voice.channel
self.bot.queue_ctx = ctx
if enabled:
self.bot.cogs['CSGO'].pug.enabled = not enabled
self.bot.cogs['CSGO'].queue_check.start()
if self.bot.cogs['CSGO'].queue_check.is_running():
self.bot.cogs['CSGO'].queue_check.restart()
else:
self.bot.cogs['CSGO'].queue_check.start()
self.bot.cogs['CSGO'].pug.enabled = False
else:
self.bot.cogs['CSGO'].queue_check.stop()
self.bot.cogs['CSGO'].pug.enabled = True
await ctx.send(
f'{self.bot.queue_ctx.author.voice.channel} is the queue channel.\n'
f'Queue is {"enabled" if enabled else "disabled"}.\n'
Expand Down

0 comments on commit 49c0ea8

Please sign in to comment.