diff options
| author | 2019-03-30 10:40:38 -0400 | |
|---|---|---|
| committer | 2019-03-30 10:42:02 -0400 | |
| commit | 095dc1791f147682023edafc59abdc4019074eeb (patch) | |
| tree | 160d7ee160042befbfba778e54507a5eee3bd686 /bot/seasons/halloween/spookysound.py | |
| parent | Merge branch 'master' into hotfix (diff) | |
| parent | Merge pull request #146 from python-discord/flake8-docstring (diff) | |
Merge branch 'master' into hotfix
Diffstat (limited to 'bot/seasons/halloween/spookysound.py')
| -rw-r--r-- | bot/seasons/halloween/spookysound.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bot/seasons/halloween/spookysound.py b/bot/seasons/halloween/spookysound.py index 1e430dab..b62a9893 100644 --- a/bot/seasons/halloween/spookysound.py +++ b/bot/seasons/halloween/spookysound.py @@ -10,10 +10,8 @@ from bot.constants import Hacktoberfest log = logging.getLogger(__name__) -class SpookySound(commands.Cog): - """ - A cog that plays a spooky sound in a voice channel on command. - """ +class SpookySound: + """A cog that plays a spooky sound in a voice channel on command.""" def __init__(self, bot): self.bot = bot @@ -24,9 +22,11 @@ class SpookySound(commands.Cog): @commands.command(brief="Play a spooky sound, restricted to once per 2 mins") async def spookysound(self, ctx): """ - Connect to the Hacktoberbot voice channel, play a random spooky sound, then disconnect. Cannot be used more than - once in 2 minutes. + Connect to the Hacktoberbot voice channel, play a random spooky sound, then disconnect. + + Cannot be used more than once in 2 minutes. """ + if not self.channel: await self.bot.wait_until_ready() self.channel = self.bot.get_channel(Hacktoberfest.voice_id) @@ -39,12 +39,12 @@ class SpookySound(commands.Cog): @staticmethod async def disconnect(voice): - """ - Helper method to disconnect a given voice client. - """ + """Helper method to disconnect a given voice client.""" await voice.disconnect() def setup(bot): + """Spooky sound Cog load.""" + bot.add_cog(SpookySound(bot)) log.info("SpookySound cog loaded") |