#discord-bots
1 messages Β· Page 502 of 1
maybe they'll add a new thing called self bots again π€
new thing
I don't even know what self bots are even though I've used discord since 2018
nop idc im bkocking you
why-
the god damn pings BYE
bye ig
Guys I want help in making a random command
For example my command is +joke
My bot shall tell a random joke I entered in him
Like that system which is in Java
Pls guys
How do you make a ascii command in python?
@manic wing :white_check_mark: Your eval job has completed with return code 0.
65
!e print(chr(65))
@manic wing :white_check_mark: Your eval job has completed with return code 0.
A
probably use an api
JokeAPI is a RESTful API that serves jokes from many categories while also offering a lot of filtering methods
heyyyyy anyone know js
as idk but ihave to convert js code to py
Use google translator
lmao
anyone know how i can filter my commands by cogs when calling /applications/{application_id}/commands via discord api?
note that this is a sepertated flask app, nothing i can take from my discord bot application
How much lines of code?
yes google translate is adding that feature
6-7
Yay
yess 6-7 line js i have to convert to py
for(let i = 0; i < lyrics.length; i += 2000) {
const toSend = lyrics.substring(i, Math.min(lyrics.length, i + 2000));
const message_embed1 = new Embed.MessageEmbed()
.setColor("RANDOM")
.setTitle(`Lyrics`)
.setDescription(toSend)
message.channel.send(messaje_embed1)
}```
What is this supposed to do
discord.js
yesss
Oh are you want rewrite it in python
i'm facing problem of 2000line
yessss
but i dont understand js π¦
Umm dont you know this is against the laws
It is against the TOS
!ytd
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTubeβs robots.txt file; (b) with YouTubeβs prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
i'm making at as a fun tbh
Until you use NCS music or your own music
srry if it wrong or something i just wanna flex in front of my friends π
i use genius api
π
bcos its just for lyrics but here the problrm is 2000 limit
on discord
that y i asked for help
async def nation(self,ctx,nation):
with open("generalaccess.json", "r") as f:
data = json.load(f)
if ctx.guild.id in data:```
I have file with ctx.guild included but not working
then paginate it
What is scoping and type hinting
hi, does anyone know how i can make my bot download messages like images and pdf files? from the link provided as an argument (the link from the discord message)
@client.event
async def on_ready():
while True:
print("cleared")
await asyncio.sleep(10)
with open('spam.txt', 'r+') as file:
file.truncate(0)
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r++') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
file.writelines(f"{str(message.author.id)}")
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
I am not able to ban someone when the same message is repeated more than 5 times
how do I nickname someone with custom emojis?
how to check author in buttons?
Hey @serene lynx!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
There are options with third party packages if you wish to make your antispam more complex.
Also in relation to your thing, have you tried checking the file and seeing how many times there id is in the file? And how far does it get
ya
But this isn't working
Define 'isnt working'.
Check how many times counter is incremented in the if, can we see the text file, print the author id
Isnt working isn't the most helpful statement
huh?
"Check how many times counter is incremented in the if, can we see the text file, print the author id"
I mean when someone sends a message the it should add 1 to the counter
and if the message is different then counter = 0
It should, and have you checked what it actually does?
and then if the counter == 5 ban
Ya I checked it's not working
let's try that again
Which part isnt working. Theres multiple things that could go wrong
When my friend types a message everytime I think it's not adding something to counter
Does it write to the file?
Somone told me that the counter becomes 0 everytime I send message
Can you change r++ to r+ and try again?
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r++') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
``` See counter = 0 on_message
ok
Yep, doesnt matter. It sets counter to the counter for that person with the code you have there
Do you have any plans to make this more complex?
No not for now
Sweet as, just because if you did I'd say use a third party library or something that does most of the work for you.
But safe as, did the r+ thingy work. Does it write to the file now? Cos thats the first thing to fix
How would I get a channel ID where a user is connected using their user ID
I am checking that
!d discord.Member
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
hash(x) Returns the memberβs hash.
str(x) Returns the memberβs name with the discriminator.
Take a look through the docs for a connect channel on member's iirc
i think its a icon for verified servers
u cannot use custom emoji in name but u can use unicode emojis
I see the Member object but it doesn't seem like that has the channel ID included
so its something only for verified servers?
yes probably
https://discordpy.readthedocs.io/en/master/api.html#discord.Member.voice
Theres a channel there so idk what your looking at
cuz i dont see them in partnered servers
the server in the image has emojis next to their nicknames as if it was part of the nickname
hmm never seen that before
yeah first time seeing it too for me
anyone for help?
its valorant?
ye
Oh didn't realize "voice" was the channel Id. Thanks
Its not. Read its docs
what module should i import to make redditeasy defined?
it dosent seem like its part of any nicknames either
Can help me write some unittests if you want

Whats reddditeasy
@valid perch It gives me error
When somone sends a message
FileNotFoundError: [Errno 2] No such file or directory: 'spam.txt'
This file is there
In the same folder
omg he doesnt know
@bot.command(aliases = ['m'])
async def meme(ctx):
post = redditeasy.AsyncSubreddit(subreddit = 'memes', client_id='id here',
client_secret = 'secret',
user_agent = 'memes')
postoutput = await post.get_post()
em2 = discord.Embed(title = f'{postoutput.title}')
url = postoutput.content
em2.set_image(url = url)
await ctx.send(embed = em2)```
redditeasy
thats only "spam" not "spam.txt"p
they are same?
wait that makes the both of us
I dont work with reddit
no
which module should i import?
They are not, generally. Rename the file and add .txt to the end within pycharm
By the looks of it, you actually need to install it
^^^
actually in repl import auto installs it
Welp i'm out. Repl
If python is saying moduleNotFound, then it's not installed in the enviroment
Just rename it spam.txt, or create a file called spam.txt
can u help?
Thats progress
but no ban
π
ok
@client.event
async def on_ready():
while True:
print("cleared")
await asyncio.sleep(10)
with open('spam.txt', 'r+') as file:
file.truncate(0)
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r+') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
file.writelines(f"{str(message.author.id)}")
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
while True:
print('counter')
Why ddidd you add a while true?
To see How many time the counter updates
That doesnt tho?
it's just not necessary
It just prints counter forevery haha
It isn't blocking my code?
The print should be here
counter += 1
Just get rid of it
oh I should have made it print(counter)
The whole thing?
I mean it prints "Woah! I just incremented the counter"
but it si not printing that again when message is send
However many times it prints is how many times that user is in the file
file.writelines(f"{str(message.author.id)}") Add a print statement after this line printing counter?
Code?
@client.event
async def on_ready():
while True:
print("cleared")
await asyncio.sleep(10)
with open('spam.txt', 'r+') as file:
file.truncate(0)
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r+') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
print("Woah! I just incremented the counter")
file.writelines(f"{str(message.author.id)}")
print('hmm')
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
it prints hmm when I type a mesage
"It will always print hmm"
really I don't think so
Not sure if my messages arent sending or what, but please print counter
The value of counter right?
Yep.
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r+') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
print("Woah! I just incremented the counter")
print(counter)
file.writelines(f"{str(message.author.id)}")
print('hmm')
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
So it print's 1
but after it resets
So that means your only in the file once
Wait
ugh, cmon dude. I asked you to print it after file.writelines(f"{str(message.author.id)}")
lol ok
0
hmm
cleared
0
hmm
Woah! I just incremented the counter
1
hmm
0
hmm
0
hmm
0
hmm
0
hmm
0
hmm
output
Code?
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'r+') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
print("Woah! I just incremented the counter")
file.writelines(f"{str(message.author.id)}")
print(counter)
print('hmm')
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
Whats the contents of your file look like?
What keeps clearing it
idk but I think it's not even adding the ID
Lol I figured it out I think. Change r+ to w+
Using w+?
The value should also increse
@client.event
async def on_message(message):
counter = 0
with open('spam.txt', 'w+') as file:
for lines in file:
if lines.strip("\n") == str(message.author.id):
counter += 1
print("Woah! I just incremented the counter")
file.writelines(f"{str(message.author.id)}")
print(counter)
print('hmm')
if counter > 5:
await message.guild.ban(message.author, reason='spam')
await asyncio.sleep(1)
await message.guild.unban(message.author)
print("uh oh")
Maybe a+?
anwyays I maybe go ofline
You can check out this if you want something that ddoes the work for you in the future
!pypi discord-anti-spam
An easy to use package for anti-spam features in discord.py.
Anyway adios and gl
Look at the custom punishments section for your usecase and @me if you want help with it
Hey, I am looking for someone to make a youtube channel with about discord.py tutorials and on how to make bots. If you are interested dm me
Why make one with someone, just make it yourself
*What benefits would someone get joining rather then doing it themselves
does a music bot use a lot of memory?
Why am I getting missing permissions error when trying to addrole
I am the owner of the discord and have all permissions
so idk why it says that
hi can anyon help me i am making a dc bot and ading a feature of giving role when member join my bot is online but it dont give role when member joins
does the bot have perms to do so/is the bot's role above the requested user's role
well maybe not hierarchy
example?
is the bot even online when ur doing it
can u try putting something in on_ready like print("online")
Thank you very much 2nd option fixed it
it works
oh nvm
i said do print("online")
What do I use to force people to have specific permissions to use commands?
no bro i said do print
can give example of command
@discord.ext.commands.has_role(item)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has the role specified via the name or ID specified.
If a string is specified, you must give the exact name of the role, including caps and spelling.
If an integer is specified, you must give the exact snowflake ID of the role.
If the message is invoked in a private message context then the check will return `False`.
This check raises one of two special exceptions, [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") if the user is missing a role, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Changed in version 1.1: Raise [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
what? do u even know what print is
i k print
do print("online") in on_ready
sec
k
gimme sec #bot-commands
k
k
Why am I getting this error?
Did you read the docs?
Yeah I have
What kind of arg is used?
Hello! Im trying to make a bot which reacts to any messages send in a channel for a star board. However, im dead confused on how to do it, could anyone help? I know how to do the star board but not sure how to make it react to every message.
on_member_join you have ctx but it needs to be member since you are working with that object.
!d discord.on_raw_message_edit
discord.on_raw_message_edit(payload)```
Called when a message is edited. Unlike [`on_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message_edit "discord.on_message_edit"), this is called regardless of the state of the internal message cache.
If the message is found in the message cache, it can be accessed via [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/master/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message"). The cached message represents the message before it has been edited. For example, if the content of a message is modified and triggers the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") coroutine, the [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/master/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message") will return a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") object that represents the message before the content was modified.
Due to the inherently raw nature of this event, the data parameter coincides with the raw data given by the [gateway](https://discord.com/developers/docs/topics/gateway#message-update).
oh
oof thats gonna get alot of ratelimits
oh okay gotcha, also how can I add multiple roles to the has_roles
cause it only takes 1 argument currently
aka 1 role but I wanna add like 5 roles
didnt work
By using the all function you can evaluate it
i am confused
How do you want it to work? Will they need all roles or just 1 role inside those roles.
tell @cloud dawn
Revert back to when it was it's more broken now
on role =... replace ctx with member thats it
use role id
btw ctx or ctx.guild.get_role()
member.guild.get_role()
You are using the member object so you will need to use the member variable
are you new to python
yea
then you should learn more python
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
discord.py is not for beginners
Nice danny profile picture by the way.
its from the same manga so i guess?
you know that when on_disconnect triggers the bot is already disconnected and isn't able to send stuff to discord anymore?
Yea
But I add
you are getting a channel and trying to send to it
but you will never be able to send the message
because the bot disconnected
yea it is sended when i leave my vs code open and i am not working
dident work
await ctx.guild.get_role(id)
not necessarily, it can be called during reconnects
@orchid talon
yea
get_x is a cache lookup and not async
wait
fetch_x is an API call and async
dident work
huh
Stop saying didn't work and give us the error lol
with id also
what
Show us your code and error (if there is one)
no error but it is not giving role
I have a temp vc code, how do I add the user who made the VC to the perms?
show your code
during create channel you can pass permissions
or you can edit the channel after the fact
but i recommend just passing them when creating the channel to avoid clutter
TypeError: Protocols with non-method members don't support issubclass() i got this error after trying to make a cog with slash commands
where name
that synxtax.....
why do u have 2 parentheses
how long have you been doing python for?
4*
2 sets
also context.message.channel.send
3 months
How can I check if the ctx.message.author has the correct role to do a command and if they dont then ctx.send
instead of just doing ctx for the variable name and doing ctx.send
i mean i sense a great lack of basic python knowledge
and trust me when i say that discord bots isn't just some random learning project
discord bots require a good basic knowledge, and have a VERY specific way of writing
it's not something you'll often see
no one on yt can teach python is good
they are good
tech with tim
hmm
but they don't do dpy tutorials and i think that's for the best
also that random indian guy
^
??? what
I been learning for a month and seem to have more knowledge then you, whatever you been doing for 3 months may not be working

We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
i am not coding i am only seeing videos on yt
Ah yea
so true
anyways back on topic
How can I check if the ctx.message.author has the correct role to do a command and if they dont then ctx.send
you wanna check if the user invoking the command has a certain role and if they dont you dont wanna send the message?
yea
I already made it so ONLY users with correct roles and permissions can use a command but I wanna send a message to those who dont have correct roles saying "Sorry you cant use that"
use a check
Can you give me an example?
!d discord.ext.commands.has_any_role
@discord.ext.commands.has_any_role(*items)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has **any** of the roles specified. This means that if they have one out of the three roles specified, then this check will return True.
Similar to [`has_role()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.has_role "discord.ext.commands.has_role"), the names or IDs passed in must be exact.
This check raises one of two special exceptions, [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") if the user is missing all roles, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Changed in version 1.1: Raise [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
You can add an error the command or make a global error handler
He already did that
Oh
I just wanna ctx.send just like mee6 does if I try !ban someone
!d discord.ext.commands.MissingRole Use an on_command_error event and compare the errror with this instance
exception discord.ext.commands.MissingRole(missing_role)```
Exception raised when the command invoker lacks a role to run a command.
This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
New in version 1.1.
thank you
!d discord.on_raw_reaction_add
discord.on_raw_reaction_add(payload)```
Called when a message has a reaction added. Unlike [`on_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_reaction_add "discord.on_reaction_add"), this is called regardless of the state of the internal message cache.
This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.
Can someone tell me how to leave a team on discord?
@hasty iron any way i can find the attributes for payload?
have you even clicked the doc link
obviously lol
Debug it
paramters is different from payload
oh wow its not like there is hyperlink on payload's type
π
what is this??
Can someone tell me how to leave a team on discord?
idt u can
Unless you have gotten to the website and also accidentally done the survey and clicked okay that is a pretty impressive mistake.
yes from my EMAIL and i want OUT
can soeone give me the invite to discord api server
Just click on your badge and the "leave house"
i cant do that
im talking about teams

those are houses
https://discord.com/developers/teams this one
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
go to the website, go to teams, then at the members list hit remove on yourself
aight
then enter your 2FA code
How do I make a hyperlink on clickable text
some fields in an embed have a url= kwarg, some support the hyperlink markdown
hyperlinks outside of embeds are not possible
no but look at the picture I sent
[name](link)
I want the "CMG LOCKED VEHICLES" thing
the embed title has a URL kwarg, which makes it a hyperlink
in embed description or field value you can use [display text](url)
thank you
u can lol
wait since when did they add hover text support?
!d discord.Embed.url
The URL of the embed. This can be set during initialisation.
whats hover text?
looooong time
When you hover over the link it gives info above the cursor
the text shown when you hover the mouse pointer over the link
it's text that appears when you hover over a link
wasnt that always there?
this is hover text @boreal ravine
how
Webhooks
@client.event
async def on_raw_reaction_add(payload):
print("working")```
idk what im wrong
im not getting any errors either'
on_raw is supossed to be able to react to messages older then the internal cache right? so why it is not working :C
Getting an error
you have an invalid embed
It literally tells ya the problem
ahhh
You don't need to use [] in the url for title
fixed it thanks
well a webhook is a whole different story, no authorization, no account, it just sends raw data and your client displays it as a message
Yep
Was always there
How can I run my python discord bot script on a VPS?
wont the VPS need the libraries etc
they either have a option for you to add your libraries
Or you can just upload the folder of the library in the vps's container
guys is there any way to get all the channels of a list
all channels of a guild?
yes
!d discord.Guild.channels
property channels: List[GuildChannel]```
A list of channels that belongs to this guild.
tag prefix ?
how do I go about doing the 2nd option
pip install it?
My bad the bot is using webhooks
Is there an easy way to go to a website and copy specific href?
i mean i want all their id and names in a list
You got those libraries installed on your device?
do a list comp
[(channel.id, channel.name) for channel in Guild.channels] or something
If yes , just go your python path folder/Libs/site-packages/ and copy the folder of the library you want
@hasty iron py [(channel.id, channel.name) for channel in guild.TextChannels]
it will return the data of text channels right?
no
so
property text_channels: List[discord.channel.TextChannel]```
A list of text channels that belongs to this guild.
This is sorted by the position and are in UI order from top to bottom.
i have a guild object
ok so what
guild = my_bot.get_guild(data.guild_id)
text = [(channel.id, channel.name) for channel in guild.TextChannels]
im telling you it would raise an AttributeError
yea
@proven elm
alright thank you
Guild has no attribute TextChannels
read what blanket said
ok so how can i get the text channels
can you read?
<guild obj>.text_channels
thanks
How do I delete a webhook automatically? I found nothing on channel.delete_webhook.
!d discord.Webhook.delete
await delete(*, reason=None, prefer_auth=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes this Webhook.
you can fetch the webhook by discord.Client.fetch_webhook :p
wait im stuck on how i delete it? I mean define it
isnt that manually?
wait
So I want my bot to create a webhook > delete if after a command was invoked
Use a variable for the webhook and use variable.delete()
Like in this image if would have added
await c.delete()``` the webhook would have got delete
yeah but how do I make my bot automatically fetch the webhook
wait
brb
!d discord.Client.fetch_webhook it takes webhook id as argument
await fetch_webhook(webhook_id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a [`Webhook`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook "discord.Webhook") with the specified ID.
hmm thanks it worked
!d discord.AllowedMentions
class discord.AllowedMentions(*, everyone=True, users=True, roles=True, replied_user=True)```
A class that represents what mentions are allowed in a message.
This class can be set during [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") initialisation to apply to every message sent. It can also be applied on a per message basis via [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for more fine-grained control.
thanks-
Is this correct? ```py
bot = commands.Bot(command_prefix=commands.when_mentioned_or('.'), case_insensitive=True, intents = discord.Intents.all(), allowed_mentions=everyone=False)
nope it's raises a 'everyone' not defined and syntax error
then how does one do it
allowed_mentions = discord.AllowedMentions(everyone= False)
thanks it worked
How can I delete a message?
msg_obj.delete()
Ok
!d discord.Message.delete
await delete(*, delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the message.
Your own messages could be deleted without any proper permissions. However to delete other peopleβs messages, you need the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission.
Changed in version 1.1: Added the new `delay` keyword-only parameter.
We won't help code relating to youtube_dl
how to add a react yo an embed guys
Add.reaction
thx
Still breaks ToS
!d discord.Message.add_reaction
await add_reaction(emoji)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Add a reaction to the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").
You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
Has anyone done a Auction system ? I would like to know how it works, please
can you run 2 bots under one script??
Yes. Should you? No
how do i change the color of my text in the middle of a message? i only know how to do this:
example
You can't change the color of your text in between text
then how is this both red and green
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
You can change the py to any language you want
ok
Those are python things you can't change it lol
ok
i think i did it wrong
where i will get the bot id?
Profile > Copy ID
bot.user.id iirc
that is all discord.Guilds
or that
its a list of discord.Guild
to get names do guild.name
[guild.name for guild in bot.guilds]
a client id and bot id is same?
client is?
discord website is asking client id and bot id bot
i'm just trying to fetch the guild names that the bot is in
^^
thats the same thing lmfao.
Has anyone done a Auction system ? I would like to know how it works, please
doesnt mention anything about a user tho
so i should give same thing?
than why they asked same thing?
ask the developers
@visual island it still does the same thing
show code?
New one
@bot.command()
async def guildlist(ctx):
for guilds in bot.guilds:
emb=discord.Embed(title = "List of guilds i am in", description = f'{bot.guilds}', color = discord.Colour.random())
await ctx.send(embed=emb)
you're still putting bot.guilds there
what do i put, guild.name?
replace it with this
this
no
replace the bot.guilds with that?
yes

from discord import Embed, File
from discord.ext import commands
client = commands.Bot(command_prefix='>')
token =βmy token here"
@client.event
async def on_ready():
print('Connected to bot: {}'.format(client.user.name))
print('Bot ID: {}'.format(client.user.id))
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name=f">help"))
@client.command
async def help(ctx):
embed = Embed(title="Azure", description="Created by Zolee")
embed.add_field(name=">help", value="Displays all available commands", inline=False)
embed.set_footer(text="Bot Coded by DarthOCE#8832")
await ctx.send(embed=embed)
client.run(token)``` i have no idea why this is not working
You can't have {} without anything in there
what are they smoking https://github.com/EQUENOS/disnake/blob/master/disnake/client.py#L1126 who does get_user(None)
disnake/client.py line 1126
def get_user(self, id: Optional[int], /) -> Optional[User]:```
Thats discord.Guild.__repr__
i got this code and it does not work at all π€·πΎββοΈ
embed=discord.Embed(title=title.content, description=description.content, color=0x2f3136).set_image(url=image.content)```
lmao meme
can u show full code
@client.command()
async def make_embed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await client.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await client.wait_for('message', check=check)
await ctx.send('Waiting for an Image')
image = await client.wait_for('link', check=check)
embed = discord.Embed(title = title.content, description = desc.content, color = 0x2f3136)
embed.set_image(url = image.content)```
link isnt a valid event
yea
Not knowing typehints drug
It's a hell of a drug
There's a lotta disastrous code in that library
So what could i set it as?
hes just formating it
instead of using fstrings
How to make the bot trigger on every message?
hey
a on_message event
can anyone tell how to make a discord bot not look like a bot
wdym?
what is wdym
what do you mean π€¦ββοΈ
oh
i am saying that i have a bot but it should not look like a bot or get a bot icon
?
you can't remove the bot icon its part of discord
on_message event
is there anything that would sound or look like "if ctx.author.role.position < ctx.member.role.position:"?
if ctx.author.top_role.position < member.top_role.position:
``` i think im not sure
click here
Hi
so its a selfbot
yes
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
WAIT WHAT IS A SELFBOT
Botting your own account aka automating.
Hey guys by any chance can we do a command like +listserver that lists all the servers that the bot is in.
I want that when a user calls a command a private channel is created visible to him and the admin, what can I do?
!d discord.Client.guilds
property guilds: List[discord.guild.Guild]```
The guilds that the connected client is a member of.
so that is illegal
yes
illegal ish it's the ToS of Discord
I want that when a user calls a command a private channel is created visible to him and the admin, what can I do?
create a private channel what only the admin and he can see.
We are not going to help with music bots.
We are still not going to help with music bots
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
np
hi guys, i needed help
I created two commands one to delete channels, and the other to create them, everything works only that they are created and the channels are public, but I want that when the channel is created it is visible only to the person who created it and to the staff, how can I do?
here the code:
@ client.command ()
async def delete (ctx, channel: discord.TextChannel):
mbed = discord.Embed (
title = 'Correct',
description = f'Channel: {channel} has been deleted. '
)
if ctx.author.guild_permissions.manage_channels:
await ctx.send (embed = mbed)
await channel.delete ()
@ client.command ()
async def crearf (ctx, channelName):
guild = ctx.guild
mbed = discord.Embed (
title = 'Correct',
description = "{} has been created.". format (channelName),
)
if ctx.author.guild_permissions.manage_channels:
await guild.create_text_channel (name = '{}'. format (channelName))
await ctx.send (embed = mbed)```
also indent error
lmao imagine
set the guild's default role's permissions in that channel
!d discord.TextChannel.set_permissions
await set_permissions(target, *, overwrite=see - below, reason=None, **permissions)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sets the channel specific permission overwrites for a target in the channel.
The `target` parameter should either be a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that belongs to guild.
The `overwrite` parameter, if given, must either be `None` or [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite"). For convenience, you can pass in keyword arguments denoting [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") attributes. If this is done, then you cannot mix the keyword arguments with the `overwrite` parameter.
If the `overwrite` parameter is `None`, then the permission overwrites are deleted.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this...
the target's gonna be the yourGuildInstance.default_role
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
hm so i am trying to make an anti-nuke can anyone help me with the audit log part
anti-nuke?
How to play audio in voice channel
protects your server from nukers
how does that work
when someone not whitelisted bans a member it bans them
there's no event named help
as color put in 0x003df2 no string
OMG PANDA, you prolly don't remember me hu
@commands.Cog.listener()
I don't sorry π
I help a lot of people so i usually don't rember names that fast 
hmm
!d discord.ext.commands.Bot.help_command
The help command implementation to use. This can be dynamically set at runtime. To remove the help command pass None. For more information on implementing a help command, see Help Commands.
this lol
does it work as listener?
The help?
Net verteld wat je moet doen -> #discord-bots message
@bot.event
async def help(ctx):```
oh lol tbh i was more focused on the color code lmao
dw i fear them too
why is the language just English, German and French mixed
Anyways you need @bot.command() not @command.Cog.listener()
literally tho
more English though and they usually don't like to be compared to german ppl
source = await discord.FFmpegOpusAudio.from_probe("audio.mp3")
vc.play(source)
Bot not play audio why
@slate swan no
he's using a local file as u see
tts bot @slate swan
Best to not use opus imo
I recommend ffmpeg.
?
Then it's client instead of bot although that is bad naming.
Any one can help
myString = 123
myInt = "Hello World!"
Could i see the client variable and the error?
ctx.voice_client.play(discord.FFmpegPCMAudio(source=f"temp.mp3"), after=leave)

@slate swan i try this
Do @client.command()
How to make an exception in @has_permissions
For example, I have made a bot which only listens to those who have admin perms....I want the bot to make a special exception for the owner(me) even though I dont have admin role
Name the function something other than help
Yeah if you are making a help command i suggest subclassing it.
even tho that's not how you make a help command
Put in py client=commands.Bot(help_command=None)
put
bot = commands.Bot(help_command=None)
Can I get any help??
:)
use @slate swan_any_roles
oh shoot
Lel
How to slove
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.
install ffmpeg
@slate swan what
I dont have any specific role
and then make your 3 hours journey on how to make it work
i got this code and it does not work at all π€·πΎββοΈ
@client.command()
async def make_embed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await client.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await client.wait_for('message', check=check)
await ctx.send('Waiting for an Image')
image = await client.wait_for('link', check=check)
embed = discord.Embed(title = title.content, description = desc.content, color = 0x2f3136)
embed.set_image(url = image.content)```
then make a custom check ig?
ffmpeg?
Yes
@bot.command()
async def kick(ctx ,member : discord.Member ,*, reason= None):
await member.kick(reason=reason)
i have problem in this code
this error
pip install ffmpeg @slate swan
or that
?
but ffmpeg is gonna have problems indeed
Ignoring exception in command kick:
Traceback (most recent call last):
File "C:\Users\Mohamed_Zeton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 467, in _actual_conversion
return converter(argument)
TypeError: 'module' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Mohamed_Zeton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Mohamed_Zeton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 855, in invoke
await self.prepare(ctx)
File "C:\Users\Mohamed_Zeton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 789, in prepare
await self._parse_arguments(ctx)
File
File "C:\Users\Mohamed_Zeton\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 476, in _actual_conversion
raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc
discord.ext.commands.errors.BadArgument: Converting to "discord.member" failed for parameter "member".```
put it on path, install simpleaudio if not for discord, etc....
you used your command wrong
What is the poblam
@half briar
how ?
what did you type
i did !kick @ the person i want to kick
hmm
@slate swan any other mudule in play discord voice
π«
discord.py is really like that
it is discord.Member not discord.member
You could make a custom check ```py
def cust_has_permissions(**perms: bool) -> Callable[[T], T]:
invalid = set(perms) - set(discord.Permissions.VALID_FLAGS)
if invalid:
raise TypeError(f"Invalid permission(s): {', '.join(invalid)}")
def predicate(ctx: Context) -> bool:
ch = ctx.channel
permissions = ch.permissions_for(ctx.author) # type: ignore
missing = [perm for perm, value in perms.items() if getattr(permissions, perm) != value]
if not missing or ctx.author.id in ([ctx.bot.owner_id] or ctx.bot.owner_ids):
return True
raise MissingPermissions(missing)
return check(predicate)
he wrote it in the code correctly
even when i change it wont work
no idea how it wont work weird
I think I should make something using the resources I already know
But does it work :D
The bot work but IDK about your code,
Auction Ends: 2021-09-29 15:35:21.472236 how do i avoid microseconds?
futuredate = datetime.datetime.utcnow() + datetime.timedelta(seconds=timewait)
How can i fetch a message within a task?
!d datetime.date.strftime
date.strftime(format)```
Return a string representing the date, controlled by an explicit format string. Format codes referring to hours, minutes or seconds will see 0 values. For a complete list of formatting directives, see [strftime() and strptime() Behavior](https://docs.python.org/3.10/library/datetime.html#strftime-strptime-behavior).
Or how can i pass ctx as an agruement in a task
!d discord.ext.tasks.Loop.start
start(*args, **kwargs)```
Starts the internal task in the event loop.
Ok but if im starting the task within the class how then can i pass it?
for example
What do you need to pass?
ctx
ctx is like all the info
to do ctx.fetch_message
Get the channel where to message is in
!d discord.TextChannel.fetch_message
await fetch_message(id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
await fetch_message(id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
ok thank you :)
β¦.
hours prob π
wired
?
the error is wired
it is not
so what i did worng?
Send the code
I recommend learning a bit more python before making a bot
you can't tell me?
something starts with iβ¦..
lmfao ^
!indention
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
Use a vpn
ok π
@client.command()
async def make_embed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await client.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await client.wait_for('message', check=check)
await ctx.send('Waiting for an Image')
image = await client.wait_for('link', check=check)
embed = discord.Embed(title = title.content, description = desc.content, color = 0x2f3136)
embed.set_image(url = image.content)```
link is not an valid event.
i use a code server tho will it work?
What can replace it?
maybe wait for a link
@cloud dawn all i have to do is just 2 spaces
that was simple wasn't it..? why did u ask for help lol?
because i didn't know it\
Replace link with url and try
can adding an eval command to our bot be dangerous?
because i saw many people doing weird things with that command
if not made properly yes very dangerous.
if you have it like @unkempt canyon's eval, it's fine
Yeah because we can access to my bot computer?
I mean if you only let select people have it. 
either make it owner only, or make it like @unkempt canyon
In fact you can get the SWAT Team at your door if you don't do it correctly, so that should answer your question 
lol really?
Yeah it can get that bad, so be careful
oh for instance someone download something illegal in your computer using this command?
Main point is it is just dangerous and should not be done.
oh yeah i see...
By that I mean not done openly
Make it @commands.is_owner() a check for the bot owner
yeah
What are you stuck on
Show the code where are you stuck on
One question, how have they done this in the last announcement message about python's v3.10 ?
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
Has anyone done a Auction system ? I would like to know how it works, please
my eval blocks certain imports completely
yeah, the thing is I wanted to add a command for my bot to make events in the server
im pretty sure its a partnered server thing
seems
yep
It's got verified and partnered servers ig
For*
it compares the roles ig , and the user may have role hierarchy above than yours
Send the code
the user has no perms
and the bot has perms
could you show the code?
@bot.command()
@commands.has_permissions(ban_members=True)
async def ban(ctx, member : discord.Member, *, reason=None):
emb=discord.Embed(title = "member kicked!", description = f'I have banned {member.name} from the server! Reason: {reason}, color 0xff0303')
emb.add_field(name="responsible moderator", value=f'{ctx.author.mention}', inline = False)
emb.set_thumbnail(url=f'{ctx.member.avatar_url}')
emb2=discord.Embed(title=f"You have been banned from {ctx.guild.name}", color=0xff0303)
emb2.add_field(name="Responsible Moderator:", value=f'{ctx.author.name}', inline=False)
emb2.add_field(name="Reason:", value=f'{reason}', inline=False)
await member.send(embed=emb2)
await member.ban(reason=reason)
await ctx.send(embed=emb)
@ban.error
async def ban_error(ctx: commands.Context,error: commands.CommandError):
if isinstance(error, commands.MissingPermissions):
message = "you are missing the `ban members` permission to run this command"
await ctx.send(message)
elif isinstance(error, commands.MissingRequiredArgument):
message = "ping someone to ban them!"
await ctx.send(message)
elif(error, ArgumentParsingError):
message = "You can't ban your self or anyone that is the same role as you or higher!"
await ctx.send(message)
how do i make the bot edit a message?
first import asyncio
Guys, why am i getting an indentation error in this?
@client.command()
async def lyrics(ctx, name):
url = requests.get("https://some-random-api.ml/lyrics?title=" + name)
if 300 > url.status_code >= 200:
content = url.json()
lyrics = content["lyrics"]
link = (content["links"]["genius"])
embed = discord.Embed(title=name.title(), description=lyrics, color=ctx.message.author.color)
embed.set_footer(text=link)
await ctx.send(content=None, embed=embed)
else:
await ctx.send("Lyrics Not Found")
ok
@bot.command()
async def edittest(ctx):
message = await ctx.send(f'{ctx.author.name} is cool')
await asyncio.sleep(1)
await message.edit(content=f'nah just kidding, {ctx.author.name} is an dumbass XD')
in the embed= line
!d discord.Message.edit
await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the message.
The content must be able to be transformed into a string via `str(content)`.
Changed in version 1.3: The `suppress` keyword-only parameter was added.
anybody?
@slate swan
need some help with my bot as it isn't recognising any .json files :/
Your indentation is weird, this is the normal indentation:
@client.command()
async def lyrics(ctx, name):
url = requests.get("https://some-random-api.ml/lyrics?title=" + name)
if 300 > url.status_code >= 200:
content = url.json()
lyrics = content["lyrics"]
link = (content["links"]["genius"])
embed = discord.Embed(title=name.title(), description=lyrics, color=ctx.message.author.color)
embed.set_footer(text=link)
await ctx.send(content=None, embed=embed)
else:
await ctx.send("Lyrics Not Found")```
how to see if message.content have @ everyone or @ here
same error
bruhh can someone helpppp
if smth in message.content
wht is smth?
The guy u tried to ban was having same role like u that's what I ig
where did i do it wrong?
ArgumentParsingError is not the instance for missing perms
he didn't, it is my alt, and i tried to ban
ohh, thanku
i alr have something for missing perms though
smth means @ everyone or @ here ?
what is parsing error supposed to do
Oh
if you are trying to send the link from tenor , it will always be invalid
Ohh
@slate swan what do i do then ??
yeah
giphy works fine
!d discord.ext.commands.ArgumentParsingError read this what it is meant for
exception discord.ext.commands.ArgumentParsingError(message=None, *args)```
An exception raised when the parser fails to parse a userβs input.
This inherits from [`UserInputError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.UserInputError "discord.ext.commands.UserInputError").
There are child classes that implement more granular parsing errors for i18n purposes.
smth is something, as i meant it is any string you want to check in message content
it can be everyone, here or bad words, anything
how can i check they r in msg.content or not?
if smth in message.content
oo i can use if @ everyone in msg.content?
already said...
if '@everyone' in message.content if you want
but i alr have something for missing permissions. The parsing error is there for if they try to ban them selves or people with the same/higher role than them
@boreal osprey Check if your bot's top role is above user's and does bot have admin / ban users perms
still does not work
how to check if message.author is an admin?
!d discord.Member.guild_permissions
property guild_permissions: discord.permissions.Permissions```
Returns the memberβs guild permissions.
This only takes into consideration the guild permissions and not most of the implied permissions or any of the channel permission overwrites. For 100% accurate permission calculation, please use [`abc.GuildChannel.permissions_for()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.permissions_for "discord.abc.GuildChannel.permissions_for").
This does take into consideration guild ownership and the administrator implication.
please read the documentation and learn python first
i learnt python
ok, then read docs, there is almost all information you need
ok
!d discord.Embed
#bot-commands, thank you
srry
You can use this anywhere as long as it's on-topic.
Hey, I am looking for someone to make a youtube channel with about discord.py tutorials and on how to make bots. If you are interested dm me, (I know how to edit and design and how discord.py works π )
this is help channel*
or i am noob, if yes sorry

If you scroll up you may see people replying to questions using the !docs command. It's pretty useful.
Yeah It's fine
someone can help me ?
what is the code to check if the message.author have perms to mention @ everyone @ here in if condition
I used it... But he used it to search in docs
!d discord.Permissions.mention_everyone
Returns True if a userβs @everyone or @here will mention everyone in the text channel.
xd
It's a permission mention_everyone
yes
@ here is also same in that ?
Same
yes
read
yes
also those emojis which are not in that server ?
the bot can use any emojis from any server its in
yeah
but how i tried it send None :/
code?
you're using get_emoji?
i tried bot.get_emoji()
make sure you're passing in the correct id
it's not cached ig
