#discord-bots
1 messages ยท Page 749 of 1
Are u sure they aren't an alt? I might be wrong but I think all discord guild bans are IP bans by default
But I can't see it in ban list
Did u understand what I said?
It might be that one of their other accounts (if any) is banned
hello, i was just writing a bot and realized that discord.ext.commands.has_permissions cannot check for the manage server permission
this line:
@commands.has_permissions(manage_server=True)
returns the error Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> commands.has_permissions(manage_server=True) File "C:\Users\win\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 1779, in has_permissions raise TypeError('Invalid permission(s): %s' % (', '.join(invalid))) TypeError: Invalid permission(s): manage_server
!d discord.Permissions.manage_guild
Returns True if a user can edit guild properties.
is what you want
half an hour wasted on stackoverflow
how can i show how many guilds my bots in with this?
len(bot.guilds)
Use the for
the wut
what?
?
i didnt understand your question
you can i display how many guilds my bot is in
with this yeah
len(bot.guilds)```
alr
how can i make all my embed colors a certain color do i subclass the Embed class?
is there a bot i can add to my server which can make these boxes
print("these")
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
pretty easy just send msg with the backticks
oh, i thought a seperate bot was required to use it in different servers
no its not lol
ass
what fork should i use
uh discord.py got discontinued right?
yeah
and there are some forks to use
what
i didnt understand a word you just said
modmail github
i want to be my bot
like i change security
eh
is it your bot
you want to be your bot? as if self bot?
๐
self bot tos
Well if you want to self host it , read the FAQs or smthin
its someone else and i have to fork it and change the bot token and run the bot with some replit
Selfbot?
how to host it
im not good at python
im good at lua only
I know
then learn python
You run the bot's file
weong channel
Run the file on replit
no what lol
Pra PC with py version
where lua server
if youre good at lua why not just make your own bot with mongodb and discordia or something
^^^
or learn python. discord libraries on python are a bit complex
dat python
no python suck and its not a 3d platform
and lua has a 3d platform
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 146, in help
label = event.component[0].label
TypeError: 'Select' object is not subscriptable
The above exception was the direct cause of the following exception:
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 1353, in invoke
await super().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: TypeError: 'Select' object is not subscriptable```
HOw to
we dont use python to make roblox game mate ๐
Solve
no
this error
you cannot component [0]
i play roblox i dont play python mate ๐
It's not an iterable
Then What do I do
Ok
But I want to respond to the select menu
So how do I do that
@slate swan
What library do you use
Master branch?
python isnt a game, its a programming language...
discord_components
pip install -U git+https://github.com/Rapptz/discord.py
Idk about that library read the docs , ask in their help server
Or wait for someone else to respond
Wait what , are you using 2.0 , discord_interactions or discord_components

exactly
you cannot code in python by knowing lua ๐คฆโโ๏ธ
you need to learn atleast the basics
send the code
???
@zealous dagger youhave discord_comp and 2.0 dpy?
uninstall third party libs it breaks dpy
@commands.Cog.listener('on_reaction_add')
async def handled(self,reaction,user):
if reaction.message.channel.id == 931503735052591124:
await reaction.message.delete()
This would look at all reaction, wont this slow down the bot? Any better way to do this?
It won't look at all the reactions. The event is triggered whenever a reaction is added, so it would delete it as soon as u react
yeah I mean this event will be triggered each time a reaction is added, then check if it was in that channel. Wont this slow down the bot in larger servers?
is there a way to do commands in the discordBot dms?
heh?!
something about that xd
oh , what command are you trying to make?
No
its fine, Ill talk about it later in the pygame section xd, I connected my discordBot to my Game
maybe a bug in my game somehow
can anyone send me some code examples of tag command
like one in the R.Danny bot?
yes
the bot is open source , just check out its repo
!src tag
Show all known tags, a single tag, or run a subcommand.
Breh ๐
thanks
it uses pgsql iirc
i forgot that it will require db
oof and i dont know how to use db
hi
๐
you can learn something easy like sqlite or mongodb
yea will learn mongodb i alr had a tutorial i saved it
great
import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
to_send = 'Welcome {0.mention} to {1.name}!'.format(member, guild)
await guild.system_channel.send(to_send)
intents = discord.Intents.default()
intents.members = True
client = MyClient(intents=intents)
client.run('token')
nope
Else mine would not work
@heavy folio
and by the way
do you mean dpy for discord.py
or someother module
cause I use discord.py
!pypi nextcord
A Python wrapper for the Discord API forked from discord.py
Hey does nextcord works well
i used it for my bot, deployed it and pushed it to servers
its great
check out disanke too
!pypi disnake
and there is a new lib, in alpha/planning called Pincer. You can test with Pincer and learn it but don't make a production ready bot with it
!pypi pincer
I mean this
Can you give me an example
of using select
and with option response
I would be very thankful to you

