set_author(*, name, url=Embed.Empty, icon_url=Embed.Empty)```
Sets the author for the embed content.
This function returns the class instance to allow for fluent-style chaining.
#discord-bots
1 messages · Page 512 of 1
!d discord.Embed.set_footer
set_footer(*, text=Embed.Empty, icon_url=Embed.Empty)```
Sets the footer for the embed content.
This function returns the class instance to allow for fluent-style chaining.
it's not an embed
oh it works
Im pretty sure the bot create a webhook then send a embed with it
Idk how to do that
o
yea it will work what is wroong is u did entered wrong id or access error
e = await channel.create_webhook(name="test", avatar=ctx.author.avatar) i dont know tho
could i use emoji=bot.get_emoji(emoji_ID) more than once in 1 command?
more than once in an embed for example
yea u can make a clone like emoji_1
ah yes
i'll try that
etc etc
yup
tysm, also how do i add more than one line in descriptions?
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.skid.systems/
for example like that ^
\n for new line
hmm use \n
alright tysm
wait how u got curved edges?
@slate swan ur sus
wym xd
lol
means u using some kinda better discord?
nope lol
what
man i think we should stop supporting @slate swan
not at all xd i dont use betterdiscord that is disgusting.
lol its upload.systems XD
then how u got this
its got nothing to do with betterdiscord
^
upload.systems search it up on google
u take a pic with sharex and upload.systems will convert it into a link which u can use to send
means am aksing how u got curved edges in embed ??
like he said
its the website
oww i though different
i can change it too watch this
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.skid.systems/
xd
pretty cool right?
yea
how do you get an invite code LMFAO
u have to boost their server
o
yup
but u dont have booster badge?
my other account has nitro boost
lol i got nitro boost on this but im waiting for my nitro classic credit to end
u also have nitro
with epic method?
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.skid.systems/
nope
mhm
i need to wait 7 months until i can use my nitro boost credit
#help-bagel ❤️
https://bread.likes.cash/ktzh9jiuw9a.png me when the
better learn if u got stuck then ask support here
\'
mmk
any discord.py masters?
ask any help dont expect for masters
masters never help
you are master
no am moderate
#help-bagel ok lol
I help.
ok some will help
me when pep8
how do i get a mobile status on discord.py
Im pretty sure you cant
But idk
oh, how come?
u can only set ur bots status to offline, dnd, idle, online
anything else u cant i think
How
its a discord bug
and requires you to monkeypatch stuff
so i'm using logging module to log some errors/info in runtime how do i disable the logs from discord.py lib
which if you dont know what you're doing, you can easily break stuff
uh you could try logging.getLogger('discord.client').disabled = True
and same for discord.http
alright
how do you make a bot reply to ur message?
discord.Message.reply
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.fuckedyourmom.today/
like this ^
await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").
New in version 1.6.
yo can someone help me make consecutive commands
I'm trying to make a command to put the server tag in someone's nickname ```py
@commands.command(pass_context=True)
@commands.guild_only()
@commands.cooldown(rate=1, per=3)
async def tag(self, ctx, member: discord.Member=None):
if member == None:
member = ctx.author
else:
member = member
await member.edit(nick=f"!📛√Νέο {member.name}")
It works. If someone uses the command like `.tag` it puts it in their nickname and if they do `.tag @member` it changes that members nickname. How can i make it so that `.tag @member` only works if you have the manage nicknames perm ?
kinda like where the first command asks user input then listens for the users next message
cant get the part where it detects another message from the user working
could u give an example of u using it?
Its just like ctx.send
oh it is?
?
You’ll need to use wait_for
oooooh
And then a check function to test if they are the same person and also same channel or whatever you want
!d discord.Client.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
tysm TwT
could u give an example pls
await ctx.reply("example message")
!d discord.ext.commands.Context.reply
await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").
New in version 1.6.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.skid.systems/
tysm it works but how do i make it not mentionable?
Ah whoops
Set the mention kwarg to false
!d discord.Message.reply
alright ty
keyword mention_author = False
!d discord.abc.Messageable.send
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
await ctx.reply("hi", delete_after=5)
wait
@slate swan .reply is just a shortcut for send and fills in the reference message for you, just set mention_author to false and it works
I mean mention_author=False

there is none
Uh?
you can make one
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.fuckedyourmom.today/
like this
…I don’t get it?
!d random.choice
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3.10/library/exceptions.html#IndexError "IndexError").
You’re just doing a command?
U gotta select an option and just send it
I see nothing random
He just wanna send random phrases with the ping in MS
No the last part
Like, see the bolded part
Oh that
Yea haha
Yeah random module
so random.choice(**a connection to the server**;**example**) like that?
Semicolons in python
You freak!
OOPS

!d random.choice
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3.10/library/exceptions.html#IndexError "IndexError").
so in your case it would be like
random.choice(['**a connection to the server**','**example**'])```
print(1); print(2) :D
ah okay
Noooooo
I know it can exist but it’s against every single standard and regulation in python
And it should not exist
People who move from JS to Python: Yay, Python also has semicolons =D
C
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.skid.systems/
Bro...
You forgor 💀
U gotta save it to a var
oh oops
Dammit autocorrect hates the word eval
Lmao
Lol
From eval to even to veal to Evan
Turn off autocorrect
is afraid of*
Ez fix
😂

