Category : discord.py

I tried to make a roll the dice commands its working but I don’t know why my embed image is not showing in the embed. @commands.command() async def aya(self, ctx): author = ctx.author roll = 1 #random.randint(1,6) print(roll) if roll == 1: file = discord.File("dice/dice1.png", filename="dice1.png") embed = discord.Embed( title= "Roll", color=discord.Color.blue() ) embed.set_thumbnail(url="attachment://dice/dice1.png") embed.add_field(name="Owner", ..

Read more

In discord.py, I am getting the bot to send a message. Then, I am getting the bot to assign that message object to a key in a json file. My code is async def testmessage(): with open(‘messages.json’) as json_file: data = json.load(json_file) channel = bot.get_channel(779563485724934184) message1 = await channel.send(‘hi’) print(data) data[‘message1’] = message1 with open(‘messages.json’, ..

Read more

So I have made a suggestion command using discord.py and here is the current code: @client.command() async def suggest(ctx, *, args): await ctx.message.add_reaction("🗑️") channel1 = client.get_channel(channel_id) embed = discord.Embed(title = "Suggestion from: " + ctx.author.name, color = 1752220) embed.set_author(name = ctx.author.name, icon_url = ctx.author.avatar_url) embed.add_field(name = "Author’s Suggestion:", value = args) msg = await channel1.send(embed ..

Read more

I’m trying to make my discord bot disconnect the voice channel with a command like -disconnect using Lavalink. I have tried doing it in various approaches but it never seems to work for me. I also can’t find many examples online. The most recent thing i’ve tried is this: @commands.command() async def leave(self, ctx): guild_id ..

Read more

I need some help with my discord bot. After some time when I start the script the bot just goes offline then the console get spammed with socket.send() raised exception. and directly after I start the script I also get this error /PycharmProjects/Rosy.Dc.py/main.py:38: RuntimeWarning: coroutine ‘Command.__call__’ was never awaited @bot.event RuntimeWarning: Enable tracemalloc to get ..

Read more