#discord-bots
1 messages · Page 550 of 1
How can I check if a argument is a mention or not?
for example !info @slate swan
in what way do you wish to use this? I might be able to give a proper tip using that
@commands.command()
async def info(self, ctx, arg: str = None):
I wan't to check if arg is a mention or not, if it is a mention i want it to print something about the mentioned user
im trying to make it so my bot will DM me when someone DMs the bot, telling me what they said and who said it. I've tried this but all this does is spam "Hi (:" in the person's DM with the bot, how do i fix this?
make arg not typehint to str, but typehint to discord.User
that way it raises badargument when it couldn't convert the given argument
Hello, is it somehow possible to log commands that got ran my users? i have made this a long time ago Log(ctx.message.author, 'paymenthistory') but seems like the Log function not exist anymore and i cant get it back....
okay, but how can i check in a if statement if arg is a mention or not?
someone?
@bot.command()
async def foo(ctx, user: discord.User):
# user is a discord.User here, and it automatically checks if it's valid
whats that?
you'll have to get the ctx.content and run it through a check if it matches the syntax for a mention, but if you use the converters thing i suggested, it will automatically convert any mentions automatically, and if not possible due to wrong input will automatically raise errors
but the thing is if its not a mention its supposed to send info about the author, and if its a mention it will send info about the mentioned user
set it to typing.Optional, and a default value of None, then when it's None set user = ctx.author
async def foo(ctx, user: typing.Optional[discord.User]=None):
if not user:
user = ctx.author
this code will check for ANY message in a DM channel, by ANY user, including the bot itself, and it will send "Hi :)" to the channel it was sent in, and send the message to your DM too. Keep in mind how i said the messages include the bot. It is self feeding
it's triggering itself
you are sending a message, and this triggers on_message again
ok, so how do i fix it?
but typing isn't a thing?
use INSERT INTO to make a new row
make it check the author of the message, and if it's the bot itself ignore it
also i reccomend you to follow PEP 8 naming conventions
ive never done that
you named your bot Bot with capital B, which is not conventional and can cause errors or confusion
you've already checked if it's a DM channel, just add another check to see if the author is the bot itself
ok
well you said you wanted to add a new warning row right? so INSERT INTO will add a new row for a new warning
if message.author == [what goes here?]
if message.author.bot is the easiest. This returns true if the author is a bot, this does make it ignore ANY bot, not only itself
ok
otherwise it's if message.author == bot.user
that will make it only work on the bot itself, and all other bots are still allowed
i should probably just use
if not message.author.Bot
oh in that way, i would personally say that isn't a good system, but if it is what you wish, look up arrays and concatenation of arrays for your database, since each database has their own way
@valid nicheHey I tried this:
async def info(self, ctx, arg: typing.Optional[discord.User] = None):
if arg:
print(arg.id)
if not arg:
print(ctx.author.id)
if arg == "server":
print(ctx.guild.id)
But it wont work when I do "-info server"
i tried that and i got this error:
Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 28, in on_message
if not message.author.Bot:
AttributeError: 'User' object has no attribute 'Bot'
/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py:350: RuntimeWarning: coroutine 'Client.fetch_user' was never awaited
pass
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
because it's trying to convert to a user, and "server" is not a valid user, in this case you would need to use a typing.Union inside the typing.Optional to allow for different types of input
you forgot to await fetch_user
also it's author.bot with lowercase b
it is probably easier too
ooohhh... im so dumb, how did i not see that
and it's more organised, since you'll be utilizing the relational part of databases/SQL more
yes, I can send you the logs (although they are extremly long)
i'd say look in them yourself. discord.py will automatically log when the bot disconnects and attempts a reconnect
ok
thx so much that works
if you can find those lines, it means that discord is just disconnecting you, or your internet connection to discord isn't stable
time to do some [CTRL]+[F]
@valid nicheScrew this it wont work, how can I get information on something by ID?
you will need to look for INFO level and you will either find
_log.info('Timed out receiving packet. Attempting a reconnect.')
or
_log.info('Websocket closed with %s, attempting a reconnect.', code)
as in...?
-info 234649992357347328
the typehint will automatically parse IDs too
and it will return your name, your pfp, when ur account was created etc
but it wont work for the server
ok
so discord.User typehint accepts IDs too
async def info(self, ctx, arg: typing.Optional[typing.Union[discord.User, str]] = None):
if not arg:
arg = ctx.author
that way "server" will work
as long as there is no member named server that is
there u just do 1 line of a if statement to check if the user has mentioned someone
can't you do that in python?
regex
regex?
regular expression, pattern matching in strings, works in almost every programming language out there
so how would i use regex in this case?
for a mention it would be match = re.search(r"<@!?\d+>", arg) assuming arg is a string
that should be the regex for a discord mention, but keep in mind that this does not check if this is a VALID mention
so if i type @slow dawn it's an invalid mention, the user doesn't exist, but this regex will match it
primary key means it automatically is UNIQUE, which means it can only exist ONCE in the database table
primary key is a thing in databases to indicate an always unique value, often an ID, which can be used to address this particular row and you know for certain there won't be conflict
yes, this means you can only have each user once and each guild once in your database
for instance this is my warnings table for my bot
as you can see, i have an auto-increasing warn id that is the primary key
a lot of databases can do without a primary key
it's recommended to always have one, so you can find the row later on
for instance when i do any communication with my database about a warning, i always talk using the primary key, the warnid
this means i never have to dig through data and always get what i want
which makes writing it in code also a lot easier, if i want to review a case later on i can just call a command with the ID, and the bot looks it up in the database right away, and i always get the warn i want
postgres datatypes
it's how large the value can be
why not just use something like ```py
async def info(self, ctx, *, arg: str):
try:
user = await commands.MemberConverter().convert(ctx, arg)
except commands.BadArgument:
if arg.lower() == 'server':
# do server info stuff
return
else:
#output error message
return
do user info stuff
return
you could manually attempt to invoke the converter
postgres has 3 integer types. Smallint, a signed 2 byte integer, integer, a signed 4 byte integer, and bigint, a signed 8 byte integer
and if you wanted to condense it you could do so even further @slate swan
async def info(self, ctx, *, arg: str):
if arg.lower() == 'server':
query = ctx.guild
else:
try:
query = await commands.MemberConverter().convert(ctx, arg)
except commands.BadArgument:
query = False
# do something with query object, or if false, output error message
@slate swan both of which are acceptable ways to handle your issue ^
in this case i wouldn't try: except it but let it raise badargument, unless the user wants to handle the error in a non-standard way
you passed all situations already so you know the argument isn't correct
the only reason i included the error handling in the example function is because not doing so requires that i assume he has an error handler already constructed to handle the BadArgument exception.
In the case that such a handler exists, it would likely silence any output about an incorrect input and it might need only to have BadArgument added to its exception pool.
author1 = ctx.author
guild = client.get_guild(888136367937294356)
role = guild.get_role(888716964141367326)
await author1.add_roles(role)
sleep(.5)
role1 = guild.get_role(899739409707044875)
await ctx.author.remove_roles(role1)
how can i get guild id in messages?
@commands.command()
async def serverinfo(self, ctx):
embed = discord.Embed(title="Guild Information")
embed.add_field(name="Guild Owner", value=f"{ctx.Guild.owner}")
await ctx.send(embed)```
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "serverinfo" is not found
client.command
and remove self
yeh
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'Guild'
@bot.command()
async def serverinfo(ctx):
embed = discord.Embed(title="Guild Information")
embed.add_field(name="Guild Owner", value=f"{ctx.Guild.owner}")
await ctx.send(embed)```
lowercase "g"
@bot.command()
async def serverinfo(ctx):
guild = ctx.guild
embed = discord.Embed(title="Guild Information")
embed.add_field(name="Guild Owner", value=f"{guild.owner}")
await ctx.send(embed)
try that
okk
@placid escarp it works but the bot sends this <discord.embeds.Embed object at 0x7f2f51465040>
description=f"{guild.owner}
and await ctx.send(embed=embed)
@bot.command()
async def serverinfo(ctx):
guild = ctx.guild
embed = discord.Embed(title="Guild Information", description=f"{guild.owner}")
await ctx.send(embed=embed)
(watch how to get started)
thanks!!!
@commands.command()
@commands.has_role("Admin")
async def add(self, ctx, member:None, role:discord.role):
if role not in discord.guild.roles:
pass
else:
if member is None:
task_embed = discord.Embed(title=":white_check_mark: Success!", description=f"Successfully added {role.name} to {ctx.author}", timestamp=ctx.message.created_at)
await ctx.author.add_roles(role)
await ctx.send(embed=task_embed)
document = {"name": f"{ctx.author}", "role":f"{role.name}"}
data = collection.insert_one(document)
print(collection.find_one(data.inserted_id))
else:
task_embed = discord.Embed(title=":white_check_mark: Success!", description=f"Successfully added {role.name} to {member}", timestamp=ctx.message.created_at)
await member.add_roles(role)
await ctx.send(embed=task_embed)
document = {"name": f"{ctx.author}", "role": f"{role.name}"}
data = collection.insert_one(document)
print(collection.find_one(data.inserted_id))
Any help?
raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc
discord.ext.commands.errors.BadArgument: Converting to "NoneType" failed for parameter "member".
plz anyone?
so I'm trying to make a bump bot and for some reason this bit is broken:
@bot.command()
@commands.has_permissions(manage_guild=True)
async def setinvite(ctx,*,desc):
file = open("data/invites.txt","r")
current = ast.literal_eval(file.read())
file.close()
try:
await ctx.send(f"Getting information for {desc} .")
invite = await bot.get_invite(desc)
except:
await ctx.send("The invite is invalid.")
try:
if invite.guild == ctx.guild:
current[str(ctx.guild.id)] = desc
await ctx.send("Invite Set!")
file = open("data/invites.txt","w")
file.write(str(current))
file.close()
else:
await ctx.send("The listed invite is not for your server.")
except:
await ctx.send("The invite is invalid.")```
any help would be good
broken in what way?
It just returns all the invite is valid massages
well then remove the try excepts to see the actual error, then fix it
uuid?
or message link, warn_message_link
print data with indexed and just data
ur fetching one
wait
how do you store the warnings
do you make a new column? or just update the original
ye
About how to fetch multiple rows
thats why, but why do you make a new column
Searching on your own is also something you might want to consider sometimes
Just make fixed columns and add rows, you shouldn't edit columns
Don't create new columns
Create new rows with your existing columns
i mean rows
Google is your friend
^
("INSERT INTO something(numbers) (?),1")
icon_url=f"{guild.icon} is this correct?
_url
okkk
and no need for fstring
.url
Whatever
!d discord.Guild.icon
property icon: Optional[discord.asset.Asset]```
Returns the guild’s icon asset, if available.
it changed in 2.0
Yeay that's 2.0
how i do install it on replt?
I don't get it why this bot uses 2.0 documentation when it's in beta and not officially recommended to be used 🤡
xddd
but in the version i have how it would be?
icon_url
Because discordpy is archived, lol
embed.set_author(name="Guild info!", icon_url=f"{guild.icon}")
They will reinstall the modules of their choice by the time you leave it for a while
it’s stable enough to be used

but i have it no?
guild.icon_url
that will work for you if you are using dpy from pypi
it works but it doesnt send any photo
Cuz u are using string
the f?
Just do icon_url = guild.icon_url
works but there is no photo again
@bot.command()
async def serverinfo(ctx):
guild = ctx.guild
embed = discord.Embed(title="Guild Information", colour=0x87CEEB)
embed.set_author(name="Guild info!", icon_url = guild.icon_url)
embed.add_field(name="Server Owner", value=f"{guild.owner}", inline=True)
embed.add_field(name="Server ID", value=f"{guild.id}", inline=True)
await ctx.send(embed=embed)
```this is the whole code
Show code
it gets casted to a str
Oh right the f string does cast it to str
dont understand
and dpy casts everything to a str for convenience
I don't think so in this case
You need to manually cast or use the f string
works for me
Woops wrong docs
i mean worked
No you don't
When i used dpy 1.7
@bot.command()
async def serverinfo(ctx):
guild = ctx.guild
embed = discord.Embed(title="Guild Information", colour=0x87CEEB)
embed.set_author(name="Guild info!", icon_url = guild.icon_url)
embed.add_field(name="Server Owner", value=f"{guild.owner}", inline=True)
embed.add_field(name="Server ID", value=f"{guild.id}", inline=True)
await ctx.send(embed=embed)
hele i wanted to ask something about a error
so how it would be?
it does
I used it on a bot I've made today without casting it to a string and works perfectly fine
how do i fix module 'collections' has no attribute 'MutableMapping'
Why does dpy do that lol
self._author = {
'name': str(name),
}
if url is not EmptyEmbed:
self._author['url'] = str(url)
if icon_url is not EmptyEmbed:
self._author['icon_url'] = str(icon_url)
return self
!d collections.abc.MutableMapping
class collections.abc.Mapping``````py
class collections.abc.MutableMapping```
ABCs for read-only and mutable [mappings](https://docs.python.org/3/glossary.html#term-mapping).
is that what you want?
Actually show the uh 1.7.x GitHub version
It might be diff for master
@bot.command()
async def serverinfo(ctx):
guild = ctx.guild
embed = discord.Embed(title="Guild Information", colour=0x87CEEB)
embed.set_author(name="Guild info!", icon_url = guild.icon_url)
embed.add_field(name="Server Owner", value=f"{guild.owner}", inline=True)
embed.add_field(name="Server ID", value=f"{guild.id}", inline=True)
await ctx.send(embed=embed)```
it should be the same
what i need to change in the line embed.set_author
yep its the same in v1.5.x branch
what¿
not talking to you
ohç
how it would be?
Alr
could it be your discord client is not rendering it?
Can you print out guild.icon_url
Does the guild you are running it in even have an icon?
oh true XD
kek
in 2.0 it raises an error if a guild doesn’t have icon
it doesn’t, it just returns None in Guild.icon
i guess it does, cuz i had to remove that when rewriting my bot to 2.0, let me check tho
how to create a command that when you do this command the bot could dm the members with this certain role (I attempted to make it but it doens't work)
and your attempt is.....
abd?
On mobile
uh i delated 
Don't mind me
do iteration through the role members and send them dm
!d discord.Role.members
property members: List[Member]```
Returns all the members with this role.
!d discord.Role.members
property members: List[Member]```
Returns all the members with this role.
huh
iteration?
guys, i made music system, but bot showed this mistake
Exception ignored in: <function AudioSource.__del__ at 0x0000022E6EEFCA60>
Traceback (most recent call last):
File "C:\Users\Pakhoms\PycharmProjects\project\venv\lib\site-packages\discord\player.py", line 115, in __del__
self.cleanup()
File "C:\Users\Pakhoms\PycharmProjects\project\venv\lib\site-packages\discord\player.py", line 211, in cleanup
self._kill_process()
File "C:\Users\Pakhoms\PycharmProjects\project\venv\lib\site-packages\discord\player.py", line 176, in _kill_process
proc = self._process
AttributeError: 'FFmpegPCMAudio' object has no attribute '_process'
Looping
all of this coding thingy makes me confused 
apparently, i was talking about the error that is raised when you use guild.icon in embed's author/footer icon_url and the guild has no icon
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Good place to start to learn Python
Btw, can anyone explain me a weird behaviour of my bot?
Maybe
So my bot was kicked from this guild on Oct 20, but after that i got 3 more guild leaving log with the same id
The last log is just a few min ago
was the server deleted or something
Assuming It was deleted, why would it still trigger the on_guild_leave event
if the guild was deleted it also count as a leave
I know
anyone know how to make an afk command?
I asked why would it still trigger after getting kicked before/ the server got deleted
spoonfeeding is google's work 
than you
async def mute(ctx, user : discord.Member, duration = 0,*,unit = None):``` How can I make this work like .mute @hollow agate 10s?
What should I place instead of return?
After if, i cant do anything with "Interaction failed."
member without role first clicks select > respond works
but after member click, user with role cant do anything with "Interaction failed" error
im getting really pissed at my bot. i have this code:
@Bot.event
async def on_message(message):
my_user_id = 853991571702939668
user = await Bot.fetch_user(my_user_id)
if type(message.channel) == discord.channel.DMChannel:
if not message.author.bot:
await message.channel.send("Hi :)")
await user.send(f"{message.author.name}#{message.author.discriminator} messaged your bot: `{message.content}`")
return
@Bot.command()
async def setup(ctx):
embed=discord.Embed(color=0x44f3ff)
embed.set_author(name='Rules:', icon_url="https://media.discordapp.net/attachments/900734911718252588/900791372238450689/GDSecretCoin.png")
embed.add_field(name="**Rule #1**", value="No NSFW, spam, text walls, trolling, etc.", inline=False)
embed.add_field(name="**Rule #2**", value="Respect all of our members and listen to our staff.", inline=False)
embed.add_field(name="**Rule #3**", value="Use each channel according to it's intended purpose.", inline=False)
embed.add_field(name="** **", value="** **", inline=False)
embed.set_footer(text="Questions? DM me for more info.")
await ctx.send(embed=embed)
and the modmail thing works just fine but as long as its in the code the setup command doesnt work. if i take it out, it works fine, how do i fix this?
Guys i need to check if a string contains comma and spaces after every words, how i can do it?
Example of correct input:
ab, cd, ef g, hi jk
is this for me?
Trying to remove the strings in the list from display names. When I'm running the code the bot removes it and add it back constantly (bug?)
@bot.event
async def on_member_update(before, after):
roleArray = ["(om)", "(s)", "(h)"]
for role in roleArray:
nick = after.display_name.replace(role, "")
await after.edit(nick=nick)
Your on_message event is "eating" your command, use @bot.listiner instead of @bot.event
ok
Database query returns a list of tuple, you have to iterate through them
Someone?
iterate through the list using a for loop
anyone know how to add buttons in cog?
@client.command()
async def mute(ctx, member: discord.Member,time):
muted = discord.utils.get(ctx.guild.roles, name="Muted")
if member is None:
a = await ctx.reply("You can't mute air!")
await a.delete()
await ctx.message.delete()
if time is None:
await ctx.reply('Muted')
else:
try:
time_list = re.split('(\d+)',time)
if time_list[2] == "s":
time_in_s = int(time_list[1])
if time_list[2] == "m":
time_in_s = int(time_list[1]) * 60
if time_list[2] == "h":
time_in_s = int(time_list[1]) * 60 * 60
if time_list[2] == "d":
time_in_s = int(time_list[1]) * 60 * 60 * 60
timestamp = DT.datetime.now().timestamp()
await ctx.reply(f'Timestamp Now: {timestamp} \n \nMuted for {time_in_s} seconds!')
except:
time_in_s = 0
await ctx.reply(f'{time_in_s} seconds!')``` Is my current code... how can I change the `time_in_s` to a timestamp so I can add it together and store when the member gets unmuted?
How can i set my bot's about page?
In discord developer portal
I noticed some bots can do this recently, i never knew it was possible
hmm ok
Ohhhh
I see now, thank you. This never used to be here before so that's cool to know.
I thought u meant like the documentation lmao
xD
So, I have seconds. How could I add those seconds to a time so that I can store when a mute expires in a database?
#bot-commands ||ignore||
!d datetime
Source code: Lib/datetime.py
The datetime module supplies classes for manipulating dates and times.
While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation.
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.giveaway' raised an error: NameError: name 'self' is not defined```
how do I define self?
That error is because somewhere in one of your methods (maybe static or classmethod) or possibly outside of your class, you referenced self where it would not be defined
it could also mean one of your functions is missing the self argument parameter
without seeing your code it is incredibly difficult to assist you
ok, and is there a specific way to define self if that is the problem?
i have no idea because i do not know where the error occurs
if you show me your code i can further assist you
specifically i would need to reference the giveaway extension 🙂
@client.command()
@commands.guild_only()
async def serverinfo(ctx):
embed = discord.Embed(
color = ctx.guild.owner.top_role.color
)
text_channels = len(ctx.guild.text_channels)
voice_channels = len(ctx.guild.voice_channels)
categories = len(ctx.guild.categories)
channels = text_channels + voice_channels
embed.set_thumbnail(url = str(ctx.guild.icon_url))
embed.add_field(name = f"**{ctx.guild.name}**: ", value = f" ID: **{ctx.guild.id}** \n Owner: **{ctx.guild.owner}** \n Location: **{ctx.guild.region}** \n Creation: **{ctx.guild.created_at.strftime(format)}** \n Members: **{ctx.guild.member_count}** \n Channels: **{channels}** Channels; **{text_channels}** Text, **{voice_channels}** Voice, **{categories}** Categories \n Verification: **{str(ctx.guild.verification_level).upper()}**
await ctx.send(embed=embed)```
getting this error
How can I verify if peepol only spoke to the bot ONLY in dms?
Check the channel
If its DMchannel then it's in dms
What
Is there a link for the documentation of this dm channel?
Or a vid perhaps
Or just tell me how it works
anyone have any suggestions for a fork that supports slash commands, rn i'm using disnake and the docs aren't clear enough for me
Hello, I have this but it's giving me an error
import disnake
from gtts import gTTS
import playsound
import os
client=disnake.Client(intents=disnake.Intents.all())
voice_client=disnake.VoiceClient(client=client,channel=client.get_channel(889583102194765827))
@client.event
async def on_ready():
print('Hey, I am ready')
@client.event
async def on_voice_state_update(member, before, after):
if not before.channel:
channel_joining_string=f"{member.name} joined {after.channel.name}"
tts=gTTS(text=channel_joining_string, lang='en')
filename='voice.mp3'
tts.save(filename)
await voice_client.play(filename)
```
here is the error:``` raise ClientException('Not connected to voice.')
disnake.errors.ClientException: Not connected to voice.```
Does it need to be at info level or can it be at debug?
Cause I haven't found anythin yet
Check what type of a channel it is
If it is discord.channel.DMchannel, then they spoke in dms
You have to connect to a voice channel first.
Use dislash with discord.py until docs for disnake comes
pycord
Can you send the docs link for that
NextCord
I’m pretty sure all the forks are the same anyways
kinda true
just a few different changes
Ye
Disable is very easy to migrate
I use nextcord because py-cord's dev version was so hard to migrate to
Disnake*
Agreed
i've got no clue what i'm doing, trying to add a role to a user by ids. Documentation is helping very little as I am extremely blind.
I tried it first too, that didn’t work
ok, hold up
async def verify(ctx, uid: discord.Member, key):
do that first
aah. thanks. lemme test that...
then change await client.add_roles to await uid.add_roles(id)
i mighta done something extremely stupid... it did the same as before...
current code
no errors, no roles were added.
I am doing an 8ball command and I have the random responses and everything but I am trying to make it so that if somebody asks a specific question, it only replies with one answer. How can I do that?
Id is supposed to be an int
yep. as i thought. something extremely dumb of me.
thanks!
did nothing. do i have the wrong id? (string was the role id...)
And you should not use json to store things
Paste ur whole code here
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
usually it's something like
role = ctx.guild.get_role(810264985258164255)
await user.add_roles(role)
Ye
Idk what he's doing
idk what im doing either tbh.
I mean, I just pasted something you could try
might see what it does ig.
anywhere I've ever added roles I use the actual role object
Why do you have a random bot.command
idk. lemme check.
how can i make it so a command removes a role of the person who used it?
?
!d discord.Member.remove_role
Wtf
!d discord.Member.remove_roles
await remove_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Removes [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s from this member.
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, and the removed [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
i cant get it to work
@commands.has_role('eligible')
async def name(ctx):
await remove_roles('eligible', reason = None, atomic = True)```
this code?
whats wrong?
ctx.author.remove_roles for one thing
you need to call it through a member instance
and provide a Role to remove, not a string
how do i provide a role?
ah yeah author, my bad
!d discord.Guild.get_role
get_role(role_id, /)```
Returns a role with the given ID.
@commands.has_role('eligible')
async def name(ctx):
await ctx.author.remove_roles(get_role(900771730233098240, /), reason = None, atomic = True)```
?
ctx.guild.get_role
invalid syntax
@commands.has_role('eligible')
async def name(ctx):
await ctx.author.remove_roles(ctx.guild.get_role(900771730233098240, /), reason = None, atomic = True)```
for cleanliness I would just do role = ctx.guild.get_role(...) on the line above
you have parentheses messed up
@commands.has_role('eligible')
async def name(ctx):
role = ctx.guild.get_role(900771730233098240)
await ctx.author.remove_roles((role, /), reason = None, atomic = True)
like this?
i still have invalid syntax cuz of the slash
remove it
discord.on_member_ban(guild, user)```
Called when user gets banned from a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.bans`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.bans "discord.Intents.bans") to be enabled.
OHHHH
how can i do something like this?
How do you remove a reaction by a user
!d discord.Button
class discord.Button```
Represents a button from the Discord Bot UI Kit.
This inherits from [`Component`](https://discordpy.readthedocs.io/en/master/api.html#discord.Component "discord.Component").
Note
The user constructible and usable type to create a button is [`discord.ui.Button`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.Button "discord.ui.Button") not this one.
New in version 2.0.
check if role is None?
as in if the value of role is none?
or your read() isn't == to the key youre providing
you don't do ctx.guild.get
pretty sure you do bot.get
hm.
no, get_role is a guild function
!d discord.Guild.get_role
get_role(role_id, /)```
Returns a role with the given ID.
add a print statement within your if block
no print would mean its not ==
why?
I'm giving you advice and you're ignoring it lol
i had the print in the if and it didnt do nothing.
so what would that mean?
if role is None:
lol
Would it be with open
I'd assume it would return something if it found the id...
read your code. you added print() and it didnt print. why?
will it always print?
it should print unless the value is null/empty or something.
...paste
Paste not send ss
How do I make sure peepol say someword but in dms?
should i use dpy 2.0?
wym
Be more specific
I can't edit your code if you give me a screenshot
^^
Like in the DMS if u say hi it says hi back to you but in the servers it can't say hello back to you
@commands.dm_only()
i believe
Oh ok
@slate swan
async def verify(ctx, uid: discord.Member, key):
KeyCheck = open('staffkey.txt', 'rt')
file_contents = KeyCheck.read()
if key == file_contents:
print("Key matches file!")
role = ctx.guild.get_role(900587905519599636)
print(role)
await uid.add_roles(role)
else:
print("Key does not match file")
print("Key: ", key)
print("File contents: ", file_contents)
KeyCheck.close()```
what?
oh you mean uid.add_roles
ok, I edited above
its the ID that is given in one of the args...
discord.Member I thought that was ping
async def verify(ctx, uid: discord.Member, key):
KeyCheck = open('staffkey.txt', 'rt')
file_contents = KeyCheck.read()
if key == file_contents:
print("Key matches file!")
role = ctx.guild.get_role(900587905519599636)
print(role)
await uid.add_roles(role)
else:
print("Key does not match file")
print("Key: ", key)
print("File contents: ", file_contents)
KeyCheck.close()
good catch @slate swan
Thanks
its not printing anything...
is discord.py 2.0 available?
odd...
i need a way to use buttons
then the function might not even be calling
ive tried previously working code. the entire bot is broken.
command_prefix='/n '?
Hey guys! can someone set me in the right direction?
How would I go on about making "Instances" of a discord game
like when someone uses ;play and a text game pops up. Only who sent that ;play can control the instance of the ;play, and other people can still make more instances with ;play while someone is playing.
Lmao
bots gonna be named a thing, the prefix is to reflect the bot's name, as theres already bots with prefixes of '/'
/n is new line in python
maybe until you get it working you can try a simple prefix like .
\n is newline
bots worked before...
Or sorry
Effprime correctness if I'm wrong but can your use a /prefix if it's not slash commands
you probably need to map user's ID's to a specific instance of a game class
So something like OwO?
changed it, it just refuses to work.
Idk the OwO bot
show new code
Ok nvm then
Thank you! if you guys have other ideas I dont get mad at pings
@slate swan how are you using the command
used to manually verify a user if the staff trust them.
?
within a server for a game community
I said how, how do you type it in discord
why do you need me to point it out? lol
Jesus
I gotta be honest I didn't see one
you set ur prefix as necron! verify... not necron!verify...
Yea idk what I was thinking there
i changed it last time...
right, he said will try with no space
King does the command work or not
seems he understands how prefixes work so I'm not sure
you didnt check my edited code
async def verify(ctx, uid: discord.Member, key):
KeyCheck = open('staffkey.txt', 'rt')
file_contents = KeyCheck.read()
if key == file_contents:
print("Key matches file!")
role = ctx.guild.get_role(900587905519599636)
print(role)
await uid.add_roles(role)
else:
print("Key does not match file")
print("Key: ", key)
print("File contents: ", file_contents)
KeyCheck.close()```
wait. was i blind?
uid: discord.Member
nice
btw you don't have to provide the ID with how youre doing it
you can also tag the user or put Username#1234
Wdym same id
just wanted to point out the power of converters 😉
How do you remove a user's reaction
It's cuz u indexed it as 0
hm. time to be completely brainded and have to look at documentation again.
!d discord.Member.remove_reaction
Ok
See
!d discord.Message.remove_reaction
await remove_reaction(emoji, member)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Remove a reaction by the member from 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").
If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.
The `member` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.
There
Ok thanks
oh.
faster than me.
Yeah I still don't understand hoe to use that
How
get message, emoji, and the member who reacted, then do message.remove_reaction(emoji, member)
Ok thanks
re = data['mutetime'] - 1
if data["mutetime"] != 0:
await collection.update_many({"same": "pog"},{'$set':{'mutetime': re}}
Ok so this is in a tasks that loops for 1 second it subtracts 1 from a int
It works with the same person only
Only problem is when a different person gets in the database and has a different mute time
It pretty much puts the mute time of the first person
To the other dude and i dont really know how to individually subtract 1 from each of their mute time simultanously
got this error. dunno what to do, gonna paste ss of some stuff in a few secs.
output is the log of a moderation action.
tried await log.send
Show the line under log
That's what it's supposed to be
In fact send the whole code
gave similar error... kinda odd.
I don't want to code my Discord bot to do this but my bot is in a server that I am not Admin on. How do I remove it from that server?
Why
guild.leave() I think
I dont think theres another way besides asking an admin to kick it @median hazel
Because there's better ways
Okay can you tell me the other ways
think you might be able to set a time with datetime
then wait until that time and set things to run.
idk how all that works tho
Idk why it's not working with await log.send
I would make a single loop that checks all muted users and sees if their expire time is up
There's sleep_until, there's asyncio.sleep
Why
Because the bot forgets to unmute the muted person if the bot restarts or crashes
That is my problem that im trying to solve
Thats the whole point of why im using a database and a task loop
tasks and aysncio.sleep are the same thing
it's up to you how "low level" you wanna be
yes they are
What
tasks do something every set amount of time
Ye and then repeat it
putting sleep in a loop is the same thing
I just need to fix the problem of how to subtract 1 from all of the mute time
@client.slash_command(name="gban", guild_ids=[794596546830008330])
async def gbanslash(ctx, user: disnake.User):
if ctx.author.id in authors:
for guild in client.guilds:
if guild.id in guilds:
try:
await guild.ban(user)
await ctx.response.send_message(content='Sucessfully banned **' + str(user) + '** from the server called **' + guild.name + '**')
except (disnake.Forbidden, disnake.HTTPException):
await ctx.response.send_message(content='There was an error banning **' + str(user) + '** from the server called **' + guild.name + '**')
await ctx.response.send_message(content='Successfully banned **' + str(user) + '** from all SL2 servers!',mention_author=True)
else:
await ctx.response.send_message(content='Only SL2 High Command can run this command, please contact **SaintBrighten#3919** for more information!', delete_after=5)
await ctx.message.delete(delay=5)
Hey, does anyone have any suggestions on how I could make it so the bot let's the user know which servers the ban actually worked and which it didn't? Maybe the edit_message with disnake, but I don't know how to implement this.
thats becaue any time the bot restarts the bots cache is reset.
so let's say I mute you and I want to do it for 5 minutes. I know it's 12:00 PM as well. I can just set a timestamp for 12:05 and when the bot sees that the time is past 12:05, you get unmuted
because rn i'm getting a This interaction has already been responded to before, because I've called response.send_message already and you can already do it once
Which I'm aware is wrong, just was testing, any suggestions?
Use user id to check what time ur subtracting for what user
Wait a minute
You can just subtract all the rows at once
No difference
Technically the command is a temp mute command just made to be a different command
How do you set a timestamp
Ill try it
Ill go back here when it doesnt work and i got no more ideas
5_minutes_in_the_future = datetime.datetime.now() + datetime.timedelta(minutes=5)
if datetime.datetime.now() > 5_minutes_in_the_future:
print("5 minutes has passed")
Im guessing i can just change minutes to seconds
yes
you cant just await ctx
says line 16...
idk why thats there tbh. ima try without.
yeah that your issue
kinda literally says "in verify await ctx"
sometimes all it takes is reading your error.
im talking in reference to the code you sent , sir
yeah, it was the error complainin line 16. its fixed now tho.
Question, I need to make the bot respond to a message if 2 keywords are present, but I only know how to do it for one. How would I go about doing something like that?
2 specific ones?
Yeah
need an order to em?
Preferably, but not required
Alright ty
How can i set a status command?
How would I make it not case-sensitive?
basic python,
if message.content.lower() == "".lower():
So
if message.content.lower() == "".lower() and "".lower():```
?
yes
Alr ty
!e
for i in range(10):
if i%2==0:
print(i)
what's the significance of and "".lower() there?
2 keywords
that's not how and statement works , you would have to mention the condition after and too
if 2 > 1 and 0: #wrong ```
```py
if 2>1 and 2>0 : #correct```
!e
print(1)
print(2)
print(3)
print(4)
#bot-commands
if message.content.startswith("$bl"):
bl = randint(1,10)
if bl == 1:
ryv = [
"https://www.youtube.com/watch?v=3_wbWSlxG4A",
"https://www.youtube.com/watch?v=oyCYrCG0_MA",
"https://www.youtube.com/watch?v=ZU7Q2yvmwfc"
]
await message.channel.send(random.choice(ryv))```
what do i wrong
Alr sorry
bl doesnt work
from random import randint import if first
also , dont use on_message events to construct commands , use commands.Bot
So
if message.content.lower() == ''.lower() and message.content.lower() == ''.lower():```
?
any error?
sure but what are you trying to do?
you could use this idea
Make the bot respond if 2 keyword are present anywhere in the message, but only if those 2 are in
If 1, I dont want it to respond
!e ```py
var = [ 'a' , 'b']
if 'z' and 'b' in var :
print('.')```
@slate swan :white_check_mark: Your eval job has completed with return code 0.
.
oh
even if 'z' s not in var ,it prints it if no condition is mentioned
if 'word1' in message,content() and 'word2' in message.content():```
New problem how do i check multiple peoples mutetime
the if statmenet does not gets executed since the value of that variable is always not 1
(ignore my typos im on phone rn)
uh
This gave me an error
TypeError: 'in <string>' requires string as left operand, not builtin_function_or_method
We don't allow advertisement here, as is clearly stated in our #rules. Please don't do it again
I have msg = message.content so I just put msg
Replace the , with a .
is msg a pre defined variable?
I did lol
Ah
nop, join my sv to help me with the bot
Bruh 
Still not allowed I'm afraid
if msg in message.content and ....``` should work
replace .... with other condition
if message.content.startswith("$bl"):
bl = randint(1,10)
if bl == 1:
ryv = [
"https://www.youtube.com/watch?v=3_wbWSlxG4A",
"https://www.youtube.com/watch?v=oyCYrCG0_MA",
"https://www.youtube.com/watch?v=ZU7Q2yvmwfc"
]
``` what do i wrong
.
Bruh
didnt you get an answer?
msg is defined as message.content so it would be if message.content in message.content and ....?
are you aware what do you have in the code?
msg should be defined as the word you want to check
Oh I have that defined as another variable lol, so if I want to use 2 keywords Id need to define one with 1 word and another with another?
I would set a task to loop through all the muted users and unmute any that are expired every 5 min or something
yeah , or just use it directy you dont need to use variables for them
!e py if 'p' in 'python': print('yeah')
@slate swan :white_check_mark: Your eval job has completed with return code 0.
yeah
So
msg = message.content
if '' in msg and '' in msg:
?
But with ''.lower", and yeah the keywords inside the ' '
its preferable if you do message.content.lower() too
Alr, so if I do msgl = message.content.lower() I could use msgl instead?
your wish , variable naming doesnt really matter till it follows the pep rules
show the exact code you have
if 'where'.lower() in msgl and 'skin'.lower in msgl:
@slate swan mb for ping but I responded late lol, sorry
'skin'.lower()
also lower isnt required since it is already lowered
Yeah but I want the keywords to work without having to worry abt caps
So like where and skin work, but also Where and Skin
m , you miss the brackets tho
Yeah ik lol, I do that a lot, I deleted some things I had in it since I no longer needed em so let me try it rq
Ah perfect! It works, thank you!
I don't really know a good way to do it but you could make a count and add to it each time a command is used.
I wasn't typing that long
I stop then started again
probably exactly what u should do
manage_server isn't a valid permission?
!d discord.Permissions
class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.
The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.
Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.update "discord.Permissions.update").
it's guild
i can some one help me i had to remake my code now i need help to
build the code is dm people
Ask your questions here
ok
first let me make the error code
Do dpy buttons not work anymore?
you have to install nextcord then uninstall poetry and discord and install potry and billions of things
yes but they didnt say anything
I think they should have a developer newsletter
WHAT
ok
they had to make it complicated
and even the avatar cmd doesnt work
member.avatar_url???
oh
sad
nope
from its description I would rather code everything in one file
and make it 209393 lines and flex it to everyone LOL
Why didn't it work? Any errors?
Read the breaking changes gist
you'll know why it doesn't work
property avatar```
Equivalent to [`User.avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.avatar "discord.User.avatar")
if you feel like you wanna give up thats just you lacking python knowledge to make a bot ¯_(ツ)_/¯
we're gonna act like you didn't see my messages thats ok
how do i make a discord bot create a webhook
!d discord.TextChannel.create_webhook
await create_webhook(*, name, avatar=None, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a webhook for this channel.
Requires [`manage_webhooks`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_webhooks "discord.Permissions.manage_webhooks") permissions.
Changed in version 1.1: Added the `reason` keyword-only parameter.
i love u
;-;
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.
async def on_member_join(member):
await bot.get_channel(891878891889766414).send(f"welcome **{member.name}!**")```
how do i change it from just sending a message like
"welcome **john**"
to mentioning someones USERID?
Uh
!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.
wdym by mentioning id?
member.mention
!d discord.Member.mention
async def avatar(ctx, member: discord.Member=None):
icon_url = member.avatar_url
avatarEmbed = discord.Embed(title = f"{member.name}\'s Avatar", color = 0xFFA500, timestamp=ctx.message.created_at)
avatarEmbed.set_image(url = f"{icon_url}")
await ctx.send(embed = avatarEmbed)```
any idea on how to make it so i dont have to mention a user to use this command?
(sorry if im getting buggy im getting back into coding and trying to fix up my old bot)
recode it
trust me it's worth
async def on_message(https://images-ext-2.discordapp.net/external/r_HR-WHA2AzKT3y9NwUWCCiWCpKH440-5B_0_sxrcm4/https/i.imgur.com/w5vm9l8.mp4):
if 'https://images-ext-2.discordapp.net/external/r_HR-WHA2AzKT3y9NwUWCCiWCpKH440-5B_0_sxrcm4/https/i.imgur.com/w5vm9l8.mp4' in message.content:
await edit(https://images-ext-2.discordapp.net/external/r_HR-WHA2AzKT3y9NwUWCCiWCpKH440-5B_0_sxrcm4/https/i.imgur.com/w5vm9l8.mp4, "https://images-ext-2.discordapp.net/external/mpGFFgi1XQhjX_3U2Alopp4JS-4onQa55B7L__53xiQ/https/i.imgur.com/qJyjIIN.mp4")
``` pls help me
help debug
!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.
set the message you want to edit as a variable
uh
-> The syntax is wrong
-> You can't edit someone else's message
-> message is undefined
this is way off
Ok
I suggest u learn more about Python and specifically functions please
What to fix
!resources are a great way to get started
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I have read all of that
the color is so goo
???
!d discord.on_messafe
No documentation found for the requested symbol.
!d discord.on_message
discord.on_message(message)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") is created and sent.
This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.
Warning
Your bot’s own messages and private messages are sent through this event. This can lead cases of ‘recursion’ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that [`Bot`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot "discord.ext.commands.Bot") does not have this problem.
Can u help me
the color of the embed
If u have, then u shouldn't have any problem with that on message event lol
Idk
@devout quest
What
click tap to see attachment
i just provided literally everything
OMG GUYS MY BOT GOt VERIFYED!!
niceeee
Nice
my anti-nuke is almost done i just need to finish some moderation cmds
weirdo alert
i worked 4 years and it finally become verifyed
4 years..
the code isn't even in the correct function..
send code
i'm also guessing you have little to no experience with python
use !recourses
!recourses
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Little
Why do you have so many linebreaks is my first question
I learn py by coding bots
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
discord.on_message(message)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") is created and sent.
This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.
Warning
Your bot’s own messages and private messages are sent through this event. This can lead cases of ‘recursion’ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that [`Bot`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot "discord.ext.commands.Bot") does not have this problem.
@devout quest does your code have that anywhere?

this python bot prolly took the longest time to make
Ok
ik
if message.content.startswith("g!wish"):
await message.channel.send("https://images-ext-2.discordapp.net/external/r_HR-WHA2AzKT3y9NwUWCCiWCpKH440-5B_0_sxrcm4/https/i.imgur.com/w5vm9l8.mp4")
time.sleep(5)
async def on_message(message):
if 'https://images-ext-2.discordapp.net/external/r_HR-WHA2AzKT3y9NwUWCCiWCpKH440-5B_0_sxrcm4/https/i.imgur.com/w5vm9l8.mp4' in message.content:
await message.edit(message,"https://imgur.com/qJyjIIN")
that's it..
wait what?
!resources pls
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
learn basic python first
i beg
before coding discord bots
@devout quest
he's missing a lot
I have learned all 2 times
like a lot
Lmao, pls help
And you still can't do correct indentation??
Dont wanna learn again
not functions
dictionaries, loops, classes, objects, def, functions, indexing, etc?
I missed a few
but you get the point
Hu Tao lol

if you can tell use what you want to do, i think i may be able to add some of my insight
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
What next, read what
tap on Resources page loo
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
here's the docs
he doesn't understand basic python, he won't understand
Wtf, how to invite your bot
!d discord.ext.commands.Bot start here
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
where are you come from? =))
lol, curious
i think mars
Im from liyue
-.-
🧢
but what to fix
your spotify profile
pretty sure that you're chinese
Fck no
but my bot is like a open for everyone na, not for a particular servr
umm, us?
Learn at least basicbpython
Ok
rather than tell people to learn python, tell him what he wants
sorry, actually after that I went to sleep, was night at that time here
he wants to know what's wrong
Im from liyue
by learning python
What
Max Minh Duc
Wtf
i told him that he needs to put it inside a function from the docs specifically !d discord.on_message
tell us what you intend to do with your code, and maybe i can help you improve it...
Then
then
!d discord.on_message
is what i meant
!d discord.on_message_delete
you can't edit someone else's message no
!d discord.ext.commands.check
@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").
These checks should be predicates that take in a single parameter taking a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event.
If an exception should be thrown in the predicate then it should be a subclass of [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError"). Any exception not subclassed from it will be propagated while those subclassed will be sent to [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error").
his playlists sounds edgy
maybe a teen 14-16
and contain vietnamese words becuase i'm vietnamese :l
nah just his
yes =))


