#discord-bots
1 messages · Page 592 of 1
Hello!
Got a lil' Problem with a Bot I'm making. For whatever reason the Code I'm running locally isn't running the latest version of the code.
Like, I straight up deleted multiple lines of code, yet it still runs them, even on a seperate machine that never saw that code before.
Any help-?
Try resetting your token once
???
Already reset it multiple times. Even made a new application and that didn't work.
Tf
Yeah. Reason I'm extremely confused as well.
On my PC, for testing.
You running the code somewhere else too?
Nope.
You are in one weird position
async def on_member_join(member, ctx):
guild = client.get_guild(730651046459998218)
channel = guild.get_channel(885464532959526913)
myEmbed = discord.Embed(title = f"Welcome",
description= f"You are member {guild.member_count}, \n Enjoy your stay here and dont forget to read the await #rules", color=0x0ff00)
myEmbed.set_image(url=f"{member.avatar_url}")
await channel.send(embed=myEmbed)
autorole = discord.utils.get(member.guild.roles, name='Unverified')
roles = discord.utils.get(ctx.guild.roles,name= "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•")
roles = discord.utils.get(ctx.guild.roles,name= "•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•")
What
!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.
@south pewter uhhhhh
sorry i am just sending my code and then my error
on_member_join only takes 2 params
Traceback (most recent call last):
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "c:\Users\thoma\Desktop\discord.py\bot.py", line 65, in on_member_join
json.dump(users, f, intent=4)
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 173, in dump
iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
TypeError: JSONEncoder.__init__() got an unexpected keyword argument 'intent'```
U sure u running the correct files?
yes
1 iirc
250% sure.
I mean one
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Weirdddd
I mean, u have even tried to reset the damn token
@client.event
async def on_member_join(member, ctx):
guild = client.get_guild(730651046459998218)
channel = guild.get_channel(885464532959526913)
myEmbed = discord.Embed(title = f"Welcome",
description= f"You are member {guild.member_count}, \n Enjoy your stay here and dont forget to read the await [#904279966693355550](/guild/267624335836053506/channel/904279966693355550/)", color=0x0ff00)
myEmbed.set_image(url=f"{member.avatar_url}")
await channel.send(embed=myEmbed)
autorole = discord.utils.get(member.guild.roles, name='Unverified')
roles = discord.utils.get(ctx.guild.roles,name= "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•")
roles = discord.utils.get(ctx.guild.roles,name= "•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•")
Ignoring exception in on_member_join
Traceback (most recent call last):
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "c:\Users\thoma\Desktop\discord.py\bot.py", line 65, in on_member_join
json.dump(users, f, intent=4)
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 173, in dump
iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
TypeError: JSONEncoder.__init__() got an unexpected keyword argument 'intent'
Nice role name
its a dating server thats why
I even made a new py file entirely. No changes.
Use the id
Reinstalled Python too.
Against tos
This is way too far haha
Dating servers are against discord's tos
I mean. Do you have any other ideas?
wdym ive seen a lot of dating servers and theyre still alive
with their own discord bot
Well u told me all the damn possibilities. The only thing I can think of, nowadays, is that you are running the older code by mistake, but since u said u have tried in a new machine also, soooo...... idrk
still against tos ¯_(ツ)_/¯
Do you know... Even modding servers also have their discord bots. This doesn't mean that they are not against ToS
Having a discord bot doesn't tell that if a server is against ToS or not, since discord doesn't have access to the underlying code
true but yet its still is a dating server
Ah welp. Thanks for the help anyways. Have a nice day!
nvm
You too! I'mma think about it and if I get any ideas, I'mma DM you. Is that alright with ya?
Sure!
Discord bots are again a bit fun when I got it to server to test some features
Is it possible to mix discord bot with speech recognition and pytts3
Nope, since dpy won't have Voice Receive
But if u mean to use message content for that then sure
huh
hii
👋
is that some discord limitation , or dpy did not include it?
I dont think discord even has voice receiving support?
mee6 can record voice in vcs..
how does the bot do that then?
i mean
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
doesn't say anything about receiving voice
Can someone tell me how lavalink works??
It's a non documented feature in API Docs, and did u forget what happened to dpy?
oh i see , yeah ofcourse ik discord.py is no longer continued but the feature has been in the API for a long time right?
i see , thanks
Does disnake have it?
Hmm
Hello, can someone please tell me how to get a list of all membersids that reacted to a message? (discord.py)
!d discord.Message.reactions
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
U gotta iterate
It gives me this [<Reaction emoji=':tada:' me=False count=1>], how to get the members from it
async for ... in users(*, limit=None, after=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/master/api.html#discord.AsyncIterator "discord.AsyncIterator") representing the users that have reacted to the message.
The `after` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.
Examples
Usage
```py
# I do not actually recommend doing this.
async for user in reaction.users():
await channel.send(f'{user} has reacted with {reaction.emoji}!')
```...
I tried reaction.users() and it gave me this: <discord.iterators.ReactionIterator object at 0x7f2eb53589a0>
That says that he doesn't recommend it
Should I do this? ```py
for reaction in message.reactions:
users.append(await reaction.users().flatten())
you cannot get users for a reaction without awaiting xd
they are same either way
uh
but this worked
shouldn't i use that then?
both are same
what are the same
async for user in reaction.users()
is same as py await reaction.users().flatten()
Link to the repo please
!pypi nextcord
A Python wrapper for the Discord API forked from discord.py
Well the official nextcord doesn't support it yet
It's a fork which supports it ig
So I am asking for the fork's git repo
wdym official nextcord? is there another nextcord?
I meant a fork of nextcord
nextcord-ext?
Tysm but how to use it -,-
Idk bout the fork
Use what
Voice recording what else
It'd be great if you can link the documentation about this shit
Well, it's still a PR?
Well is there any other repo which supports it too?
Now why would a PR have a documentation? Just click the github link I sent?
Mam I meant like how tf are you supposed to use it
Why would you need a documentation on how to use things?
How are you supposed to use it then
😑
Any code examples or anything like that
it's still in review
Didn't see that
@boreal ravine
Maybe because you didn't click the link I sent.
Any other ready to use repository?
Don't know.
use on_message event , and check if the bot is mentioned in the message
!d discord.User.mentioned_in
mentioned_in(message)```
Checks if the user is mentioned in the specified message.
hey could someone show me an example of a on_reaction_add and on_reaction_remove event
because im having issues trying to get my bot to send a message when someone has reacted to any message
hey, quick question
can we click a button using request, like we can send msgs using authentication ?
will anyone help me
@bot.listen()
async def on_reaction_add/remove(reaction , user):
# reaction is a discord.Reaction object
# user is discord.User object```
ye but how do you send a message in an event
can you still use ctx
wait lemme try that
ctx.channel.send
meh just trying to learn the on_reaction_add/remove event because rn im tryna see if the bot will send a message when someone reacts to a message
just use py reaction.message.channel to get the channel
mentioned_in(message)```
Checks if the user is mentioned in the specified message.
client.user.mentioned_in
also , it works even if someone pings everyone so take care about it
@bot.event
async def on_reaction_remove(ctx, reaction, user):
channel = reaction.message.channel
await ctx.channel_send(channel, '{} has reacted with {} to the message content of: {}'.format(user.name, reaction.emoji, reaction.message.content))```
me trying to figure out something be like
how do i print user's name
oh lol
wait i alr have a channel = reaction.message.channel variable wtf
a better way to do that is py if bot.user in message.mentions
Guys, how do I delete a command used by a member like if they write !add rolename it should only delete that message and not some other message
if its a command , Context.message.delete() would work
meh just do await ctx.send(f"{ctx.author} test") and your good
thanxxx
you cannot have ctx inside the event
alright
oh lmao
then how do i send a message
😔
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**.
how can i make it HydroRICO_1209 instead of HydroRICO_1209#8868
do {ctx.author.mention} so that it mentions the person
i dont wanna to ping tho
just catto dont understand python
ctx.author.name if they are sending the message
idk how :c
but mentioning def removes the tag
btw sarthak i got an error @slate swan
await channel.send(channel, '{} has reacted with {} to the message content of: {}'.format(user.name, reaction.emoji, reaction.message.content))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord_components/client.py", line 48, in send_component_msg_prop
return await self.send_component_msg(ctxorchannel, *args, **kwargs)
TypeError: send_component_msg() takes from 2 to 3 positional arguments but 4 were given
ik its the reaction.crap and stuff but how do you get the information about the message then 🥺
thanks
no prob
you dont include channel inside it
read the embed that bot sent above , your code is outdated
thats not related to class anyways
.....?
and you dont use anything in python without classes xd
Bro Spooshed, why do u think your code is related to classes tho 😐
(This wasn't for u, Sarthak)
not saying it is lol
ik ¯_(ツ)_/¯
.....
i dont use classes when making a discord.py bot just saying all crap and formatting is different when you do
just to make things and examples clear i said it? no tantrum over this alr?
channel.send('content')``` this is what the embed says
what makes it related to classes
nah dawg dont throw a tantrum over this im just saying
oh , do you mean cogs by class?
i dont use cogs or classes :c i dont want alt versions of my bot running
cogs aint meant to run different versions of your bot
it can be used to load different languages which is kinda cool :P
no?
i mean if you make the cog file translated lmao
!d discord.ext.commands.Cog
class discord.ext.commands.Cog(*args, **kwargs)```
The base class that all cogs must inherit from.
A cog is a collection of commands, listeners, and optional state to help group commands together. More information on them can be found on the [Cogs](https://discordpy.readthedocs.io/en/master/ext/commands/cogs.html#ext-commands-cogs) page.
When inheriting from this class, the options shown in [`CogMeta`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CogMeta "discord.ext.commands.CogMeta") are equally valid here.
it would always be pythonic
i did try running cogs
apparently it always runned the cog first lmao and i didnt pay attention to the os path which was mentioning the file not the folder itself lmao
depends on how you designed your code
if it loads the cogs before starting the bot , it will do the same
if you do that in some on_ready event or something it happens after the bot runs
i originally thought loading extensions through cogs wasn't possible since it's already in an extension
i feel like now there's seperate sides of people who use on_ready events and people who don't use em
gtg now cya
what the f
i just do py [perm[0] for perm in member.guild_permissions if perm[1]]
i mean , who makes a list of all the permissions
Whats the difference?
Nothing on the front end
Oh bruh
But does things on the backend
dont think so , works decently for me
How were you running code on your server?
an eval command
or just use jishaku
Jishaku
Oh
!pypi jishaku
A discord.py extension including useful tools for bot development and debugging.
Wtf... Can u print perm once?
the perm variable in the list ?
they are tuples ('perm name' , True/False) like this
wait imma show
Command throws error for user id type argument
[1] is a bool right?
Yea
in the last part , yes
[1] is the index of the perm tuple which is a bool
???
Tf?
wut
Breh, dpy confuses me sometimes
send it
@patent surge
Forgot it's implementing the dunder methods for looping so that it loops through dict.items()
its just returning the object , try ctx.send()
same output
Ok let me see
My eval is implementing print, so it also converts to string haha
looks like you need to iterate anyways
^^^
how to get command signature for the commands in a cog (discord.ext.commands.HelpCommand)?
!d discord.Guild.leave
await leave()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Leaves the guild.
Note
You cannot leave the guild that you own, you must delete it instead via [`delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.delete "discord.Guild.delete").
!d discord.ext.commands.Command.signature
property signature: str```
Returns a POSIX-like signature useful for help command output.
Thx
yes.. but how to do in async def send_cog_help(self, cog): ?
cog.get_commands.get_command_signature?
!d discord.ext.commands.Cog.commands
get_all_commands is a function
!d discord.ext.commands.Cog.get_commands
get_commands()```
so like this?
oh wait its get_commands
How do i get epochtime?
!d time.time
time.time() → float```
Return the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch) as a floating point number. The specific date of the epoch and the handling of [leap seconds](https://en.wikipedia.org/wiki/Leap_second) is platform dependent. On Windows and most Unix systems, the epoch is January 1, 1970, 00:00:00 (UTC) and leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as [Unix time](https://en.wikipedia.org/wiki/Unix_time). To find out what the epoch is on a given platform, look at `gmtime(0)`.
Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
No
Sure
show ppls
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
youtube_dl?
That's used to make a discord music bot (:
@command.error
async def on_message_error(ctx, error):
if isinstance(error, discord.ext.commands.errors.CommandNotFound):
await ctx.send("Unknown command")```
how do i fix this
i tried it but it take lot of times to download video and after downloadinng music not playing
im not sure what to put at the @
U need to use the global handler
Read the embed 🤦
try with @quaint axle.event
Delete it please
why
?
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
@ornate lichen can you dm link pls
help pls
Add the client.event deco and change the function name to on_command_error
And move that thing to the main.py file with other events
thanks
why client 😕
nah, I quitted the dev team
Ignoring exception in on_raw_message_edit
Traceback (most recent call last):
File "/home/Mechanic/.local/lib/python3.10/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/Mechanic/cogs/logs.py", line 141, in on_raw_message_edit
if payload.cached_message.attachments:
AttributeError: 'NoneType' object has no attribute 'attachments'```
i have a msg which updates every 10 seconds and has an image
its giving this error
only some text part of that embed msg gets updated
cached_message somehow returns None
Use a variable for the client. The value will be restarted if the client is restarted
is there a way to avoid this? maybe a check?
bot.get_member(id)
bot.fetch_member(id)
guys i have a problem i found an issue i do not know what it wants from me
@bot.command()
async def commandBro(ctx):
var = var + 1
await ctx.send(c"U used this {var} times")
u have to use a db and save everytime the user invokes a cmd in that and get it from there
enable the intent from your bot appplication
Why tho
Cz they are using that 😐
This also works in an @client.event , too. Just replace await ctx.send() to await message.channel.send()!
yeah whats the application thingy
the um check mark which one?
discord application? frm where u get the bot?
yeah ik that but what is the intent idk where to find it withing the thingy idk how to enable it
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
how
very cute
where
I kinda don't like how they implement things
funny af
but usefu;
whats a emoji which relates to tictactoe
Ive been trying to mame a command to leave a guild but im not even close anybody know how?
Above lol
Ah okay cool.
I dont see any use of client on their code
Im a bad coder
as long as you follow the codestyle I will fix all the bugs you make icy
I will clean up for you 
Lmao
not sure what to add / fix..
How do i get the traceback for the errors in a channel?
I need documenters and people who will attach HTTP methods to objects
oh zamn you use asyncio but idk how to help
time.sleep also works i think
about what, asyncio?, embeds? copy paste or screenshot the error here
I'm trying to install the default discord.py package through my env, although it somehow doesn't download it? Did they take their pip install down?
... you forgot about await did you do it
oh wait
lemme see the code again
wait a second
yea they mentioned the error 7 times
lmao
np
idk if it works never used asyncio.sleep i always used time.sleep
use pip3
do pip3 install discord.py i forgor how u install it actually
I did that xD
does it work?
not really
they didnt take discord.py down
i use vsc 😔
File "C:\Python39\lib\site-packages\discord\ext\commands\bot.py", line 606, in _load_from_module_spec
spec.loader.exec_module(lib)
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "c:\Users\rrfda\OneDrive\Desktop\sublime\commands\mod_commands.py", line 8, in <module>
from main import prefix
File "c:\Users\rrfda\OneDrive\Desktop\sublime\main.py", line 38, in <module>
bot.load_extension(f'commands.{filename[:-3]}')
bot.load_extension(f'commands.{filename[:-3]}')
File "C:\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Python39\lib\site-packages\discord\ext\commands\bot.py", line 608, in _load_from_module_spec
del sys.modules[key]
KeyError: 'commands.mod_commands'
how is it?
awesome, got a bunch of extensions and stuff installed
and i got a bot with 350 lines of code
still doesnt seem that much to me lmao
kk
@slate swan works?
Wait is it even possible to make your bot leave a guild with its id?i think not
thats stupid lmao
Not really
k send me dm server thing
Ah I see imma try to create a condo environment in this case
that sounds sus 😳
your bot does typing? why :troll:
idk
it looks cool but just hwy
You leaked your API key

the rasberry pi foundation
Do you know how to connect python script to rassbery @languid river
With linux windows 11 subsystem
use linux
How would I go about this without using classes:
class Foo:
# init
self.queues = defaultdict(list)
# command queue
self.queues[ctx.channel_id].append(ctx.author.id)
if len(self.queues[ctx.channel.id]) == 6:
...```
are you asking how to ssh or something?
Ys
Yes
@bot.event
async def on_ready():
role = discord.utils.get(ctx.guild.roles, name="rainbow")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(5)
except:
break
Help me plz, I don't understand why ctx doesn't work
I want to make sure that when the bot is turned on, the role changes color
That's interesting, I never knew asyncio has a sleep() method. I ended up using threading.Timer()
usually ctx stores info on where the command was triggered, whom it was triggered by etc.
okay x)
It's passed as a parameter e.g. ```python
@bot.command()
async def ping(ctx):
author_id = ctx.message.author.id
await ctx.channel.send(f"pong <@{author_id}>")
Power shell works, or Windows Terminal. Never tried cmd prompt
My guess is it shouldn't work because there is no context unless you try to pass in a ctx argument
Ok and i need to connect to my pc or something
Like that
Is my first time but i didnt buycit yet
yeah you connect to the host with ip and port
So can you help me?
Will the rassbery pi have ip port
ctx.author.mention …
For example, I'm not sure about on_ready() event handler, but I have ctx implemented in on_command_error()
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.channel.send("***Invalid Command*** Use !help to show list of commands")
just use {author.mention}
try putting ctx as a parameter to the function
Noted, ty
😄
how ? :x
async def on_ready(ctx):
@bot.event
async def on_ready(ctx):
role = discord.utils.get(ctx.guild.roles, name="rainbow")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(5)
except:
break
yep
on ready takes no parameters
yes, use that dont listen to me lol
I haven't used the get method at all with my bot
it is related to an instance
How to do it then?
get the guild then get the role
I have a bot but im scared that someone will add it to his server and just spam my bots commands how can i avoid this or does discord rate limit the user?if not how do i make all commands ignore a guild?
is the bot public?
Wdym public like a public bot?
yes
Iirc yes
How do you do that?!
you can make a decorator or global check that sees if command was run in x guild or you can also put cooldown to commands
Idk how to do the first option never done it before but the 2 im trying to avoid because i want the commands only to be on cooldown in that certain guild
erm not sure how to limit a certain guild
Damn thats the tricky part ive been trying to solve
I have logs of what guilds uses the commands so i know what guild uses the command and i get their id but idk how i could remove the bot if someone made a server just too spam commands
Nvm my badddd
can anyone help me to make my discord bot use dropbox api and send files as an output when requested?
Maybe if you show the code you have and ask about a specific issue you are having; someone might help.
Why not just make it private? It sounds like you don’t want other people using it.
Not quite
I just want my bot to have the best performance it can have without trolls
So you are wanting a way to blacklist guilds from using it?
Limit is a better word
I don’t understand what you want. So you want a whitelist? So you have to approve people before they can use it?
Hi people, I have been working on my discord bot for over 2 months. Yesterday I was trying to run it but it raises an SSL error. I have already verified my certificates and they are all valid.
If anyone can help me I would be grateful.
This is the error:
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]
I just want when i see a bots command get spammed in the same guild i can easily remove it or limit it from that guild
@bot.event
async def on_ready():
guild = 905639743402967110
role = discord.utils.get(guild.roles, name="admin")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(5)
except:
break
error:
File "D:\gg$\Bot py\GROS PROJET\bot.py", line 41, in on_ready
role = discord.utils.get(guild.roles, name=908373553555079179)
AttributeError: 'int' object has no attribute 'roles'
help me :x
I have logs of what guilds uses the commands so i know what guild uses the command and i get their id but idk how i could remove the bot if someone made a server just too spam commands
It sounds like you already do that
You need to use get_guild
!d discord.ext.commands.Bot.get_guild
get_guild(id, /)```
Returns a guild with the given ID.
You can't just assign it to an integer and consider it as a Guild object
Hello everyone btw 
I dont limit them at all i just overview the logs
Hello


@slate swan how did you get the badge ? :x
¯\_(ツ)_/¯
please answer me I'm trying to get it :x
You can't get it anymore
how do I put an error message for this error py An unexpected error has occured! The error: Command raised an exception: NotFound: 404 Not Found (error code: 0): Interaction is unknown (you have already responded to the interaction or responding took too long)
Like Error: Interaction was responded or took too long
If you just do bots for a few pixels on a profile, then you can already stop doing them
kek
I know, but why can't we have it anymore
Because of people like you 
You did not😭
It ended up spamming the verification queue with random bots to get the badge
The queue got filled with botted bots
rip
People created a bot, made it online, invited to random servers and applied for the pixels
I don't do that
Still, if your only motivation are pixels on a profile then you can stop making bots
i can't run my bot because of this can anyone help me?
This is the error:
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]
Cough cough did you got it legitly
I create bots for my own amusement
My bot was in over 750 servers when the badge got introduced
gg
I create bots for experience and for my future job
Ok mr popular
Zzz
😭
Then stopped coding it and made it offline, dropped at ~350 servers

What was the name of your bot?
'Wumpus'
Discord decided to not let me use that name
So I gave up
And now I don't do bots anymore


Ive been outsmarted
:)
Bots are just boring at some point
Moved on to bigger projects
What do you do know?
hmmm
Shouldn't talk about it to be honest


A integer is a whole number and a float is a decimal correct?
I keep confusing them
Yup
Thanks😮💨
😪
Wait nvm
Remember now
Its what ever can be a var or sm like that

?
It's a custom data type basically
Idk 😔
Which can contain different information
Oh
I see
!d discord.Guild
class discord.Guild```
Represents a Discord guild.
This is referred to as a “server” in the official Discord UI.
x == y Checks if two guilds are equal.
x != y Checks if two guilds are not equal.
hash(x) Returns the guild’s hash.
str(x) Returns the guild’s name.
Ohhhh i get it now thx
Context is not really a thing, at least never heard of it
Mm
The ctx thingy on discord.py is an object
Oh
But it means context but its a object?
!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.
Also an object containing different information
Ohhhh i get it now
And this object returns in what context the command has been executed. So by who, where, what, etc.
Im bad at my terminology but meh at python so thank you bro

So how to use get_guild in my code
@bot.event
async def on_ready():
guild = 905639743402967110
role = discord.utils.get(guild.roles, name="admin")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(5)
except:
break```
Plus I'm French so it doesn't make it any easier \:)
get_guild(id) is a method you can use on your bot variable
So instead of doing guild = <id> you need to use the method
ho ok
Oh yeah and just as side note
Rainbow roles will get your bot banned
For api abuse & spam
They're not allowed
How do i make a bot leave a guild ive tried await leave
and stuff related to it but nothing im trying to leave a specific guild with its id do you know about it @slate swan sorry for the ping btw
I know, don't worry
It's just for me
Pretty sure it's simply await guild.leave()
!d discord.Guild.leave
await leave()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Leaves the guild.
Note
You cannot leave the guild that you own, you must delete it instead via [`delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.delete "discord.Guild.delete").
Yeah
Tried it but it just leaves the guild where the command got executed at and not a specific one eith its id
Well you need to get the guild object from its id
Same for you
I tried😔
Well share your code :)
Got frustrated and deleted it......
Patience is the key of success :p
@bot.event
async def get_guild(id=905639743402967110):
role = discord.utils.get(guild.roles, name="admin")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(5)
except:
break
So I do like this?
Nono, it was correct before, just don't do
guild = <the_id>
instead do
guild = bot.get_guild(<the_id>)
Sorry I'm not good at it
All good :)
I love the emails I get...
Explain?
Hey man is there a way to know who has been hacking my stuff do they leave a mark behind, can there phone be back traced to there current location? Any help would be great!

