我使用类结构。我正在写一个不和谐机器人,用于播放声音。但我面临一个问题
我的music.py
文件:
import discord
from discord.ext import commands
class muzikkomut(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def play(self, mesaj):
kanal = mesaj.message.author.voice.voice_channel
await self.bot.join_voice_channel(kanal)
def setup(bot):
bot.add_cog(muzikkomut(bot))
首先,你必须告诉机器人,他必须去哪里
下一步,将机器人连接到语音频道
相关问题 更多 >
编程相关推荐