Replies: 1 comment
-
Try this
It works for me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import asyncio, discord
from dice import *
from discord.ext import commands
bot = commands.Bot(command_prefix="**")
@bot.command()
async def join(ctx):
if ctx.author.voice and ctx.author.voice.channel:
print("test1")
channel = ctx.author.voice.channel
print("test2")
await channel.connect()
else:
await ctx.send("No channel")
@bot.command()
async def leave(ctx):
await ctx.voice_client.disconnect()
@bot.event
async def on_ready():
print("We have loggedd in as {0.user}".format(bot))
@bot.command()
async def hello(ctx):
await ctx.send("Hello")
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send("commend error")
bot.run("Token")
There was a problem trying to add the bot to the voice channel. Test1 and Test2 are normally outputted to the console, but the bot is not on the voice channel. I need you to help me...
Beta Was this translation helpful? Give feedback.
All reactions