class Dropdown(nextcord.ui.Select):
def __init__(self, options: list[nextcord.SelectOption]):
super().__init__(placeholder="Choose" min_values=1,
max_values=1, options=options)
async def callback(self, interaction: nextcord.Interaction):
...
class View(nextcord.ui.View):
def __init__(self, options: list[nextcord.SelectOption], *, timeout: Optional[float] = 60.0):
super().__init__(timeout=timeout)
self.add_item(Dropdown(options))
???
!pypi pycord
i was wondering why was it related to ffmpeg
installed what? first be consistent with what library you want to use
!pypi py-cord
you cannot use pycord discord.py discord_components everything in a single bot
No
I removed
Discord and replaced everything with pycord name in it
but not working
I'm trying to make a discord slash command. heres the code:
@slash.slash(name="Channel", description="Choose Querty chat channel", options=[create_option(name="channel", description="Channel", option_type=7, required=True) ])
async def Channel(ctx, channel: discord.TextChannel):
guild = ctx.guild.id
channel_dict[guild] = channel
print(channel_dict)
f = open("storage.json", "w")
json.dump(channel_dict, f)
the command doesnt appear in the slash menu
I'm using all intents
intents = discord.Intents.all()
client = commands.Bot(command_prefix='!', intents=intents)
slash = SlashCommand(client, sync_commands=True)
client.run(Token)
Client.run is last line
could anyone help
Why so
!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.
Are you defining it before the client and all
yes
the command does not appear on discord , thats it right?
yes
Is it giving some error
it will take 1 hr to appear on discord , unless you provide a test_guild or enabled_guilds arg depending upon the library u use
๐
Here you go
could you recommend a library to achieve this
guild_ids in the decorator
!pypi discord-py-slash-command
A slash command handler for discord.py.
first of all , its not recommended to not use any 3rd party libraries for slash commands
use a fork instead
for select menu and buttons
It works without ids too but it takes upto or more than 1 hour to do so
shift to a fork , or master branch
can I use a spoon
Use disnake or discord.py 2.0?
no
What in the world do you mean by fork
Ahhhhhhhhhhhhhhh.................!!!!!!!!!!!!!!
ill assume u dont use git , fork means a copy of a github repo
wheres that
OKkkkkkkkkkkkkk
Fine then see you (when problem occurs)
async def Channel(ctx, channel: discord.TextChannel, guild_ids):
``` that?
im sure anyone here would be able to help if you are using a fork instead of a 3rd party library since the View implementation is same for all forks and discord.py master branch ! 
there are also pretty much of examples if you want to look into ( brb in few secs with a link)
^^ examples
@client.event
async def on_message(message):
links = re.findall("discord.gg/[0-z]*",message.content) #regex all invites
for i in links:
try: #will fail if invalid
invite = await client.fetch_invite(i)
if not invite.max_age: #continue if its permanant
continue
else: #if not permanant
await message.delete()
await message.author.send('Only permanant invites are allowed!')
return
except discord.NotFound: #invalid invite handling
await message.author.send('Invalid invite link')
await message.delete()
return
except: #rate limit handling
pass
await client.process_commands(message)
this is a script that will automaticaly delete invites that are not valid permanant links, the bot gets rate limited very often. is there any way i can use an alternative to fetch_invite so it wont be an api call or maybe any way that wouldn't rate limit this.
probably not , i tried searching for an alternative but didnt get
someone told me u can use raw requests for that too
because they can spam invalid invite links and the bot will spam "invlaid invite link"
wait the lib handles ratelimits nvm
its just a big server, i dont need any spam handling here
Still u'll need to provide your token
Yk, bigger bots don't fetch invites
They just delete message iirc
hello
need help
class ReactionRolesNotSetup(commands.Command_Error):
pass
def is_setup():
async def wrap_func(ctx):
data=await ctx.bot.config.find(ctx.guild.id)
if data is None:
raise ReactionRolesNotSetup
if data.get("message_id") is None:
raise ReactionRolesNotSetup
return True
return commands.check(wrap_func)
class Reactions(commands.Cog, name = "ReactionRoles"):
def __init__(self, bot):
self.bot=bot
@commands.group(
aliases=['rr'], invoke_without_command=True
)
@commands.guild_only()
async def reactionroles(self, ctx):
await ctx.invoke(self.bot.get_command("help"), entity="reactionroles")
def setup(bot):
bot.add_cog(Reactions(bot))
is here any problem
i told you to use nextcord, and showed an example
its an advertising server
Ah
Hi, so i have an economy bot with a deposit command (sqlite3)
Any idea on how to put a limit that your bank balance cannot be more than say 500k?
just check the amount using conditionals
hello
is there a way to add multiple roles permissions for use a command? like this:
@client.command()
@commands.has_role(['RoleName1', 'RoleName2'])```
!d discord.ext.commands.has_roles
O my bad
Just use multiple has_role decos
ill try it, Thanks!
xd works
but you will need all roles to execute the command
๐ค
has_any_role
!d discord.ext.commands.has_any_role
@discord.ext.commands.has_any_role(*items)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has **any** of the roles specified. This means that if they have one out of the three roles specified, then this check will return True.
Similar to [`has_role()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.has_role "discord.ext.commands.has_role"), the names or IDs passed in must be exact.
This check raises one of two special exceptions, [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") if the user is missing all roles, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Changed in version 1.1: Raise [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
async def mute(ctx, member: discord.Member = None, time:int, reason = "No reason"):
In VSC there is a red line undertime:int
Thanks!
What error gives you when u run it?
async def mute(ctx, member: discord.Member = None, time:int, reason = "No reason"):
^
SyntaxError: non-default argument follows default argument
i always have to ping my bot to use commands how to solve?
async def mute(ctx, member:discord.Member=None, time:int=None, *, reason:str=None):
try this idk
because you have member as none and time as a positional arg
client = commands.Bot(command_prefix=when_mentioned_or("."))
remove the when_mentioned_or for only use with prefix
no lol
i use prefix only
!d discord.ext.commands.when_mentioned_or
discord.ext.commands.when_mentioned_or(*prefixes)```
A callable that implements when mentioned or other prefixes provided.
These are meant to be passed into the [`Bot.command_prefix`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.command_prefix "discord.ext.commands.Bot.command_prefix") attribute.
Example
```py
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'))
```...
the too problems
yes
should i delete that on_ready?
async def mute(ctx, member: discord.Member = None, time:int=5, reason = "No reason"):
You need default arguements before non-defaults
def hello(arg1,arg2,arg3='foo',arg4='bar'): #good
def hello(arg1,arg2='foo',arg3,arg4='bar'): #bad
so you can also put time before member if it must be specified
@heavy foliotell bro
no
@granite prawnpls help me
what problem
@granite prawn
i always have to ping my bot to use commands how to solve?
like .say hi @botping here . is prefix
client = commands.Bot(command_prefix=when_mentioned_or("."))
this is correct, you can ping the bot or use .say
bot = commands.Bot(...)
well bot or client is fine
You should be using bot as discord.Client is a thing
for some weird reason i use commands.Bot and name it client
and bot returns hi @botping
yes dont name it client (bad practice)
@karmic lintel send your on_ready
and stop pinging me
@client.event
async def on_ready():
print('Bot is Ready')
You probably watched a bad tutorial when you started
wait
@client.event
async def on_ready():
print(f'{client.user.name} has connected to Discord!')
on_message mb
i have two on_ready

@heavy folio
ill admit that, back then when i still couldn't read docs
I still can't read docs
help mee \๐ญ \๐ญ
Can you send your bot constructor?
The bot = commands.Bot() line
constructer means?
?????
I just told you which line
what?!!
i am not getting your point
im writing a program to generate all possible discord invites that arent vanity invites
im hitting a bit of a snag in trying to figure out how to get it to generate the other characters while its under 1000 (ex 0001,0100) the zeros in front of the one are "blank" becuase they dont exist
how do i make it so they do exist
import os
import random
try:
import json
import requests
except:
os.system("python -m pip install requests json")
proxylist = open("proxies", "r").readlines()
def PagingDiscordServer(webhook_url, text_message): requests.post(webhook_url, proxies={"socks5": random.choice(
proxylist)}, data=json.dumps({"content": text_message}), headers={'Content-Type': 'application/json', })
charlist = open("chars", "r").readlines()
webhook = "WEBHOOK"
length = 7
for i in range((len(charlist)**7)):
invite = "discord.gg/"
pls help ;-;
how do i send messages only certain ppl can see?
i just wanted to see all the possible ones and see what i find
Hmm yeah no probably shouldnโt
like i tried discord. gg/bi earlier and it gave me somthing in arabic
i just wanted to see what servers i find
Lot of common vanities are taken, meant to be public too so itโs not a big deal but itโs a problem when you get ahold of invites for servers that arenโt meant to be public
Its with an interaction
oh alr
im not rlly after those
Im not sure if it breaks TOS but it probably does
im after the plubic ones that are really intresting
It doesnโt really matter what youโre after the fact is youโre still trying to brute force invites and join servers you werenโt after
There are plenty of discord server listings online which you can look at
yeah that is very much breaking TOS
ugh fine i wont bruteforce invite
invites*
killjoys
Was there way to get client.owner or client.developer
basically the creator of object n turn it into obj
ephemerals, available just for slash commands
And buttons 
buttons are not standalone, you can't send just a button without something attached to it
like a message/embed
idk how to use buttons, time to start reading the docs again...
What do you mean?
what lib do you use though
Create a member object with bot's creator
If I'm the creator then it should: client.creator => returns user/member object
disnake
anyone help me pls \๐ญ
@quaint epochthis one pls \๐ญ
send code
https://www.youtube.com/watch?v=kNUuYEWGOxA
i recommend u this vid, it covers the basics of buttons, and it works for disnake too
This is the Ultimate Python Guide on Buttons with Discord.py or Pycord. In this video, I talk about how to create buttons in discord.py or pycord and how to respond to button clicks along with everything about Views. After watching this you'll know everything about Buttons and Views in discord.py or pycord.
This video might also apply to other...
full code?
just the beginning where you define client/bot
.bm
for a few commands where this problem occurs
it occurs in every command
I've already told you
Send your bot constructor
what?
!
client = commands.Bot(command_prefix='?')
*py bot =
stop.
don't do client it's confusing
eh?
it's a good practice but, sure
should i use bot= instead of client= ?
But its bad practice
hey so i am trying to make a slash command group using py-cord library
codes:
parody = bot.create_group(
"hmm", "parody"
)
error:
command.id = cmd.id
AttributeError: 'SlashCommandGroup' object has no attribute 'id'
MHM
just because you use it don't make it a good practice
bruh, everyone in this channel agrees that if you make a bot var to name it bot
- creating a bot using the Bot object and naming it client
why name it client when its a bot and not using client
your point?
@quaint epoch?/?
its like call a car a motorcycle
Its the common consensus that naming your bot constructor client is bad practice
I wont recommend discord.py to make discord bots
if you are making it as for a community example
music bots or game bots then no
if you are making bot for a specific server then its ok to use discord.py
sure it is bad practice in the sense that it makes things slightly more confusing when getting help with your code
you haven't sent the command that didn't work
๐ฅฑ people be like good practice to name your bot whatever but they don't know the basics of python
for example you might use a function from the commands extension that would usually not be seen with discord.Client
my all commands didn't work
without mentioning bot
yet you're using commands.Bot, it's just that your object is named client
I ate them
:incoming_envelope: :ok_hand: applied mute to @fervent violet until <t:1642170934:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
so, send, a, command
i am serious bro pls help
Can you send an example of one of your commands?
async def select(ctx):
await ctx.send(".s l")```
most cases its cuz of @bot.event
do you have events?
not because of the decorator by itself, but the event it is listening on
eh i dont use that
@final iron@quaint epoch
I don't see how that's relevant. You can know certain things
it would only be a problem if it's overriding the default on_message event
that's not the case for him
hmmm soo is it that just that command isnt working or all?
command is working but i have to ping my bot like
.command @botping
what about the arguments that you had to pass?
did you enable intents
it might be necessary
.select
hmmm can you show us the bot prefix statement?
@slate swan
can you send an existed command you have?
thats it
it is an existing command
do py intents = discord.Intents.all() client = commands.Bot(command_prefix='prefixhere', Intents=intents)
it might work afterward
why would he need privileged intents?
what it seems like to me is, he sends a command to his bot, bot replies with a message that intends to trigger another bot
which makes no sense at all in retrocess
wait i dont think so he needs intents
What type of storage library do you guys recommend for storing info?
I mean, like, JSON, pySQLite, etc...
@karmic lintel send the full script all the codes in the file
anything but pure json
you can use a json-like structured database, like mongoDB
depends on where you are hosting bot
irrelevant
it is relevant
wherever you are hosting your bot, you will be able to connect to an external database
@Bot.command()
async def addlink(ctx, link, name):
buttonG = Button(label=str(name), url=str(link))
view = View()
view.add_item(buttonG)
@Bot.command()
async def links(ctx):
await ctx.send('**Links:**' + name, view=view)```
now the question of you being able to host it yourself, that's another story
how can i get the info from the first command in the second?
so yes, irrelevant. he asked for a reccomendation
for name and view
if its heroku then he has to use postgresqlite because
if stores in json the json file resets after every push and if sql file then same
Someone here said not to use JSON because it doesn't work asynchronously with other parts of the bot...
You shouldn't be using heroku to host anyway
agreed, heroku is a platform for web applications
JSON isn't the same as a JSON-like database
yeah some people do in 6 months of coding have seen around 60 people using heroku
a JSON-like database can also be refered to a document-based db
lost count at certain point
Can someone check this
here's a good distinction of them both
a relational, column type database
and a document type database
you can use timeout
what?!
Just use timeout
merely sharing full snippets of commands is against the purpose of this channel
thats a self-bot
oh yeah
Do u have code for timeout ?
nope!
yes but no spoonfeeding
hmm then remove the bot=False in the run statement
So I should just use MangoDB then, right?
ok
working now! ty man <3
๐ ๐
what the....
most hosting providers provide smth like 150 mb dtbase for free, which is MORE THAN enough for a small disc bot
\โค๏ธ
did you just help this dude spam a discord server?
I really hope you mean mongodb
who?
are you nuts? that's a malicious script
bot=False is from the library named discum
(and also thats a library specially made for self-bot purposes only)
@slate swan
oh i see
@quaint epoch
Can anyone check this
oh... yeah, i misread, thanks.
wait wait
2hat happened
don't ping mods,
eh
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
if you're familiar with the structure of a json file, sure
it ain't your fault
MongoDB has it's downsides, but it is very beginner friendly
im dm'ing modmail now
eh i am new i didn't know .... sorry btw
should've read the code before helping though.
i've already done that, do not open another thread.
alr
did you get the username and id?
my apology everytime i read code i point out mistake not seeing the entire thing
of course
relax, he'll get his slap on the wrist and we will all forget this
move on
in a min or so
haha
Rage multi tool
I'm okay with using something more complex too, if it wouldn't cause any problems later...
๐คฃ
So I need some help comprehending the docs
which lib
Lets say we look at something like:
you should learn the syntax of SQL before attempting to use a relational database then
!d discord.ext.commands.Bot.run
run(*args, **kwargs)```
A blocking call that abstracts away the event loop initialisation from you.
If you want more control over the event loop then this function should not be used. Use [`start()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.start "discord.ext.commands.Bot.start") coroutine or [`connect()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.connect "discord.ext.commands.Bot.connect") + [`login()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.login "discord.ext.commands.Bot.login").
Roughly Equivalent to...
How do I know what the args and kwargs are?
Got it. Thanks
they're pointed out in the web page
!e discord.ext.command.Bot
@quaint epoch :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'discord' is not defined
!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.
nice
finally
tysm
๐คฃ
Where?
haha, i always forget the .ext
anyone know where I can ask questions related to aiohttp?
ty
my bot commands are working in dm how I cant stop them?
by using the commands.guild_only decorator on your commands
who i s deleting my commands? e
it blocks the specific command from running in an instance of DMChannel
Just remove the prefix for dms if you want ๐ ๐
oops didn't see this
run() is a different case because it is an abstraction of another function
!d discord.ext.commands.Bot.start
await start(token, *, reconnect=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shorthand coroutine for [`login()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.login "discord.ext.commands.Bot.login") + [`connect()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.connect "discord.ext.commands.Bot.connect").
so the same arguments that start() takes, run() takes as well
When you request invalid documentation the error will get deleted after a few seconds
how can i send a message if a user didnt fill in the requirtmenst for a command
@Bot.command()
async def link(ctx, link, name, text):```
lets say they didnt fill in a name
!d discord.ext.commands.MissingRequiredArguments in your error handler
No documentation found for the requested symbol.
you mean like, a missing parameter?
Rip
yeah
!d discord.ext.commands.MissingRequiredArgument
exception discord.ext.commands.MissingRequiredArgument(param)```
Exception raised when parsing a command and a parameter that is required is not encountered.
This inherits from [`UserInputError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.UserInputError "discord.ext.commands.UserInputError")
Imagine spelling error
xDF
what you need is to make a listener in the 'on_command_error' event
and then match if the specific exception is a MissingRequiredArgument type
uh
ohh
then you can make your statement
!d isinstance @solar anchor
isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.
Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
The object will be the error
And classinfo will be the error class
Rip they haven't fixed that yet
@Bot.command()
async def link(ctx, link, name, text):
buttonG = Button(label=str(name), url=str(link))
view = View()
view.add_item(buttonG)
await ctx.send('****' + text + '****', view=view)
if link == None or name == None or text == None:
await ctx.send("Fill in all requirments")```
i just tried this haha
Rip
@Bot.listen('on_command_error')
async def error_handler(ctx, error):
here's the starting point for your new shiny command error handler
now you figure out how to use the isinstance() method that hunter pointed you to
eh that's redundant
alright
as long as it's before Bot.run and after your commands.Bot constructor
you'll be good
๐
@slate swan
did you get the spammers user id?
@slate swan
a mod is asking me for the id
:|
On pc ?
ye
i was talking to wrench
the guy that wrote the spammer script
username/id would be great
mods asking
panicccc
i don't wanna be banned man
Turn on developer mode in settings
done
And then right click on user
i did it but he deleted all his messages
๐
wtf

mods
are going to kill me
I'll never be able to join this server again
hi i have a question, im making a ship command but i keep getting this error and i have no idea why. can anyone help me with it? heres my code
@bot.command()
async def ship(ctx, *, member):
author_name=ctx.message.author.name
responses = ['1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100']
response = random.choice(responses)
embed = discord.Embed(f'{author_name} + {member} = {response}% ', color = 3092790)
await ctx.send(embed=embed)```
i have an issue , im trying to make a ship cmd but it keeps giving me some sort of error. can any1 help? heres my code
@slate swan
@bot.command()
async def ship(ctx, *, member):
author_name=ctx.message.author.name
responses = ['1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100']
response = random.choice(responses)
embed = discord.Embed(f'{author_name} + {member} = {response}% ', color = 3092790)
await ctx.send(embed=embed)```
did you get the spammers id
this is the error thats giving me
type ```
description = blah blah blah
Instead of just `blah blah blah`
this is the error im getting TypeError: __init__() takes 1 positional argument but 2 were given
that's some really unneficient code
doesn't look like it's a problem with your code though
I ran into an error with cogs, and I can't seem to understand (I am new to using cogs and classes in general, so yea)
Code:
class Presets(commands.Cog):
async def check(self, member):
id = str(member.id)
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if id not in read:
read[id] = {"username": member, "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
class Economy(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def cog_check(self, ctx):
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(ctx.author.id) not in read:
read[str(ctx.author.id)] = {"username": str(ctx.author), "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
return True
@commands.command(aliases=["balance"])
async def bal(self, ctx, member:discord.Member=None):
if member==None:
member = ctx.author
presets = self.bot.get_cog('Presets')
await presets.check(member)
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(member.id) in read:
balance = read[str(member.id)]["iron"]
embed = discord.Embed(title=f"{member.name}'s Balance", description=f"{balance} Iron",color=ctx.author.color)
await ctx.reply(embed=embed)
else:
await ctx.reply(f"{member.mention} isn't part of my economy yet :(")
actually, I know what it might be
Error:-
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/runner/ElderTree-Bot/Cogs/EconomyCog.py", line 40, in bal
await presets.check(member)
AttributeError: 'NoneType' object has no attribute 'check'
add 0x before the color argument
color=0x3092790
so 0x3092790?
hunch was wrong then
nvm same thing
Can someone help?
most likely something else
what happened
presets is None
Hm?
?
How can I fix it then?
wait wth
my discord was lagging so much
sorry i didnt mean to spam my error lmaooo
idk sorry
oof
its fine haha. ik it sucks when that happens
yeah like it showed my msgs were deleted instantly so i tried re-sending them
mhm
you really should just use the randint function
instead of picking from a list of numbers as strings 
also
your list doesn't even work
because it's not properly formatted
yeah i know i forgot to add '' to every single number
no, you already have imported random
Just use random.randint(0, x).
randint is a function from the random stdlib
Only random is needed.
!e
import random
print(random.randint(0, 9999))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
6772
oh i see
Without code we sadly can't.
well too late now. ive finished it already
@slate swan Do you know how I can make use of functions in cogs?
ty tho will keep in mind
I want to make a check function, which I want to use in my Economy command cogs
you can use my kick script if u want
@bot.command(case_insensitive=True)
@commands.has_permissions(kick_members=True)
async def kick(ctx, member: discord.Member=None, *, reason=None):
await member.kick(reason=reason)
embed = discord.Embed(description=f'{member.mention} was kicked', color = 3092790)
await ctx.send(embed=embed)```
your code will be way more efficient
Can I also put the function in another Cog class and use it?
I wanna do this
Yes?
How do I do it though?
Just make a function in a file and import that file into your cog.
Oh you mean, a function in a cog and use it outside.
Nonono
Just make it outside and use inside, better practice.
Hmm, lemme show what I want to do
works now with embeds too
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html#using-cogs
I want to do this, but I keep getting errors
@slate swan
What is client defined as?
(sorry for ping)
Without the error we can't do anything..
huh?
Maybe send the error you got ๐
I did, lemme reply to it
yeah, upload the traceback on the paste service
^
A instance of class Presets, I guess
code^
try this
@client.command(pass_context=True)
@commands.has_permissions(ban_members=True)
async def mute(ctx, member:discord.Member):
role = discord.utils.get(ctx.guild.roles,id=929296185074778145)
await member.add_roles(role)
await ctx.send(f'{member} was muted')```
i guess
pass_context has been deprecated
you can remove it without trouble
not that it changes anything
but, you know, it doesn't need to be there
Oh well as I said, make a separate file for these functions.
Okeh
Do you have a decent error handler at least?
Well you should get an error handler, otherwise the bot won't say anything when it doesn't have permissions.
You appended a Member object to a string.
"muted"+member
string+Member
You could've done str(member)
Or put it in an f-string, which does exactly the same.
i usually just do python await ctx.send(f'{member} msg')
!f-strings
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.
in say command cant we ignore after 3 words?
@slate swan
!pypi time-str
^^ u can use this too
@slate swanhelp me \๐ญ
What do you mean?
well im unable to understand your question
like i made a dc bot and i also made say command in it so whatever we say it repeats but i want that it should not repeat after 3 words
@slate swan
split the content , and send first 3 words
no i want bot should say only first 3 words
dont mind me just bringing replit to its knees
thats what im saying
Thats what hes telling you to do
give an example pls i am new
I'm not trying to be rude or anything but nobody really cares
!e py msg = 'word1 word2 word3 word4' print(msg.split()[0:2])
second
rookie numbers, once when I decompiled the source code of GTA San Andreas the output file was over half a million characters
@slate swan pls improve this statement
@client.command(case_insensitive=True)
async def say(ctx,*,text):
await ctx.send(text)
split the text variable , i cant codefeed
Hes not going to spoonfeed
i managed to fill an entire replit server in under 4 minutes
also
spoonfeed?
He gave you an example, you have to implement it
i am new so i don't know anything about python i swear
Hmmm, it's not working for me
Stop pinging me
@slate swan Can you help me with my issue \w cogs?
no, i'm taking a bath
bro result is showing in [] these brackets with ''
rip
!join
Joining Iterables
If you want to display a list (or some other iterable), you can write:
colors = ['red', 'green', 'blue', 'yellow']
output = ""
separator = ", "
for color in colors:
output += color + separator
print(output)
# Prints 'red, green, blue, yellow, '
However, the separator is still added to the last element, and it is relatively slow.
A better solution is to use str.join.
colors = ['red', 'green', 'blue', 'yellow']
separator = ", "
print(separator.join(colors))
# Prints 'red, green, blue, yellow'
An important thing to note is that you can only str.join strings. For a list of ints,
you must convert each element to a string before joining.
integers = [1, 3, 6, 10, 15]
print(", ".join(str(e) for e in integers))
# Prints '1, 3, 6, 10, 15'
ok idk what it is but i guess i might be successful ty
@slate swan Can you help me? I wanna know why I keep getting errors
pls tell the error and the code
Okeh
Code:
class Presets(commands.Cog):
async def check(self, member):
id = str(member.id)
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if id not in read:
read[id] = {"username": member, "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
class Economy(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def cog_check(self, ctx):
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(ctx.author.id) not in read:
read[str(ctx.author.id)] = {"username": str(ctx.author), "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
return True
@commands.command(aliases=["balance"])
async def bal(self, ctx, member:discord.Member=None):
if member==None:
member = ctx.author
presets = self.bot.get_cog('Presets')
if presets is not None:
await presets.check()
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(member.id) in read:
balance = read[str(member.id)]["iron"]
embed = discord.Embed(title=f"{member.name}'s Balance", description=f"{balance} Iron",color=ctx.author.color)
await ctx.reply(embed=embed)
else:
await ctx.reply(f"{member.mention} isn't part of my economy yet :(")
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/runner/ElderTree-Bot/Cogs/EconomyCog.py", line 40, in bal
await presets.check(member)
AttributeError: 'NoneType' object has no attribute 'check'
error^
@slate swan (sorry for pings btw)
presets is None
I wouldn't really recommend json as a db
Really?
Yeah
What else do you recommend?
SQL
Hmm
It can be learned in less than 3 days
you could just use a document type database
Lemme look
Implemented even faster
it's the same data structure as json but it has a proper database handler
it cannot be learned its commensense and just see the syntax in google which needed ๐
How is knowing SQL common sense?
. _.
MySQL?

I would recommend sqlite3 but I don't know anything about databases. Thats just what I use and what I was recommended
Okeh cool
๐
@final iron Btw, do you know how I can fix the error here?
Ez
o-O
Stack overflow GOD
IT DIDNT help but IT GIVES idea of every single discord.py project u can imagine
just search!
๐
That is literally what didn't help
. _.
IDC im GOOd
You're very confusing, cool.
nope
i just keep searching for that again and again if i didnt get!
yep
. _.
and my last but not the least option is
and why is that better than just asking?
suspense begins
not interested
@final iron (sorry for pings)
ill help ๐
O-o
wait lemee open in vs code for better support
give full code json whats that json
@dreamy sluice give line 40 code
Its saying Presets is None
ur code and ur line didnt match i cant find mistake
bro a freaking thanks to you \โค๏ธ
Why did you create a class that inherits from commands.Cog?
โค๏ธ โค๏ธ
yw
โค๏ธ
present is not none?
Why not just make the function in your economy class? If you want to keep your code clean, just put it in a different file and import it
@final ironthnx you too bro โค๏ธ โค๏ธ .... you both mde my night !!!
night 
Tried, but didn't work
Is there an error and send the code
Lemme rewrite that and send the error
one second
@final iron
Code in Cog file
class Economy(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def cog_check(self, ctx):
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(ctx.author.id) not in read:
read[str(ctx.author.id)] = {"username": str(ctx.author), "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
return True
@commands.command(aliases=["balance"])
async def bal(self, ctx, member:discord.Member=None):
if member==None:
member = ctx.author
#presets = self.bot.get_cog('Presets')
#if presets is not None:
#await presets.check()
ps.check(member)
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if str(member.id) in read:
balance = read[str(member.id)]["iron"]
embed = discord.Embed(title=f"{member.name}'s Balance", description=f"{balance} Iron",color=ctx.author.color)
await ctx.reply(embed=embed)
else:
await ctx.reply(f"{member.mention} isn't part of my economy yet :(")
Code in Presets.py
import json
def check(self, member):
id = str(member.id)
f = open("stats.json", 'r')
read = json.load(f)
f.close()
if id not in read:
read[id] = {"username": member, "iron": 0}
r = open("stats.json", 'w')
json.dump(read, r, indent=1)
r.close()
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 "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 979, in on_message
await self.process_commands(message)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 976, in process_commands
await self.invoke(ctx)
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 855, in invoke
await self.prepare(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 777, in prepare
if not await self.can_run(ctx):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1078, in can_run
ret = await discord.utils.maybe_coroutine(local_check, ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/utils.py", line 343, in maybe_coroutine
return await value
File "/home/runner/ElderTree-Bot/Cogs/EconomyCog.py", line 27, in cog_check
read = json.load(f)
File "/usr/lib/python3.8/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 17 column 3 (char 329)
Imma use pastebin from next time onwards
Okeh
As the error clearly says, your JSON file at line 17 column 3 is invalid.
oop-
@slate swan new error https://www.toptal.com/developers/hastebin/ecolipuhes.sql
I don't think you could do that with timeout
You will have to assign them a role with the restricted permissions
And of course add the appropriate checks
For adding a role?
!d discord.Member.add_roles
await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s.
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 added [`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.
You can add the role then remove it
Or add the role and delete it
Give a better explanation of what you mean then
so how can i make it so when someone clicks a button, the message the button is attatched to gets deleted?
PLEASE PING WHEN TALKING TO ME
hi
well technically muting is temperary ยฏ_(ใ)_/ยฏ
Do you still have this error?
well dw u'll get unmuted
Nah, I ended up fixing it
don't use either
use the pydis pasting service
!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.
O.o
Ok, sounds good!
What are you trying to build?
Hey, I can if you want. What do you have so far?
If you want I can give you what I built later today. If you can wait 3 hours or so I will give you the one I made
?
I have a bot that has member commands, modmail, music, staff commands, and giveaways commands if you want it.
Itโs one of my older bots, the code is simple but it works fine
Ok, if you need help with anything else feel free to ping me ๐
Hi
Hi
so how can i make it so when someone clicks a button, the message the button is attatched to gets deleted?
you're trying to reference the discord.py docs
eh is it only in disnake
well the root symbol doesn't exist but
you can reference the disnake docs like that
in disnake for assets in activity, do we have to provide url for large/small image? I don't know what does this ID in docs mean
im talking about the on_button_click event
I know, i'm just telling you you need to preface it with disnake
!d disnake.on_button_click
disnake.on_button_click(interaction)```
Called when a button is clicked.
Warning
Consider using the callbacks associated with the [`View`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.View "disnake.ui.View") instead.
New in version 2.0.
see?
but im not sure if they are using disnake , was not sure if discord's master branch has that too
library?
discord.py doesn't have button support and never will
!d discord.ui.Button master already has it
class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.
New in version 2.0.
pycord and/or discord.py (stuff from both seem to work)
do anyone know, what is that ID?
welp
hellllo?
is there an event for message removal? like py @bot.event async def on_message_remove(message): #do stuff
on_message_delete
alr
what arguments does it pass?
does it pass a message object?
obviously
alr
you spelt message wrong
It's just not documented
!d discord.on_message_delete
discord.on_message_delete(message)```
Called when a message is deleted. If the message is not found in the internal message cache, then this event will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.
If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_message_delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_delete "discord.on_raw_message_delete") event instead.
This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.
no, the !d command should have full coverage
Hi
@frank tartan https://github.com/Pycord-Development/pycord/blob/master/examples/views/button_roles.py refer to this
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API - pycord/button_roles.py at master ยท Pycord-Development/pycord
i did... i didnt see anything about what i was asking though
https://github.com/Pycord-Development/pycord/blob/master/examples/views/button_roles.py#L29
The callback function gets called when a button is clicked
examples/views/button_roles.py line 29
async def callback(self, interaction: discord.Interaction):```
ik...
i just dont know how to delete the message..
Interaction.message.delete() must be the thing but I'll double check it
interaction : discord.Interaction
message = await interaction.original_message()
# delete the message
The message that sent this interaction.
Yea this returns the msg
Yea but isn't MessageInteraction different from Interaction
!d discord.Interaction.message
The message that sent this interaction.
ow that should work too
await delete_original_message(*, delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the original interaction response message.
This is a lower level interface to [`InteractionMessage.delete()`](https://docs.disnake.dev/en/latest/api.html#disnake.InteractionMessage.delete "disnake.InteractionMessage.delete") in case you do not want to fetch the message and save an HTTP request.
Disnake's methods are always handy lol
class discord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
O gotcha
!d discord.Interaction.guild_id imagine not returning the Guild instead ๐
The guild ID the interaction was sent from.