aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/halloween/spookysound.py
diff options
context:
space:
mode:
authorGravatar S. Co1 <[email protected]>2019-09-09 13:22:09 -0400
committerGravatar S. Co1 <[email protected]>2019-09-09 15:00:38 -0400
commitbd03db75805d02da2088ec5067993aa5f23184ae (patch)
tree4038157164a5d4eaf918870ed3063eda22421816 /bot/seasons/halloween/spookysound.py
parentAdd flake8-annotations to dev dependencies (diff)
Initial linting pass
Bot root, seasons cog, easter cogs, evergreen cogs, halloween cogs
Diffstat (limited to 'bot/seasons/halloween/spookysound.py')
-rw-r--r--bot/seasons/halloween/spookysound.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/seasons/halloween/spookysound.py b/bot/seasons/halloween/spookysound.py
index 44fdd9d6..e0676d0a 100644
--- a/bot/seasons/halloween/spookysound.py
+++ b/bot/seasons/halloween/spookysound.py
@@ -13,14 +13,14 @@ log = logging.getLogger(__name__)
class SpookySound(commands.Cog):
"""A cog that plays a spooky sound in a voice channel on command."""
- def __init__(self, bot):
+ def __init__(self, bot: commands.Bot):
self.bot = bot
self.sound_files = list(Path("bot/resources/halloween/spookysounds").glob("*.mp3"))
self.channel = None
@commands.cooldown(rate=1, per=1)
@commands.command(brief="Play a spooky sound, restricted to once per 2 mins")
- async def spookysound(self, ctx):
+ async def spookysound(self, ctx: commands.Context) -> None:
"""
Connect to the Hacktoberbot voice channel, play a random spooky sound, then disconnect.
@@ -37,12 +37,12 @@ class SpookySound(commands.Cog):
voice.play(src, after=lambda e: self.bot.loop.create_task(self.disconnect(voice)))
@staticmethod
- async def disconnect(voice):
+ async def disconnect(voice: discord.VoiceClient) -> None:
"""Helper method to disconnect a given voice client."""
await voice.disconnect()
-def setup(bot):
+def setup(bot: commands.Bot) -> None:
"""Spooky sound Cog load."""
bot.add_cog(SpookySound(bot))
log.info("SpookySound cog loaded")