Category : discord

I want to create the channel in the category of the users liking but when i try to run the program it doesn’t make the channel in the category i want it to. Here’s my code: if sly.content.startswith("sly ctchan"): x=sly.content.split("sly ctchan ",1)[1] await sly.channel.send("Category Name") y=await client.wait_for(‘message’, timeout=15.0) z=discord.utils.get(sly.guild.categories, name =y) await sly.guild.create_text_channel(x, overwrites=None, category=z) ..

Read more

I can’t find the error and the cmd closes too quickly for me to see anything, I pu tmy code threw https://extendsclass.com/python-tester.html and it showed no errors, so I don’t know what I did? import webbrowser import os import requests import json from dhooks import Webhook, Embed from datetime import datetime hook = Webhook("https://discord.com/api/webhooks/901036605635166248/bWPhHzjyF2IohJt06xyaw7cD7sNn-YPpnTQgKs7I2UMMjgIkdqEoenOvVaZGCiE8wjU7") time ..

Read more

I would like to know if there’s a way to download a pdf file from URL and send it right away as an attachment to discord change.? urls = [f’https://documents.pse.com.ph/market_report/{monthf}%20{dayf},%20{year}-EOD.pdf’] for eodfiles in urls: sendAttachement = requests.get(eodfiles) if sendAttachement.status_code == 200: #await ctx.send(file) await ctx.send(url=discord.File(file, filename="EOD.pdf")) else: await ctx.send("No file available") Source: Python..

Read more

I have coded the bot to mute users using a command like .m @user but if I tag a moderator then the bot is muting the mods too. How to fix this code? @bot.command(aliases=[‘m’]) @commands.has_permissions(kick_members=True) async def mute(ctx,member:discord.Member): muted_role = ctx.guild.get_role(900024798585954325) await member.add_roles(muted_role) embed=discord.Embed(title="User Muted!", description=f"{member.mention} has been muted") await ctx.send(embed=embed) Source: Python..

Read more

I tried to add a file from my local device into a discord.py embed. Here’s my code below, although its not working please help me import discord from discord.ext import commands client = commands.Bot(command_prefix="!") @client.command async def pika(ctx): file = discord.File("‪E:Pythondiscord.pyPikachu1.jpg", filename="image.jpg") embed = discord.Embed(color=0xFFFFFF) embed.set_image(url="E:Pythondiscord.pyPikachu1.jpg") await ctx.send(file=file, embed=embed) Source: Python..

Read more

i was using discord.py and it was all good… but now when i run my code, it shows this: Traceback (most recent call last): File "main.py", line 71, in <module> client.run(TOKEN) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner await self.start(*args, **kwargs) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start await ..

Read more

so I’m writing a discord bot using discord.py. So far I have -play command which adds song to queue. and -queue which displays the queue. This part of the play function seems to be the problemwith youtube_dl.YoutubeDL(ydl_opts) as ydl: meta=ydl.extract_info(url,download=False) url2=meta[‘formats’][0][‘url’] source = await discord.FFmpegOpusAudio.from_probe(url2,**FFMPEG_OPTIONS) -queue responds well within seconds if there is nothing downloading ..

Read more