Yes some people leave tails or prints behind
Not the point tho😭
Yeah I know, but why do they ask that to me 
Cuz of your about me ofc
Maybe need to change it then
No emails anymore
Easy

x)
Fits you ngl
Will be right back, got to finish my todo list of today ^^
Thats cool your organized unlike me
Will be right back, got to finish my todo list of today ^^
@slate swan
How can I make the rainbow work on all the servers where the bot is?
Hi Guyz
Couldn't interact ig🤷♂️
Dont know but im familiar with the error
now you think ?
Not familiar with buttons 🤷♂️
how >
?
@slate swan How can I make the rainbow work on all the servers where the bot is?
Elaborate "rainbow"
🙄
@bot.event
async def on_ready():
await bot.change_presence(activity=discord.Streaming(name="EN DEVELLOPEMENT", url="https://www.twitch.tv/Inferzel"))
print("Pret")
guild = bot.get_guild(905639743402967110)
role = discord.utils.get(guild.roles, name="rainbow")
while True:
try:
await role.edit(role=role, colour=RandomColor())
await asyncio.sleep(2)
except:
break
I just want it to interact with the other servers
Your gonna get ratelimited
And if its in all servers even more
I know it but it's not for me
This is for all my servers
Your still gonna get rate limited
You might even get flagged by the api as a spammer and your api key could get limited or banned🤷♂️
Idk
It doesn't matter, it's just for 5 servers of mine
Doesn't change anything
you will still get rate limited
Making a single rainbow role already gets you rate limited
^
So I guess you can imagine what happens when you do it 5 times more
Any repetive action will get rate limited
Not all but most
Ok, I get it
Not really any repetitive action, any action that is being repetitive within a small timespan
Better description
Changing the role color every day for example won't get you rate limited
Every hour i think wont get you rate limited
ok
There's a rate limit section on the documentation you can take a look at
Yeah
It is true you are right
For roles it's 1000 requests per 24 hours
how do i make embed images smaller or bigger?
So ~41 per hour
big brain
don't do shit in on_ready
Yeah this too, should create a task loop instead
is it possible?
Nope
this is my code to leave guilds and yes its horrible
@bot.command()
async def leave(ctx,arg):
for guild in bot.guilds:
if guild.name == arg:
t = guild.id
bot.get_guild(t)
await guild.leave()
else:
await ctx.send("guild not found")
it just says guild not found
can i atleast put them on side?
I mean, it depends on the size of the image of course
No
instead of down
Only bottom or top right (thumbnail)
how do i make thumbnail??
Well here you don't need to use get_guild
from a image link
The guild variable is already of type Guild
i see
So you can just use .leave() on it
!d discord.Embed.add_thumbnail
No documentation found for the requested symbol.
set_thumbnail(*, url)```
Sets the thumbnail for the embed content.
This function returns the class instance to allow for fluent-style chaining.
Changed in version 1.4: Passing [`Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty") removes the thumbnail.
Just give the URL as string parameter
add a param guild: discord.Guild ig not sure
good idea
Hey! I need your help guys. python @client.command(description="list") async def list(ctx : str): print((datetime.now().strftime('%H:%M:%S'))+" Someone used !List") BTC = cryptocompare.get_price("BTC", currency) BTC1 = str(BTC) print(BTC1) #gives me back {'BTC': {'USD': 64886.29}} so now how do I index this that it returns only the integer so i can use it for more things?
yes ig
this is how it looks rn
@bot.command()
async def leave(ctx,arg,guild:disnake.Guild):
for guild in bot.guilds:
if guild.name == arg:
t = guild.id
await guild.leave()
else:
await ctx.send("guild not found")
Personally
I would pass the guild id
When executing the command
And forget about the name check
is disnake a fork?
yeah Im allready searching. But it always just gives me back {'BTC': {'USD': 64886.29}}. So do any1 here know another api's or whatever for getting cryptoprices?
Like !leave <id>
yes
oh try it and see if it works
ok
Then you can just try arg.leave() and if it fails the guild probably doesn't exist
Would rename arg to guild though
ok
also ig no need of that param called arg?
And keep the type hint to disnake.Guild
alr
it left all the guilds now i think i forgot to add break:
@bot.command()
async def leave(ctx,guild:disnake.Guild):
for guild in bot.guilds:
try:
t = guild.id
await guild.leave()
except:
await ctx.send("guild not found")
No need to loop
Just .leave() and handle the exceptions
whats the variable for?
alr
And don't forget to restrict it to only you 
You don't want people to make it leave guilds
yes ik
im going to make a check for it
All right 
this is how it looks rn it just says guild not found
@bot.command()
async def leave(ctx,guild:disnake.Guild):
if ctx.author.id == 637458038915203127:
try:
await leave()
except:
await ctx.send("guild not found")
else:
await ctx.send(f"{ctx.author.mention}You do not have permissions for this command")
Need to leep it as guild.leave() though
I have a list with called money = [Card1, Card2, Card3]. How can I make a loop which sets them to a random number? I already have this: python Card1 = 0 Card2 = 0 Card3 = 0 money = [Card1, Card2, Card3] i = 0 while i < len(money): money[i] = random.randint(1, 500) i = i+1 print(money[0], money[1], money[2])yeah something isn't working I know. And I'm unsure if I really should set these Cards before i add them to a List. I'm not that good in python sry
oh yeah its a guild object
Yup
thank you for showing me about the objects btw
The i = i+1 should be included in the while loop
I'm dumb ty
And you can change to i += 1, does the same and it's sorter/more understandable
@slate swan it worked thank you so much bro your the man


