aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/music/join.py
blob: a0b51f9bebdcda6c47f3ed5cc3e5ce72815092f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from discord.ext import commands

import logging

logger = logging.getLogger(__name__)


class Join(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.slash_command(name="join", description="dołącza do kanalu")
    async def join(self, ctx):
        channel = ctx.author.voice.channel
        await channel.connect()
        await ctx.followup.send("Dołączono do kanalu głosowego", ephemeral=True)
        logger.info("Bot connected to voice channel")


def setup(bot):
    bot.add_cog(Join(bot))