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 in youtube and plays it
+skip - skips the current song (Duh)
+clear - clears the queue
+ clearAll - clears the queue and stops the current song
+leave - Kick the bot from the voice channel
+pause - pauses the current song or resumes it if it is paused
+resume - resumes playing the paused song

"""
        
        self.text_channel_list = []
    
    @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)
        
    async def send_to_all(self, msg):
        for text_channel in self.text_channel_list:
            await text_channel.send(msg)
            
    
    @commands.command(name = "help", help = "Displays all available commands")
    async def help(self, ctx):
        await ctx.send(self.help_message)

    
        
        
    