forked from pawel02/music_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
help_cog.py
37 lines (32 loc) · 1.28 KB
/
help_cog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import discord
from discord.ext import commands
class help_cog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.help_message = """
```
General commands:
/help - displays all the available commands
/p <keywords> - finds the song on youtube and plays it in your current channel. Will resume playing the current song if it was paused
/q - displays the current music queue
/skip - skips the current song being played
/clear - Stops the music and clears the queue
/leave - Disconnected the bot from the voice channel
/pause - pauses the current song being played or resumes if already paused
/resume - resumes playing the current song
```
"""
self.text_channel_list = []
#some debug info so that we know the bot has started
@commands.Cog.listener()
async def on_ready(self):
for guild in self.bot.guilds:
for channel in guild.text_channels:
self.text_channel_list.append(channel)
await self.send_to_all(self.help_message)
@commands.command(name="help", help="Displays all the available commands")
async def help(self, ctx):
await ctx.send(self.help_message)
async def send_to_all(self, msg):
for text_channel in self.text_channel_list:
await text_channel.send(msg)