import discord
from discord.ext import commands
class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("music.py is ready!")
@commands.command(aliases=["j"])
async def join(self, ctx):
if not ctx.author.voice:
await ctx.send("...")
else:
channel = ctx.author.voice.channel
await channel.connect()
async def setup(bot):
await bot.add_cog(Music(bot))
Я не уверен, в чем проблема.
🤔 А знаете ли вы, что...
Python является интерпретируемым языком программирования.
Возможно, вы забыли включить намерения:
intents = discord.Intents.all() # enable privileged intents in the dev dashboard
bot = commands.Bot(..., intents=intents)