can anyone link me a hexadecimal color picker so i can freaking put a custom color in an embed
wait how do you put a custom color in an embed
Hi! I need your help! I have this code:
# Biblioteka
import nextcord as discord
import datetime
import config
from nextcord.ext import commands
from nextcord import Embed
from nextcord.ext import tasks
# Kod
class Taskloop(commands.Cog):
def __init__(self, client):
self.client = client
self.test.start()
@tasks.loop(seconds = 5.0)
async def test(self, ctx):
kanal = self.client.get_channel(908367227860942848)
server = ctx.message.guild
channels = len(server.channels)
embed = discord.Embed(title = f"{config.name} | Statystyki", description = "asd", url = config.url, timestamp = datetime.datetime.utcnow(), color = 0x00aff4)
embed.add_field(name = "Właściciel serwera:", value = f"{ctx.guild.owner}", inline = False)
embed.add_field(name = "ID serwera:", value = f"{ctx.guild.id}", inline = False)
embed.add_field(name = "Region serwera:", value = f"{ctx.guild.region}", inline = False)
embed.add_field(name = "Serwer stworzony:", value = f"{ctx.guild.created_at}", inline = False)
embed.add_field(name = "Ilość użytkowników:", value = server.member_count, inline = False)
embed.add_field(name = "Ilość kanałów tekstowych/głosowych:", value = f"{channels}", inline = False)
embed.set_footer(text = f"© 2021 CS-owo.pl • {ctx.author.name}#{ctx.author.discriminator}")
await kanal.send(embed = embed)
def setup(client):
client.add_cog(Taskloop(client))
Errors:
Unhandled exception in internal background task 'test'.
Traceback (most recent call last):
File "C:\Users\fixed\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nextcord\ext\tasks\__init__.py", line 168, in _loop
await self.coro(*args, **kwargs)
TypeError: test() missing 1 required positional argument: 'ctx'
Do you know what's going on? : /
wat does line 168 hav
tasks dont take paramaters
You must have called test() look without passing ctx so test(ctx)
hey how do you get a custom color for an embed
Oh
i can't run my bot because of this can anyone help me?
This is the error:
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]
ye where to find those color codes link me a website
Search colour hex on the internet
Like blue colour hex
Ah, iOS?
Will you change it in my code? Because I do not get it a bit, but I get tired of it 1h xD
Check pins
He literally did it
all it gives me is #00ff00 like that stuff
not the hexadecimal code which is compatible
Remove the hash
can you just link me a website
0x00ff00
oh
how to get hexadecimal code goes like this?
get hexadecimal and then remove hash and add a 0x before the numbers and letters right
yeah
macOS but yes I was coding on replit and I decided to use VSC again but when a try to run the program it rises this i check the SSL certificates and it's all good with that.
Oh, okay, I get it
grammer
grammar* ⚔️
!d discord.Color.value this?
lol
!d discord.Colour.value
The raw integer colour value.
colour
But when I remove ctx, I get this error:
Unhandled exception in internal background task 'test'.
Traceback (most recent call last):
File "C:\Users\fixed\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nextcord\ext\tasks\__init__.py", line 168, in _loop
await self.coro(*args, **kwargs)
File "J:\DISCORD\xBOT\komendy\stats\stats.py", line 19, in test
server = ctx.message.guild
NameError: name 'ctx' is not defined
That's something else.. send the code
second time today I've forgetten Colour isnt another alias for the Color class
lol
oop
i got the hexadecimal code working thanks for teaching me how to get a hexadecimal code lmao!
nah seriously it works
my steps were true lmfao
# Biblioteka
import nextcord as discord
import datetime
import config
from nextcord.ext import commands
from nextcord import Embed
from nextcord.ext import tasks
# Kod
class Taskloop(commands.Cog):
def __init__(self, client):
self.client = client
self.test.start()
@tasks.loop(seconds = 5.0)
async def test(self):
kanal = self.client.get_channel(908367227860942848)
server = ctx.message.guild
channels = len(server.channels)
embed = discord.Embed(title = f"{config.name} | Statystyki", description = "asd", url = config.url, timestamp = datetime.datetime.utcnow(), color = 0x00aff4)
embed.add_field(name = "Właściciel serwera:", value = f"{ctx.guild.owner}", inline = False)
embed.add_field(name = "ID serwera:", value = f"{ctx.guild.id}", inline = False)
embed.add_field(name = "Region serwera:", value = f"{ctx.guild.region}", inline = False)
embed.add_field(name = "Serwer stworzony:", value = f"{ctx.guild.created_at}", inline = False)
embed.add_field(name = "Ilość użytkowników:", value = server.member_count, inline = False)
embed.add_field(name = "Ilość kanałów tekstowych/głosowych:", value = f"{channels}", inline = False)
embed.set_footer(text = f"© 2021 CS-owo.pl • {ctx.author.name}#{ctx.author.discriminator}")
await kanal.send(embed = embed)
def setup(client):
client.add_cog(Taskloop(client))
async def test(self, ctx) maybe try this?
hm
Unhandled exception in internal background task 'test'.
Traceback (most recent call last):
File "C:\Users\fixed\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nextcord\ext\tasks\__init__.py", line 168, in _loop
await self.coro(*args, **kwargs)
TypeError: test() missing 1 required positional argument: 'ctx'
: /
maybe is the @commands.command?
call the function with ctx as an arg
@commands.command(name='yourcommand', aliases=['your aliases'])
async def _yourcommand(self, ctx: commands.Context):
try that
he isnt making a command
+1
get_guild(id, /)```
Returns a guild with the given ID.
that would make it so when they start their task they'd need to provide a ctx param
don't use ctx
you're inside a tasks.loop, what even is ctx, and why are you even expecting a message from it
get the guild from the bot's cache or fetch it instead
@commands.command()
async def kick(self, ctx, member: discord.Member = None, reason = None):
await noset(ctx)
db = sqlite3.connect("database.db")
cursor = db.cursor()
cursor.execute(f"SELECT language FROM language WHERE guild_id = {ctx.author.guild.id}")
wynik1 = cursor.fetchone()
if wynik1 == "ENG":
if member == None:
await ENGMemberembed(ctx)
return
elif reason == None:
reason = "Administrator didn't say reason"
await ENGkickembed(ctx, member, reason)
await member.kick(reason=reason)
elif wynik1 == "PL":
if member == None:
await PLMemberembed(ctx)
return
elif reason == None:
reason = "Administrator nie podał powodu"
await PLkickembed(ctx, member, reason)
await member.kick(reason=reason)
It stops at wynik1 = cursor.fetchone
we don't know what's in your db
and what is wynik1 and why is everyone using the same var name 
copied code lmao
nope
wynik = result in polish
and almost everyone in Poland uses it
and almost everyone that uses wynik uses sqlite3 and don't know what to do
.
so you are trying to translate the kick command? @slate swan
I try to make a choice of language in the bot
i'm creating a serverinfo command, it works everything except loading the server image.
For example when I call the command, it sends all the data and should also send the server image inside the embed, but it doesn't.
code:
async def serverinfo (ctx):
role_count = len (ctx.guild.roles)
icon = str (ctx.guild.icon_url)
serverinfoEmbed = discord.Embed (timestamp = ctx.message.created_at, color = ctx.author.color)
serverinfoEmbed.add_field (name = 'Name', value = f "{ctx.guild.name}", inline = False)
serverinfoEmbed.add_field (name = 'Total members', value = ctx.guild.member_count, inline = False)
serverinfoEmbed.add_field (name = 'Verification level (security)', value = str (ctx.guild.verification_level), inline = False)
serverinfoEmbed.add_field (name = 'Top role', value = ctx.guild.roles [-2], inline = False)
serverinfoEmbed.add_field (name = 'Total roles', value = str (role_count), inline = False)
serverinfoEmbed.set_thumbnail (url = icon)
await ctx.send (embed = serverinfoEmbed)```
Hey @slate swan!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
oh so you DB has the translation?
need some help
Hey @slate swan!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
let me help you
yay
icon = str(ctx.guild.icon_url)
embed.set_thumbnail(url=icon)
does the server you invoke the command from have an icon?
not just the letter
this should help @river kindle
I want to make a choice of Polish or English
that's literally what they did lol
yes
and it's not the default grey/white letter icon?
nope
that's odd, the code is perfect
uhmm
send me a pic of the embed
perhaps you're missing intents?
yeah, was probably just a server issue
uhmm, probably
discord.Reaction has a count attribute
poll.reactions is probably empty
your intents may be screwed up
is the poll message actually getting reactions?
perhaps it's the key messing with it
try to print poll.reactions to see what it outputs
also keep in mind the bot won't see your own reactions
yeah that's why
are there any free online courses for discord.py so i dont have to barely understand anything in the documentation?
the bot doesn't count its own reactions
Carberra tutorials on Youtube
ty
not really, the docs and github are the best place to learn
you should avoid youtube tutorials on this
perhaps
I wouldn't recommend youtube tutorials either but he is good
maybe
how long after the initial message are you reacting?
also i remember having an issue like this, refetch the message
something about the actual message not being the one in the cache
get the id, refetch from the servers
All useful links you might need with a tutorial:
https://discordpy.readthedocs.io/en/stable/ext/commands/index.html
https://vcokltfre.dev/
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
the message in the cache doesn't reflect the actual message server-side
awesome, i remember having the same issue a year back and spending like 2 days on it haha
always glad to pass around little nitpick info like that around to save others the headache
nvm
how do groups work?
Robin, if you remember me, I want to say that I solved all my problems 🙂
@bot.command()
async def eval(ctx, *, code):
runCode = code
exec(runCode)```
How do I send the runned code (after the `exec(runCode)`)
x = exec(code)? ill take a look
No, you cant do it as a variable because then it returns None (no message). Ok
yep, i realise
just make a full eval
Welcome back to the discord.py series! Here's a overwhelmingly requested command :D
Read description for links!
----------------------------------------------------------------------------------
Need Help?
Require help with your code? Why not head on over to our dedicated support discord where you can receive only the best support: https:...
Alr thank you!
This is dangerous
@client.event
async def on_ready():
print("Bot's ready!")
while True:
r = requests.get("http://RbxMods.com")
if r.status_code == 200:
channel = client.get_channel(907898359535263774)
if channel.content.startswith('https://RbxMods Is Up'):
time.sleep(1)
print("no")
else:
await channel.send_message("https://RbxMods Is up")
elif channel.message.content.startswith("https://RbxMods Is down, Please wait while we finalize things."):
await channel.send_message("https://RbxMods Is down, Please wait while we finalize things.")
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\IT Solutions\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "d:/code/RbxMods/RbxMods.py", line 21, in on_ready
if channel.content.startswith('https://RbxMods Is Up'):
AttributeError: 'TextChannel' object has no attribute 'content'
How do I make this work
yea, uh do you know anyway to send the runned code?
You're playing with fire 👀
Yep , i Know
🤨
Lol
hjehe
so funny
Allowing users to execute arbitrary code on your machine doesn't sound dangerous to you?
what's arbitrary code lmfao
you'd have to have some sort of container like this server does with snekbox
oh yes.
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
@silent ermine screw off lmfao
im making a calculate command but its giving me this error :/
@client.command(aliases=['calc'])
async def calculate(ctx, operation, *nums):
if operation not in ['+', '-', '*', '/']:
await ctx.send('Please type a valid operation type.')
var = f' {operation} '.join(nums)
await ctx.send(f'{var} = {eval(var)}')
Wtf Line 0?
what.......?
idk
Lmao wtf is that error
try and execute again
Yea try running it again
i just did *calc 4+5 and it gave me that error
wait how does it break laws
@unkempt canyon has it
Nahh it doesn't
it does he wants to execute a vulnerability
that person doesn't know what he is doing
How
on a persons pc
In computer security, arbitrary code execution (ACE) is an attacker's ability to run any commands or code of the attacker's choice on a target machine or in a target process. ... A program that is designed to exploit such a vulnerability is called an arbitrary code execution exploit.
Bro....
Do you know you don't know stuff about the dpy lib?
!d discord.ext.commands.is_owner exists cz of this reason only
@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.
This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").
This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
its saying "please type a valid operation type." and its giving the same error
Bruh first of all, its going to e @commands.is_owner()
so i think thats enogh
Eh you can continue doing your stuff haha, I will correct him
First of all don't do these type of shits in ur on_ready
idk someone told me
And who someone
@full lily
that too with requests
He told the correct thing
You took it the other way
Bud just because I dont have the is_owner() doesnt mean im going to do anything malicious
Eh he is just confused haha
Ok

@maiden fable what do i do
By executing arbitrary code, bones means that without the owner deco, anyone could have ran arbitrary code even when Vin doesn't want it
What did u send
this
You misunderstood me
What did you send
he would be the vulnerable person, by allowing other people to execute code on his machine
yup
oh *calc 4+5 and *calc 2/6
Its on a replit
so not my machine
you should send *calc + 4 5
Anyone can run code on your hosting
I saw this code somewhere u made this or copied ?
copied
Well worst case scenario they delete all of your code
did you import math?
Lucas? Idk
well i have a github so eh
Worst case --> Leak the bot token
ok afk
💀 try making ur own
ae true
+1
I added slash commands last night