😳
Remember, ducks
On another note: disthon is coming out very nice already
Ahh, Finally my code is organized..
Current stare of making an event
If you don’t pass an argument to the decorator it uses the function name as the event name
Isn't Disthon the Library by Arshia??
Whats disthon
Yes
Nice
Nice
you should make the data classes like Message or smth
And I’m one of the developers who is working a lot on it
They are being made already
Nice
Models are coming
I pretty much wrote most of the internals
The websocket, handling events, sending stuff to the API
Wow

The discord websocket was a pain to get working tho haha
Big up on him
Welcome to how I feel all the time as I don't know how to code
Lol
Welcome to discord’s websocket API for receiving events https://github.com/AA1999/Disthon/blob/master/discord/websocket.py
wait, did you said that you're going to rename .listener() to event?
Already did
the code is still listener 
discord/client.py line 65
def event(self, event: str = None):```
Yours is then, not the master branch
The gateway happens to be one of the most consistent parts of the discord API, surprisingly
Yeah fair enough, I guess there isn’t much to change over time
Where the API for sending requests needs to feature all changes every time
And that one will change a lot
await channel.send('Hello {.author}!'.format(msg))
what does the .format do here?
def check(m):
return m.content == 'hello' and m.channel == channel
msg = await client.wait_for('message', check=check)
await channel.send('Hello {.author}!'.format(msg))
!d str.format
str.format(*args, **kwargs)```
Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields delimited by braces `{}`. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of the corresponding argument.
```py
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
``` See [Format String Syntax](https://docs.python.org/3.10/library/string.html#formatstrings) for a description of the various formatting options that can be specified in format strings.
ooooooooh tysm
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
Same
What is Rich Presence?
It’s that activity thing you see when people play games or listen to music on Spotify
Normally it’s just a presence
!e
def foo():
return "hi {0}!"
print(foo().format("Kylee"))
```this is what str.format should be used for
@visual island :white_check_mark: Your eval job has completed with return code 0.
hi Kylee!
But rich means it has more details and often is interactive
Like on Spotify you can press listen along
Or a twitch streamer shows what they are streaming and a join button
Some games have that too
That’s rich presence
Is there a way in which I could host a bot for free? I'm trying to avoid repl.it though since I run listeners and tasks with .sleep's inside.
Self host
Self hist
Host*
Tho good on you for avoiding replit
Cannot leave my PC turned on all day long
Hahah why?
Sadly hosting just costs money
Replit is the lowest point you can ever go
no free host available
It’s horribly disgustingly bad
whats the cheapest host? It shouldnt be expensive
I agree
There are many pick one you like, you don’t need anything fancy. Even a few bucks a month is plenty
aws has 1 year free plan
I remembered I used to pay 3 bucks a month for a VPS, I could host like 5 bots or more haha
Exactly
Yeah but I dont have a CC 😛
It’s not much
lmao same
await ctx.reply(f'it took `{round(bot.latency*1000)}ms` f{random.choice(responses)})', mention_author = False)
Same
Traceback?
why am i getting an error
I have a vps for 6 a month where I host like 3 discord bots, a Reddit bot, a website with like 20-30TB of traffic a month
Share the error plz
😆
Damn...
What VPS are you using?
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://khadz.fuckedyourmom.today/
And I still have a lot of headroom
You need to define random.
Netcup, only downside is they are a German company and only have one datacenter in Germany
I think you need to import random
import random
yeah
alright
You forgot to import random
He forgor 💀
Right... But that shouldnt be a big problem
All VPS plans from them: https://www.netcup.eu/vserver/vps.php
I have this
Nah
F
Nice
The setup is in spanish/english or only dutch?
If someone asks I say the host gif I’m not using referrals or so
Their website is English and their staff also speaks English
Code: sebkuip
But they are native to Germany
Great
So they also have everything in German not Dutch
Dutch is my language, from the Netherlands
Not from Germany
But with knowing one you can know the other one pretty easy right?
Anyways I’d say best is just to look around
I've dutch friends and they all speak German
Haha no
Then its just a coincidence
No worries
Have a good one
!custom-check
Custom Command Checks in discord.py
Often you may find the need to use checks that don't exist by default in discord.py. Fortunately, discord.py provides discord.ext.commands.check which allows you to create you own checks like this:
from discord.ext.commands import check, Context
def in_any_channel(*channels):
async def predicate(ctx: Context):
return ctx.channel.id in channels
return check(predicate)
This check is to check whether the invoked command is in a given set of channels. The inner function, named predicate here, is used to perform the actual check on the command, and check logic should go in this function. It must be an async function, and always provides a single commands.Context argument which you can use to create check logic. This check function should return a boolean value indicating whether the check passed (return True) or failed (return False).
The check can now be used like any other commands check as a decorator of a command, such as this:
@bot.command(name="ping")
@in_any_channel(728343273562701984)
async def ping(ctx: Context):
...
This would lock the ping command to only be used in the channel 728343273562701984. If this check function fails it will raise a CheckFailure exception, which can be handled in your error handler.
same goes with guilds
Either a check or an on_message overwrite
!d discord.ext.commands.Bot.check also works
@check```
A decorator that adds a global check to the bot.
A global check is similar to a [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is applied on a per command basis except it is run before any command checks have been verified and applies to every command the bot has.
Note
This function can either be a regular function or a coroutine.
Similar to a command [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check"), this takes a single parameter of type [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context") and can only raise exceptions inherited from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").
Example...
check ctx.guild.id and compare it to your server id
if its comes out as True, return from the command
Or even more complex, check the guild owner and see if that is you so it works on any of your own guilds
is trusted?
What do you need help with
This is the same question as "how to make a bot", it's just a big task. I can however explain you how to get started and what steps you need to take.
but it doesnt create a channel
U need to use on_raw_reaction_add to check if someone reacted and then check if the emoji and the message is the same as the one u want
lemme show u my code
def check(reaction, user):
return str(reaction) == ':envelope_with_arrow:' and ctx.author == user
@bot.command(pass_context=True)
async def ticket(ctx):
guild = ctx.guild
embed = discord.Embed(
title = 'Ticket system',
description = 'React :envelope_with_arrow: to make a ticket.',
color = 0
)
embed.set_footer(text="ticket system")
msg = await ctx.send(embed=embed)
await msg.add_reaction(":envelope_with_arrow:")
reaction = await ctx.fetch_message(msg.id)
await bot.wait_for("reaction_add")
await bot.wait_for("reaction_add")
if reaction == ':envelope_with_arrow:':
await bot.wait_for("reaction_add", check=check)
await ctx.guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
Ah
why are you waiting 2 times?
U need to save them in a var also
save what?
reaction, author = await bot.wait_for....
Why are there both client and bot

reaction.author?
I’ve used them for like 1.5 years now
no results
await msg.add_reaction("📩")
```isnt this ryt?
is there any way in which I can get a complete list of the modules my bot uses so that I add those in the requirements.txt
That's called Ctrl + C & Ctrl + V
Yeah thats ok, whats ur traceback
Yea
you could manually check what modules you use and add them
can anyone say what is the prob?
whats the traceback
none
it shouldnt be alot, right?
!d try
it is not creating a channel
dont print it
that should show the traceback
catches error
raises error
you can print it with traceback like this;
print("".join(traceback.format_exception(error, error, error.__traceback__))))
where error is an exception
the first argument should be type(error) iirc
traceback.format_exception(exc, /, [value, tb, ]limit=None, chain=True)```
Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception"). The return value is a list of strings, each ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception").
Changed in version 3.5: The *etype* argument is ignored and inferred from the type of *value*.
Changed in version 3.10: This function’s behavior and signature were modified to match [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception").
!e import traceback
try:
print(x)
except Exception as error:
print("".join(traceback.format_exception(error, error, error.traceback)))
@manic wing :white_check_mark: Your eval job has completed with return code 0.
001 | Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | NameError: name 'x' is not defined
no one?
no variable x
was talking abt #discord-bots message
🤦♂️
man_facepalming
!e import os
os.system('pip')
@manic wing :warning: Your eval job has completed with return code 0.
[No output]
is color = 0 valid?
I think its not
How do I make a user react to a reaction, the bot does a defined action?
i got a traceback
share it pls
so … the bot adds a reaction, a user reacts and then the bot does something?
yes
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.
message = await fetch_message(id, /)
you need to store the fetched message and await it
oh, i went off the function signature, but the first argument isnt actually used for anything
msg = await ctx.send(embed=embed)
await msg.add_reaction(":envelope_with_arrow:")
reaction = await msg.fetch_message(msg.id)```
what is the prob in this?
message.add_reaction(emoji)
reaction, user = bot.wait_for("reaction_add", check=lambda r, u: u == ctx.author)
#do shit```
thanks
why are you fetching a message you already have in a variable and cached
Can anyone tell me why my "help" command doesn't work?
thn what shd i do?
to fix it
no, since we dont know your code
I will send
I dont know what youre trying to do, your code is shit
@client.command()
async def help(ctx):
await ctx.send("`prefix is ?")
trying to make a ticket cmd
and an error came
did you remove the default help command?
isnt help a pre existing cmd?
sh.
if not, pass in help_command=None into your Bot's constructor
what error
you need to do bot.remove_command("help") or smthing
eh what was that?
uH alright I will try
bruh
im saying be quiet because nothing you say is helping and its pissing us off
who "us", you mean you?
:o
but what wrong did i say
nothing just ignore him
do you have an error you can send
you still havent sent the error
Can I dm the error?
can you just send it here ..
kk
Yeah, please keep help related things in the server unless you are explicitly told otherwise.
client = commands.Bot(command_prefix='-', help_command=None)
do this @slate swan
Alright
nice spoonfeed
lol
fascinating it worked.
lol that only @hasty iron also said
but difference is i just gave the code
i did for u @slate swan
Thanks blanket and you too
lol he is blanket
can you stop pinging
lol
hmm. alright
need import?
no
@keen kraken why did u gave frnd request to me??????????????????
can u help me too?
in what?
making a ticket cmd
hmmm what ticket?
hmm
return in lambda?
oops
?
await message.add_reaction(emoji) *
gone
just say wdym by ticket
yes, emoji is the emoji you want to add
we cannot code for u
but after a while u deleted your message
but we can help if u got stuck
i do have a code
then run it
just it ends up with error
send the error
thats why iam here
ok tell about the error
MAN AM SEEING CHANNELS MOVING UP AND DOWN
Some Mod is changing again and again
ok
but channel is not getting created
.
ik its getting privated or something
def check(reaction, user):
return str(reaction) == ':envelope_with_arrow:' and ctx.author == user
@bot.command(pass_context=True)
async def ticket(ctx):
guild = ctx.guild
embed = discord.Embed(
title = 'Ticket system',
description = 'React :envelope_with_arrow: to make a ticket.',
color = 0
)
embed.set_footer(text="ticket system")
msg = await ctx.send(embed=embed)
await msg.add_reaction(":envelope_with_arrow:")
reaction = msg.id
if reaction == ':envelope_with_arrow:':
await guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
nothing with that msg and just saying
ok tell the error
just the channel is not getting created
tell the error name? or ss?
no errors
hmm
wtf u did man
see that
reaction = msg.id
oops
then how will it check that if statement
it will check the id
it will not check that emoji name
it was msg.fetch_message(msg.id)
@dim cedar
check this code
if u need to check if the user reacted to the emoji then this is the code u want to add
did that
now there is an error
send error
also why do you need to fetch the message you alr got the message
thn
new error
i said that like 20 minutes ago but he doesnt listen nor know python lol
so i wanted to convert a scratch project to python... can anyone help me?

restart
can you show more of the error?
^^^
new error
is the check inside the command?
nope
Why is rising me this error? ç_ç
Hello again I have tried and tried and failed to do this, is anyone able to send the corrected code and explain to me what is going on?
code: https://pastebin.com/n5ndNMy2
Issue: I can't move the channel id from config to which messages should be sent, the problem is that messages are not sent to this channel
error in consolle: https://pastebin.com/HMV5zfi8
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What is guiild
Server
thats why you have to put the check inside the command
Read my question again.
await get_prefix(message)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves the prefix the bot is listening to with the message as a context.
🤔
I know but read the question again (hint: it's a typo)
bruh the message passed is a Message object D_D
did that
It's message.guild.id not message.guiild.id at line 56
it's the message that i pass on get_prefix
did that
now no errors but the channel is not getting created

yeah thats fine but then you use an attrubute guild not guiild
you got an extra i, guiild
How do I set an limit for emojis?
To prevent emoji spam
async def get_prefix(self, message: Message):
pref = db.field("SELECT Prefix FROM guilds WHERE GuildID = ?", message.guild.id)
return when_mentioned_or(pref)(self, message)
@client.event
async def on_message(response):
if response.content.lower()=="blank":
responses=[f"**{response.author.name}, you say? @shrewd birch is a python-based discord bot developer (Beginner). Still he makes good stuff**", 'People say "He is still online"', "Blank is the hope of the future!", "I like Blank :3", "Hehe, What you wanna ask him??", "Blank is the secret of my energy!", "Blank.....", "Blank! Someone is calling you :D", "Blank is mine! Don't you dare steal him 😡"]
if not response.author.id == owner_id:
reply= random.choice(responses)
webhook = await response.channel.webhooks()
webhook = utils.get(webhook, name = "Embed Bot")
if webhook is None:
webhook = await response.channel.create_webhook(name = "Embed Bot")
embed = discord.Embed(description=reply, colour= discord.Colour.random())
await webhook.send(username="OwO", avatar_url="https://media.discordapp.net/attachments/861042562553872435/893878367726760006/cdn_discordapp_com-4844cebae2d84d63254ce5e383709a46__1_-removebg-preview.png", embed=embed)
This won't run when I use the bot in replit
Now i have this D_D

pref is a tuple you need to unpack it
print it first
How do I prevent emoji spam?
@cloud dawn Can you help here too
Wait maybe i know why, i'm checking my db lol
No check the variable, it db returns all values as tuples
No experience in webhooks sorry

So uh, how do I set a limit for emojis in a certain message
That is called a database
The fact is that probably i havent saved the guild yet, cuz it saves it when the bot join in the guild but the bot was already in the guild
Pretty sure im not, you want to do an action later also if the bot restarts.
Your sleeps will be broken once it restarts so you need a database to let it keep working.
But you'd need another method that sleep.
can u help me too?
task, datetime objects, iterations etc
With?
@bot.command(pass_context=True)
async def ticket(ctx):
guild = ctx.guild
embed = discord.Embed(
title = 'Ticket system',
description = 'React :envelope_with_arrow: to make a ticket.',
color = 0
)
embed.set_footer(text="ticket system")
msg = await ctx.send(embed=embed)
await msg.add_reaction(":envelope_with_arrow:")
reaction =await ctx.channel.fetch_message(msg.id)
def check(reaction, user):
return str(reaction) == ':envelope_with_arrow:'and ctx.author == user
reaction, user =await bot.wait_for("reaction_add", check=check)
if reaction == ':envelope_with_arrow:':
await guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
in this code the ticket is not creating channel
Pref is None, i'm not understanding why :L
help??```py
class Dropdown(discord.ui.Select):
def init(self):
options = [
discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦')
]
super().__init__(placeholder='Choose your favourite colour...', min_values=1, max_values=1, options=options)
async def callback(self, interaction: discord.Interaction):
await interaction.response.send_message(f'Your favourite colour is {self.values[0]}', ephemeral=True)
class DropdownView(discord.ui.View):
def init(self, ctx):
super().init(timeout=5)
self.ctx = ctx
self.add_item(Dropdown())
async def on_timeout(self) -> None:
self.children[0].disabled = True
self.children[0].placeholde = 'Closed'
await self.message.edit(view=self)
```it not changing the placeholder to Closed
hello how can I mention a user with a command in discord.py??
placeholde
how can i make a bot that replys when i say something specific (for my server and a discord bot)
hey guys. So I have a list of cuss words and if anyone uses any of those cuss words, how do I delete that message
and warn them. And if they do it again, kick them?
basically how the Python bot does it?
hi
use ctx.author.mention
ok thnx
!d discord.ext.commands.Bot
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.
it has an activity attribute
custom status:
no
either Playing, Streaming or Watching:
yes
Hey guys! I am trying to create an admin bot. I wanted it to respond if i typed its name for testing, it is replying to every text from everyone. Please help me out here.
import discord
import datetime
import csv
client = discord.Client()
with open ('slangs.csv', 'r') as f:
reader = csv.reader(f)
data = list(reader)
@client.event
async def on_ready():
print("Bot is online")
async def on_disconnect():
print("Bot if offline")
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.author.id == 644126548818919434:
if str(message.content).lower()=="Professor?":
await message.channel.send("Professor is watching...")
if str(message.content)=="Hi Professor":
await message.add_reaction("\U0001F44B")
if str(message.content) in data:
await message.channel.send(f"You are voilating Server Rules. You will be kicked the next time. You have been warned.")
await message.delete()
client.run('TOKEN')
hello
need help
i am doing my project in repl
so when i import google trans it auto installs the version 2.4.0
but i need 3.1.0a0
now when i do pip install googletrans == 3.1.0a0
it works well
but after a while when it refreshes it self the import causes a auto installation of version 2.4.0
so import googletrans gets unrecognized
and the whole code stops working
You would probably want to get a help channel for this
it is a discord bot project
It has nothing to do with a discord bot
Hilarious
So I have a little issue with my join command with my bot. What I did here is making my bot play an mp3 audio file that I've stored in my disk locally, using FFMPEG. Although this works, every time I summon her, this message appears in the console, saying I haven't really defined the properties of the FFMPEG or something like that.
What I wish to do is to make this message gone to avoid my console to be spammed. What should I do?
Is it possible to add a command to an on_message modmail system?
I think so. I don't know why would this prevent it.
So if a user does *report, all the messages after that, would get sent to the staff channel
Yeah you can do that by using an if condition. I'm not really advanced in such a thing, but everything is mostly possible.
Okay thx
How would I save member id in a list and the bot doesn't detect other messages from member until the member id gets removed from list in my code? https://hastebin.com/hasehutane.properties it would look something like this with the reactions
How to I send a message when a particular user (I have its ID) is mentioned
I’m trying to make this message only send once but idk how to
can we hyperlink value in .add_field?
if message.author.id == theIDyouhave
I said if a particular user is mentioned
Yes
How do we detect spams like if I say
A message again and again then it will mute me
ah, lemme think
how?
(name='test', value="test")
Someone ?
Don't know
Oh 😕
f"[{self.endtime.strftime("%b %d, %Y %I:%M:%S %p")}](https://time.is/UTC)" does this look okay?
Try it and see
!pypi discord-anti-spam
An easy to use package for anti-spam features in discord.py.
its giving some expected error
What's the error
expected ")"
You have a double quote string inside a double quote string
i want to make an hourly reminder that keeps asking the user weather they did a particular task. i want to pass the task name as a parameter...how do i achieve this.. is there a way i can pass an argument in a task function
Yes u used " after the %p no need of that
f"[{self.endtime.strftime("%b %d, %Y %I:%M:%S %p)}](https://time.is/UTC)" ```
replacing " with ' worked
yeah
that is needed
Oh then nvm
You can't have a double quotes inside a double quoted string
can someone help me with this
Can someone help with this?
any examples on dropbox??? i dont want the danny thing i have seen it
@stiff nexus You didn't event set scope in your bot's link
what?>?
see your about
ya but i dont get it what u said
click your link
oh
Just wondering how are you catching and sending the error?
hello guys! so i have this code that work perfectly fine. But i want it to make it, when the question end, it send what the user replied in the logschannel but dont know how. can you help?
@client.command()
async def dmtest(ctx):
logschannel = ctx.guild.get_channel(891754397082734663)
wres = discord.Embed(title="Πόσες ώρες έχετε στο FiveM?", description="", color=orange)
steam = discord.Embed(title="Ποιό είναι το Steam Name σας?", description="", color=orange)
disc = discord.Embed(title="Πόιο είναι το Discord Name σας?(μαζί με το #)", description="", color=orange)
onoma = discord.Embed(title="Όνομα", description="", color=orange)
await ctx.send(embed=onoma)
def check(m):
return m.channel == ctx.channel
msg = await client.wait_for("message", check=check)
await ctx.send(embed=wres)
def check(m):
return m.channel == ctx.channel
msg = await client.wait_for("message", check=check)
await ctx.send(embed=steam)
def check(m):
return m.channel == ctx.channel
msg = await client.wait_for("message", check=check)
await ctx.send(embed=disc)
@slate swan now?
error handler
u have any linkshortner?
If anyone knows about FFMPEG lmk!
working
thx for telling me lol also u have any link shortener
how to skip first iteration of task loop
NP :) sorry I don't
np
Anyone? .-.
use user
best python discord bot library (Not discord.py since its discontinued)
yup
nextcord then?
whats wrong with using dpy
later: python update breaks discord.py
unlikely but go off
kek
lmaoooo
you’ll have to wait a good period of time before a good fork shows up
Why would the docs for the intro change?
Its literally a fork
The only thing that would need changing in docs is any changes to methods or new changes
pycord is the only somewhat decent fork that i know off
i'm currently helping development of disthon which is a long ways from a good stable release, but we're getting somewhere
it's not a fork but a complete rewrite from scratch
@slate swan
edpy isn't good?
never heard of edpy
for an embed, can i not put color=(member.avatar_color) to make the color of the embed whatever the users avatar color is?
Member.color
ctx.author.color
this uses the role color no?
avatar color...?
!d discord.Member.color
property color: discord.colour.Colour```
A property that returns a color denoting the rendered color for the member. If the default color is the one rendered then an instance of [`Colour.default()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour.default "discord.Colour.default") is returned.
There is an alias for this named [`colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.colour "discord.Member.colour").
that works thx
Yeah indeed does topmost role color
the color of your banner, mine is dark purple bcs ive set it to that color
so you meant role color not whatever avatar color is
Oh, banner
no
yes:
I'm not sure if that's possible
the banner is an image, if you don't have it set or don't have nitro it takes the most prominent color from your profile picture
Yeah
Well then no clue sorry
so it's an image and can be almost whatever
yes, but its whatever the banner color is
banner is an image so there's no color to it and hence you cannot just grab that color
lmao you siad Member.color and thats exactly what it is
because it's only a solid color when you set it as one or don't have nitro
No member color is top most role color
oh
so it might just be that your role color is the same as the banner
Indeed
The only way to get the users colour corresponding to their profile is via the master branch
It should be under
User.accent_colour
How i can fix this error?
Context is under extensions since it's apart of commands
Would be discord.ext.commands.Context
Or if you have commands imported, commands.Context
!d discord.ext.commands.Context
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.
This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.
This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
that's the full path
import discord.ext.commands as discord
discord.Bot
discord.Context
lets be freaky
Not freaky just bad practice
it's disgusting
but if i add it i get another problem with my intents
what in the world are those freaking imports
so many unused imports
so many random imports that are NEVER needed
so many redundant imports
also this was complete satire to show what one should NOT do
but how i can fix error from this ss
class discord.Intents(**kwargs)```
Wraps up a Discord gateway intent flag.
Similar to [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions"), the properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools.
To construct an object you can pass keyword arguments denoting the flags to enable or disable.
This is used to disable certain gateway features that are unnecessary to run your bot. To make use of this, it is passed to the `intents` keyword argument of [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").
New in version 1.5...
okay i know but i don't know i get this error
You are importing discord.ext.commands as discord
you still have the import discord.ext.commands as discord
it work but i get next error
That's not causing the error
And it's not passing a param to ctx
That's a type hint lmao
oh
The error is because they didn't pass a listing tuple to aliases
how i can do it?
Pass a list or tuple to aliases
Show the command aliases statement
yeah
client = commands.Bot(command_prefix=[f"{get_prefix}", f"{prefix}"], help_command=None)
Can someone help me? ;-;
What's the error
I want a permament prefix + custom prefix
no need of 2 f string
Thats the problem, i dont have one
Ah wait mb
prefix works
get_prefix dont
only get_prefix works well
:(
Define one prefix in the statement and later use the custom prefix for servers
hello can someone send an invitation link from a personal made music bot(if u guys have one)i need it in my server
Later?...
I want both T^T
Ask that in a bot listing server instead
weres that
In on message event inside the command processes use a function which adds the prefix based on server + the permanent prefix
well, there’s a lot
Just search in google, you’ll find many of em
wdym
Knew it
you should definitely google instead
...
@client.event
async def on_member_join(member):
await member.send("Hello, you're not welcome here get out of my server!!! 😘")
Is something wrong with my event cause It's not doing anything when someone joins the server
You had members intent turned on?
wait
Dev. Portal
And also in code
how long did it take to draw this in ms paint?
it's a tag on the dpy server
right lmao
Name?
how2intents
Oh
found ya
try the 420 iq tag and also slash cmd
hm
thnx for the help
thnx for helping

your average tag maker
Inb4 "."
literally 80% of the tags
guys how do people make those silent messages
those "only u can see this" messages
i see that bots can do them now
an example of this is when u do [/nick name] if u dont know what im talking about
They are called ephemeral messages
Ah
what's the paramter for it?
for a textchannel class
the uh, send attribute
idk if you can send a message directly like this...
But yeah you can send ephemeral messages in reply to interaction response.
interaction response?
Yes
the ui kit thing?
Not through a normal message
lol
So its not like i can do ctx.send(thekwargname="")?
as the others have said, those are ephemeral messages, and are only allowed when using interactions (buttons) and slash commands (the discord commands system). Outside of that the only way is to send a DM to a user
k
oh well
Then there isnt much I can do
also select /dropdowns
Ig i'll have to make it send stuff in dms
Hey, is there any opportunity to check if someone has a certain role?
yes
if role in member.roles
Just looked and they do have ephemeral messages for webhooks although that makes no sense to me
!d discord.Member.roles
property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.
These roles are sorted by their position in the role hierarchy.
@rustic venture Here is where u can find it on docs for more information.
using the if statement like sebkuip just stated above u can search for a piticular role in the list of role objects
omg i cant spell today
particular*
So when i want to check if a person has a role like Muted
value=f'{idk what i should write here .. xd}'.....
role in member.roles
and then the role id?
nono, the role object
To find a role object using the role id u can use ctx.guild.get_role(roleid)
(assuming that ur using commands)
i have the role id xd
{890224661470793818 in member.roles}
you need to get the role object then
member.roles is all roles
it's a list of role objects
yeah
it will NOT work with an ID
Wait wait wut? What's the obkect of value
To mention the author or the role?
objective*
i need
Muted: YES OR NO ;D
oh
xd sorry
why not use a function?
idk bro
and what should i code ^^for this xd
if you just want true/false do the role in member.roles
no need to overcomplicate it
like
def rolecheck(member,role):
if role in member.roles:
return "YES"
else
return "NO"```
u can put that before your embed
oh wait i forgot to name the fucntion
so i call the name of the role?
like that
okey ;D
no the role object
bro whats the objekt
then in ur value just do {def(membervariable,muteroleobject)}
an instance of discord.Role
Just told u how to find it
U can use guild.get_role(ID) to get the role object
!discord.Guild.get_role
oh okey ;d
!d discord.Guild.get_role
get_role(role_id, /)```
Returns a role with the given ID.
Ye that^
I love you ;D
no homo
👀 ✅
is there any way to check if a member is banned?
so i can do
Banned: None ; Yes (if possible Reason)
Well I mean, there is a more efficient way but I would use member intents.
isBanned = "Unkown"
userOnServer = False
for member in ctx.guild.members:
if member == userBeingChecked:
return userONServer = True
if userOnServer == True:
isBanned = "No"
else:
isBanned = "Yes"```
Again there is prob a more efficient way, but from my knowledge this is what I woudl do.
A user not being in a server does not always mean they are banned
You will need to check the guilds banned list
!d discord.Guild.bans
await bans()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves all the users that are banned from the guild as a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`BanEntry`](https://discordpy.readthedocs.io/en/master/api.html#discord.BanEntry "discord.BanEntry").
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
like i said, from my knowledge how I would do. I didnt know that was a thing that could be checked
Your idea could be a lot more cleaner as well
if discord.utils.get(guild.members, member_obj): ...
Or guild.get_member with passing the Id
get takes an iterable and kwargs
xd
no other positional arg
ah
utils, forgot about those
how does get_member and find_member work?
lv1 = self.bot.get_channel(893530410531815424)
if message.channel == 786682458921238548:
embed = discord.Embed(title = message.author, description = message.content, timestamp = datetime.datetime.utcnow())
await lv1.send(embed = embed)```
`lv1` is a channel in `guild1`, `message.channel = id` is a channel in `guild2`. this should send msgs from lv1 to ksv , or did i do it wrong?
looks for a member on a guild
find_member isnt a thing
find_user i mean
get_member just grabs a member from cache
ik about that
find_user isnt a thing either
thats an api call
callback?
callback?
what
oh wait nah im thinking or smth else
i was thinking about traceback 🤣, that's a whole different topic
what are you trying to do?
trying to send msgs from a channel to another channel
the both channels are in different guilds
message.channel should be a discord.GuildChannel instance but you are comparing it to an ID?
use the attr. .id
ez
think he meant message.channel.id for the get_channel(id)
that ty
the variable is discord.GuildChannel