#discord-bots

1 messages · Page 718 of 1

jaunty wraith
#

Does anyone know if it’s possible for me to define ctx in a function

sage otter
#

what are you trying to do right now? Like what are your intentions?

fluid spindle
jaunty wraith
sage otter
#

Are you using this on_command_completion ?

steep drift
#

Hey do any of you guys have an idea of how to make a bot (maybe with webhooks) of checking when a Minecraft Server is online?

jaunty wraith
sage otter
#

I wouldnt recommend doing that.

jaunty wraith
#

Oh

sage otter
#

Especially since you'd have to do that for every command

#

Make use of the on_command_completion event

jaunty wraith
#

Thats why im making a function do it would be print(used) and it would do it automatically

#

Im fairly new to python so im not 100% sure

sage otter
#

ex:

@bot.listen("on_command_completion")
async def command_listener(ctx: commands.Context):
    print(f"{ctx.author} used {ctx.command.name}")
#

in your case it would be
@client.listen()

jaunty wraith
slate swan
#

how do i make it send all in one

sage otter
#

!d str.join

unkempt canyonBOT
#

str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes") objects. The separator between elements is the string providing this method.
sage otter
#

await ctx.send(", ".join(responses))

slate swan
#

why doesnt this command work?

velvet tinsel
#

Caeden 😄

slate swan
#

it was working great a few dyas ago

velvet tinsel
#

Wdym it doesn’t work

sage otter
#
Saying it doesn't work or asking what's wrong with this code? is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.
slate swan
#

so i have no clue what to do or how to help because it just doesnt do anything

sage otter
#

is that all of your code for your command in your ss

slate swan
sage otter
#

you're not actually sending the embed

#

You only build an embed

#

you didnt actually send it

slate swan
#

tyler is right

sage otter
#

cease

slate swan
#

because it was working before

#

i dont remember if i changed the code

sage otter
#

You probably accidentally removed it or something

#

thank you to whichever moderator that was 👌

slate swan
#

so how would i fix this

sage otter
#

By sending the embed?

#

!d discord.abc.Messageable.send

unkempt canyonBOT
#

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**.
slate swan
#

nvm

#

oh

sage otter
#

Literally just await ctx.send(embed=embed)

slate swan
#

at top im guessing

sage otter
#

No

fluid spindle
#

await should be after you've made the embed

slate swan
#

ah

#

Noted.

sage otter
#

You'd get an UnboundLocalError or something

slate swan
#

I think i got it thanks gonna test

velvet tinsel
#

Why did you send it before it was even declared

#

Code is read from top to bottom

#

For the computer

cloud dawn
#

Been busy with the logger today colors :3

velvet tinsel
#

By putting it above it won’t be declared

velvet tinsel
cloud dawn
velvet tinsel
#

!e

print(a)
a = 6

unkempt canyonBOT
#

@velvet tinsel :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 'a' is not defined
velvet tinsel
cloud dawn
#

Code is read from top to bottom.

#

This is like starting at the end of a book and reading backwards.

sage otter
#

It will throw UnboundLocalError

#

which is a subclass of NameError. So meh ig

unique willow
#

hey guys

#

whats the code for ask for input

#

i forgot it and i think there are many different, so need the one for discord.py

#

thanks!

unkempt canyonBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

Hello! I do not know if this is the right place to ask this, if it is not, sorry. I'm using the api discord.py, and I want to make an anti bots, but I don't know how to make the variable antibots = True be different on each server. What happens to me is that if a user activates or deactivates the anti bots, it does it for all servers and I don't want that. Can anybody help me?

#

pls help

cloud dawn
#

What are anti bots?

slate swan
#

when a bot join, if anti bots is True, the bot will br banned

#

object of type 'Command' has no len()

#

how do i fix this stupid error

cloud dawn
cloud dawn
slate swan
#

If it is enable yes, but thats not the problem

slate swan
cloud dawn
cloud dawn
unique willow
#

Hello again! I am building a football bot and in discord it says tampa bay and green bay both won. What did I do wrong? Thanks!

@client.command(name='football')
async def football(ctx):
    coinflip = randint(1,2)
    if coinflip : 1
    await ctx.send('Tampa Bay won the coin toss! They elect to defer.')
    if coinflip : 2
    await ctx.send('Green Bay won the coin toss! They elect to defer.')```
slate swan
#

What happens to me is that if a user activates or deactivates the anti bots, it does it for all servers and I don't want that. @Pandabweer#7576

cloud dawn
unique willow
slate swan
#

its like a global var,

unique willow
#

thanks

unique willow
slate swan
#

u can look em up

cloud dawn
unique willow
slate swan
#

@cloud dawn but is a public bot

#

np

slate swan
cloud dawn
slate swan
#

it is on 20 servers

cloud dawn
cloud dawn
slate swan
#

so fun lol

cloud dawn
slate swan
cloud dawn
slate swan
cloud dawn
unkempt canyonBOT
cloud dawn
#

Looks pretty neat and i can shorten error tracebacks so my eyes don't die on large errors.

slate swan
#

@cloud dawn I know how to make the database, but I don't know how to do the rest, could you give me a short example?

cloud dawn
#

What do you mean by "the rest" i need specific issues.

#

Getting items from the database? If statement? Adding to the database?

slate swan
#

ok, I can do the writing of the server ids in the database, but how do I do the rest? I mean, the variable is per server

cloud dawn
#

Could you show me your database?

fluid spindle
cloud dawn
slate swan
#

a txt file ._. , it works for me with a blacklist

fluid spindle
cloud dawn
fluid spindle
slate swan
#

@cloud dawn but is useful?

cloud dawn
#

Yeah it's a bit more complicated than that lemon_grimace

fluid spindle
#

@slate swan Have you used JSON files before?

slate swan
#

@fluid spindle with node .js

cloud dawn
#

It's a public bot though once he gets to 50 or 100 servers it could already die.

slate swan
#

only for load the prefix and token

cloud dawn
#

json is as fast as an txt file lol

fluid spindle
#

wow, didn't know that

#

what do you recommend then?

cloud dawn
slate swan
#

So, what can i do and how?

cloud dawn
unkempt canyonBOT
cloud dawn
#

Pretty sure sqllite can handle 20k guilds or so.

slate swan
#

Is there an article or something that I can see?

cloud dawn
#

SQL is a bit boring but it's almost a must in a bot.

fluid spindle
#

shit, so now I gotta migrate from JSON to sql

cloud dawn
#

Fact ytbers and tutorial site even explain things with json makes me sad 🙁

#

json is not really meant to get updated or get really large in terms of size.

fluid spindle
#

yeah, I felt that when I once downloaded a JSON of all cities in the world with some other data

velvet tinsel
cloud dawn
fluid spindle
#

fair enough

#

Also, one more problem I faced with JSON is that it can't store Discord objects like ctx...

cloud dawn
#

Why would you ever want to store ctx?

fluid spindle
#

Not ctx exactly, but ctx.author.mention or something like that, can't remember exactly what it was

cloud dawn
#

Well you can store objects but that method is pretty cursed

ionic wadi
#
@bot.command()
async def suggestie(ctx, bug=None):
  await ctx.send("Wat is uw suggestie? Reageer binnen 120 seconde met uw bug!")
  try:
    message = bot.wait_for("message", check=lambda m: m.author == ctx.author and m.channel == ctx.channel, timeout=120.0)
  except asyncio.TimeoutError:
    await ctx.send("Niet optijd gereageerd, prompt gecancelled.")
  else:
    bug = message
    await ctx.send("Bedankt voor het melden, hij wordt naar het kanaal gestuurd!")```

I immediatly get the last await ctx.send, instead of waiting for a message. How to fix this?
ionic wadi
#

I have used It before In commands tho, so dont onderstand why not now.

ionic wadi
#

Dutch

modern fiber
#

Guys, how can I connect a Discord Bot with Roblox API, in the way that Bot connects when the product from the game has been purchased and adds the value of that product to the user's variable.

So basically, user buys for example product worth 10 robuxs, and then the bot adds 10 to his variable.
If possible, with -30%.

Can anybody help me, please?

cloud dawn
modern fiber
cloud dawn
cloud dawn
modern fiber
#

So, could you help please? @cloud dawn

modern fiber
cloud dawn
#

I can but i'm not going to make it for you. I can help with problems and errors not entire projects.

modern fiber
#

Uh,

#

Where can I get help about it then..?

#

I wanna learn how to do it

cloud dawn
#

Have you tried to get a response from the roblox API?

ionic wadi
modern fiber
#

Nope.

cloud dawn
#

What i do sometimes is seperate the 2 API's if i'm dealing with a difficult API then merge them if they both work.

cloud dawn
potent spear
unique willow
#

How would i format the str so it works? gbkickdist is an int. Thanks!

                        embed.add_field(name='Hari Kawn kicks ', str(gbkickdist), ' yards to end zone' )```
slate swan
#

finally pusblished version 0.0.2 of discordheximals

#

to pypi

unkempt canyonBOT
#

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.

cloud dawn
#

!pypi discordheximals

unkempt canyonBOT
slate swan
cloud dawn
#

Huge pp

slate swan
#

💪

#

So I'm tryna make it so I can copy the ID of all members in a discord server but when I do it my console blows up with this error:

jaunty wraith
#

Does anyone know how to get a banner url in a command?

zenith basin
cloud dawn
slate swan
cloud dawn
jaunty wraith
cloud dawn
unkempt canyonBOT
#

property banner```
Equivalent to [`User.banner`](https://docs.disnake.dev/en/latest/api.html#disnake.User.banner "disnake.User.banner")
cloud dawn
#

returns...

#

!d disnake.Asset

unkempt canyonBOT
#

class disnake.Asset```
Represents a CDN asset on Discord.

str(x) Returns the URL of the CDN asset.

len(x) Returns the length of the CDN asset’s URL.

x == y Checks if the asset is equal to another asset.

x != y Checks if the asset is not equal to another asset.

hash(x) Returns the hash of the asset.
jaunty wraith
patent lark
#

no

jaunty wraith
#

Ok

cloud dawn
#

Oh i still had the disnake docs on

slate swan
#

so any idea how i can fix it

cloud dawn
#

So i recommend adding it.

slate swan
#

wdym by the dict

slate swan
jaunty wraith
#

Atleast i cant find one

cloud dawn
jaunty wraith
cloud dawn
jaunty wraith
torn sail
jaunty wraith
patent lark
#

they are using disnake

#

as far as im aware

torn sail
#

Oh

cloud dawn
#

pretty sure ruffs is

patent lark
jaunty wraith
patent lark
cloud dawn
patent lark
#

ah

torn sail
patent lark
jaunty wraith
#

ok

jaunty wraith
patent lark
jaunty wraith
#

How do i update bc im on repl

patent lark
#

i think you have to install it via github?

patent lark
jaunty wraith
#

This part of the app im on now is like pip install i just type in the name of the pip and it downloads for me

patent lark
#

yeah but im pretty sure you cant usepip install... --upgrade for 2.0

#

i think you need to install it via github

cloud dawn
#

You can use pip

patent lark
#

alright, my apologies, i was unsure.

manic wing
#

about to get on a 10 hour flight rip

cloud dawn
#

pip install git+https://github.com/Rapptz/discord.py for discord.py 2.0

slate swan
#

btw ill do the pr maybe in 4 hours

manic wing
slate swan
manic wing
#

went there for holiday

slate swan
#

nice

#

hope you enjoyed it

manic wing
#

i don’t like america

slate swan
#

🕴️

manic wing
slate swan
#

im too lazy to try it well . imma just ask yall, so i wonder if i put 8ball as an aliases like alaises["8ball"] is it going to work? cuz on async def 8ball is not going to work doe

slate swan
#

ty

final iron
#

You can also just specify the name of the command to be 8ball

final iron
#

What you wrote wont work exactly though

cloud dawn
final iron
final iron
slate swan
#

@cloud dawn hi! arevyou there?

cloud dawn
unkempt canyonBOT
#

*args and **kwargs

These special parameters allow functions to take arbitrary amounts of positional and keyword arguments. The names args and kwargs are purely convention, and could be named any other valid variable name. The special functionality comes from the single and double asterisks (*). If both are used in a function signature, *args must appear before **kwargs.

Single asterisk
*args will ingest an arbitrary amount of positional arguments, and store it in a tuple. If there are parameters after *args in the parameter list with no default value, they will become required keyword arguments by default.

Double asterisk
**kwargs will ingest an arbitrary amount of keyword arguments, and store it in a dictionary. There can be no additional parameters after **kwargs in the parameter list.

Use cases
Decorators (see !tags decorators)
Inheritance (overriding methods)
Future proofing (in the case of the first two bullet points, if the parameters change, your code won't break)
Flexibility (writing functions that behave like dict() or print())

See !tags positional-keyword for information about positional and keyword arguments

final iron
#

Ah

#

So keyword arguments are kwargs?

cloud dawn
final iron
#

Its just that simple?

#

Interesting

cloud dawn
#

yep

slate swan
cloud dawn
#

Now you made him insecure, he won't ask these questions anymore.

slate swan
#

i was gonna show the difference

#

smh

final iron
#

I never took a proper python class

cloud dawn
#

||me neither||

velvet tinsel
#

Hello Okimii

velvet tinsel
#

Does that count as a class 💀

slate swan
#

@final iron

def function(*arg):
    print(arg)

function("arg")

thats a unknown amount of positional argument as it gets called for its position

def my_function(**kid):
  print("His last name is " + kid["lname"])

my_function(fname = "Tobias", lname = "Refsnes")

hope it helps

slate swan
#

ping

final iron
slate swan
cloud dawn
slate swan
slate swan
#

😭

cloud dawn
#

😂

slate swan
#

@final iron btw theirs something know as a optional arg which can be a kwarh or an arg
example

def function(optionalarg = None):
    print("works")

its a argument which is positional but has a default value of none which can be a kwarg or a positional argument with a default value

#

and
*args
gets stored as a tuple while
**kwargs
get stored as a dict

#

!d disnake.Member.ban

unkempt canyonBOT
#

await ban(*, delete_message_days=1, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Bans this member. Equivalent to [`Guild.ban()`](https://docs.disnake.dev/en/latest/api.html#disnake.Guild.ban "disnake.Guild.ban").
slate swan
final iron
slate swan
final iron
#

Can you go more in depth about what the * signifies in the docs?

slate swan
cloud dawn
#
  • is a build-in python "function"
slate swan
#

correct

cloud dawn
#

See it like a special character.

final iron
#

Interesting

slate swan
cloud dawn
#

Defining an arg or kwarg in the function makes them optional.

slate swan
#

yeah

final iron
#

Thanks for the explanation

slate swan
#

anytime dont be afraid to ask these types of questions we all have these types of questionspithink

slate swan
#

no need to be ashamed as it just makes more confusion pithink

slate swan
manic wing
#

damn im a dickhead

slate swan
slate swan
#

your probably insecure as wellpithink

final iron
#

Honestly I might pick my bot up again

manic wing
#

who says i have these types of questions

manic wing
#

^

slate swan
#

idk maybe you do pithink

manic wing
#

nah too smart for them <3

#

wheres my pr

slate swan
manic wing
#

ill continue to piss you off until i receive a pull

#

well not really

manic wing
#

im about to hop on a plane so i cant piss you off for the next half a day 🥲

#

did i ask this before? what timezone are you @slate swan

slate swan
manic wing
#

100+ commands

#

20+ new cogs

slate swan
manic wing
#

1000+ typehints

manic wing
slate swan
#

🕴️

manic wing
#

well actually hes pandabweer :D

slate swan
cloud dawn
manic wing
#

x.x

cloud dawn
#

😂

slate swan
#

i pronounce pandas name as:
panda-weeee-bear

#

idk why

cloud dawn
#

I'm bored don't mind me.

slate swan
cloud dawn
#

It's funnier in my language trust me.

slate swan
#

how is it

cloud dawn
#

Well it's pretty satisfying to scream out.

slate swan
#

how do you guys pronounce my name?

slate swan
cloud dawn
#

Like, oki-mii

#

Wait no

slate swan
#

in english its pronounced
oki me

cloud dawn
#

Oki-miiiiiiiiiiiiiiiiiiiiiiiiiiii

slate swan
#

no

#

spelled okimii said oki me

pliant gulch
#

Oh-key-me

slate swan
#

@manic wing i hope you get a seat thats not by a window pithink

slate swan
manic wing
#

plenty of leg room

cloud dawn
#

me hopingly waiting till airplane mode starts

slate swan
manic wing
#

on my laptop rn

slate swan
#

turn off the internet bro

#

or plain go boom

manic wing
#

an hour till we board*

indigo lichen
manic wing
indigo lichen
#

i did

slate swan
indigo lichen
#

requirment already satified

slate swan
#

i hope your flight gets delayed

manic wing
#

more time for me to code

#

and annoy you because you arent giving me a pr

slate swan
#

no more time for you to cry

cloud dawn
#

You can't code without internet?

slate swan
cloud dawn
#

weak

indigo lichen
#

@manic wing

slate swan
#

i cant

#

i only do stuff related to apis

manic wing
cloud dawn
indigo lichen
#

yeah

#

im on 3.10

pliant gulch
#

I've been doing API stuff all my career basically, now I'm branching out and making my own lang

slate swan
pliant gulch
#

Idk, just coming from someone doing API related stuff during their entire programming career, branching out is def a breath of fresh air

slate swan
#

ic

manic wing
#

@slate swan

#

wanna add more colors?

slate swan
#

to what?

manic wing
#

discordheximal

slate swan
#

sure make a pr with all the new colors or idk

manic wing
#

uh

#

i cba to write out 3000 colors

#

you're the one who does that 😳

slate swan
#

😏

#

ill add 58 more colors to make 800colors

manic wing
#

only 800? bah!

slate swan
#

i can add 258 colors so it can have 1k colors 🤔

manic wing
#

add 3k

slate swan
#

but idk i have to make a dpy wrapperpithink

manic wing
#

dpy wrapper?

slate swan
#

my bad i ment discord api wrapper

slate swan
# manic wing add 3k

i have people hating my long read me and you want me to add more colors🕴️

manic wing
#

uh not to be rude but i think thats a bit hard for you

slate swan
#

im trying hard stuff isnt that how you learn new stuff?

manic wing
#

not really, seeing as you will literally get nowhere

slate swan
manic wing
#

but you can try ig - i never tried because its pointless. even if i succeed it doesnt get me anything

manic wing
slate swan
manic wing
#

?

slate swan
manic wing
#

good pr = contributer

slate swan
sage otter
#

Caedon you're expecting too much. Have you seen Okimii's and Download's PyBot.

slate swan
#

my commands are great thopithink

sage otter
#

They would be better if you actually utilized cogs

slate swan
sage otter
#

I don’t have a single command in my bots runner file.

slate swan
#

i do know cogs

#

well its not really my problem as my os doesnt find any cogs

#

even with the file path

visual island
#

try os.listdir(".") and see what it returns

slate swan
#

cant rn lol

final iron
#

I decided to finally pick up my discord bot again. I want to use a real db instead of json. What would yall recommend?

visual island
#

for lightweight database use sqlite3, for async stored database use postgresql

slate swan
#

!pypi aiosqlite

unkempt canyonBOT
final iron
#

Which one would be easier?

#

I'm not looking for anything powerful

#

Just something with a small learning curve

slate swan
#

i mean aiosqlite iirc stores it in a file while pg uses a server

visual island
#

yea aiosqlite, sqlite3 uses local db in your computer

final iron
#

I'll probably use aiosqlite then. I'm planning on hosting on a raspberry pi

slate swan
#

yeah

plain cloud
#

cogs r overrated smh

final iron
#

If I wanted to make the change from dpy to disnake what are the changes I found have to make?

#

Aside from refactoring discord to disnake

visual island
final iron
#

What would be the difference between that and installing it without the extra

visual island
#

that will install disnake by the name of "discord"

final iron
#

I'm fine using pycharm's find and replace

#

I also intend to publish it on Github so I would want simplicity and readability

neon oyster
#

How long can you timeout a member for

#

with bots

slate swan
#

i think it was 28days idk

#

!d disnake.Member.timeout

unkempt canyonBOT
#

await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Times out the member from the guild; until then, the member will not be able to interact with the guild.

Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.

You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.

New in version 2.3.
slate swan
#

check their

final iron
#

So aside from refactoring discord to disnake is there anything else I would have to do?

outer violet
#

I’m trying to make my command so you can mention other members but it’s giving me this error

slate swan
#

oh mb for ping sorry 😭

outer violet
slate swan
#

the pp size

#

where it does like the random gen size

slate swan
outer violet
slate swan
#

yea

#

does it work?

#

for u

outer violet
#

Nope

slate swan
#

ill try to research if i get it working il lyk

outer violet
#

Alr

final iron
#

No need to hard code a list

outer violet
#

Eh

final iron
#

!paste

unkempt canyonBOT
#

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.

final iron
#

Put the code in to here and specify which line is giving the error

outer violet
#

It says line 69 and it’s an invalid syntax

@commands.command(help="Checks the size of your pp")
    @commands.cooldown(1, 5, commands.BucketType.user)
    async def pp(self, ctx, member = discord.Member = None):
        if member is None:
            member = ctx.author
            
        pp = ['8D', '8=D', '8==D', '8===D', '8====D', '8=====D', '8======D', '8=======D', '8========D', '8=========D', '8==========D', '8===========D', '8============D', '8=============D']
        embed = discord.Embed(
            title=f"{member} pp:",
            description=f"{random.choice(pp)}",
            color=ctx.author.color
        )
        await ctx.send(embed=embed)```
#

Wait 💀

maiden fable
#

Imagine hardcoding

#

Why not use random.randint

outer violet
#

Cuz I already made it and it too lazy to change anything and I fixed it

maiden fable
#

Bro

#

size=f"8{random.randint(0, 10)*"="}D"

#

Easy

final iron
potent spear
#

if you want to play it sexy

if member is None:
   member = ctx.author```
is basically
```py
member = member or ctx.author```
maiden fable
#

Yea that too

wary zenith
#

i have a small discord bot and im trying to make a inventory system

maiden fable
#

Okay?

wary zenith
#

the bot can add items to the json file but it cant add multiple things at one time

maiden fable
#

A bit of code would be better ngl

wary zenith
#

i just wanted to explain that first

#

i think some things are missing in the for loop

maiden fable
#

Rip i dont understand anything. Still sleepy AP_blobSad

wary zenith
#

ok

maiden fable
#

I guess wait for someone else to come and they will explain, sorry

potent spear
# wary zenith

you basically copy pasted someone's stinky code, I've seen the function open_account etc already too much

wary zenith
#

the code for open_account has no issues

#

what im writing is wrong

#

@potent spear

supple pier
#

im using repit and i had to edit the code/pafy package to get it to work on visual studio, is there a way to install custom packages/your own to repit? i wanna use repit to try to web server host it there

potent spear
potent spear
supple pier
#

kinda, just tryna get this one changed package over to repl or whatever its called

#

unless theres a better method of free bot hosting..?

potent spear
potent spear
supple pier
#

AWS lambda sounded good but someone told me it only lasts 15 minutes, Im tryna get one with 24 or maybe 12 hour uptime if possible

potent spear
#

not an issue if you know what you're doing

blazing coral
#

how would i go about making a command to restart my bot from discord

wary zenith
patent lark
#

via a command

#

once your bot is off commands will no longer be detected

blazing coral
potent spear
blazing coral
#

so the problem would be i guess that maby the command wouldnt have purpose since its telling the bot to go offline

#

so prolly wouldnt come back online

#

only thing i could think of

#

but

#

way above my knowledge

#

hence why i came here

wary zenith
potent spear
wary zenith
#

maybe its slow, maybe he wants to initiate an update?

#

idk

potent spear
wary zenith
#

no, json is just simple enough for me to understand

blazing coral
#

like if its having latency etc

potent spear
wary zenith
#

and as i said its a small bot

potent spear
potent spear
potent spear
# blazing coral thanks

know what it does, please
don't ever blindly copy paste
also make sure the command can only be executed by you, not a random stinky boy

blazing coral
#

yeah

#

im looking in to everything now understanding the code

#

i appreciate the help

vagrant brook
slate swan
#

whats wrong with it?

vagrant brook
#

If you're not in a cog then you don't have to add the self param

patent lark
unkempt canyonBOT
#
Nope.

No documentation found for the requested symbol.

patent lark
#

not a thing

vagrant brook
#

That too

slate swan
#

thanks

wary zenith
#

member portion is kinda iffy too

slate swan
#

thought it was great

wary zenith
#

where it says None

slate swan
#

yeah

#

how can i print a random amount of something kinda burnout and dont want to think😔

#

wait i got it

#

!e

import random

print("lol" * random.randint(101))
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: Random.randint() missing 1 required positional argument: 'b'
slate swan
#

what

#

😭

visual island
#

should be random.randint(1, 101)

slate swan
#

why

#

cant you still not do that

#

!e

import random

print("lol" * random.randint(1, 101))
unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

lollollollollollollollollollollollollollollollollollollollollollollollollollol
slate swan
#

good

#

smh

gaunt herald
#

why my buy command not working?

final iron
gaunt herald
#

ok

#
async def update_bank(user,change = 0, mode="wallet"):
  users = await get_bank_data()

  users[str(user.id)][mode] += change

  with open("mainbank.json", "w") as f:
    json.dump(users,f)
  
  bal = [users[str(user.id)]["wallet"],users[str(user.id)]["bank"]]
  return user

async def buy_this(user,item_name,amount):
    item_name = item_name.lower()
    name_ = None
    for item in shopitems:
        name = item["name"].lower()
        if name == item_name:
            name_ = name
            price = item["price"]
            break

    if name_ == None:
        return [False,1]

    cost = price*amount

    users = await get_bank_data()

    bal = await update_bank(user)

    if bal[0]<cost:
        return [False,2]


    try:
        index = 0
        t = None
        for thing in users[str(user.id)]["bag"]:
            n = thing["item"]
            if n == item_name:
                old_amt = thing["amount"]
                new_amt = old_amt + amount
                users[str(user.id)]["bag"][index]["amount"] = new_amt
                t = 1
                break
            index+=1 
        if t == None:
            obj = {"item":item_name , "amount" : amount}
            users[str(user.id)]["bag"].append(obj)
    except:
        obj = {"item":item_name , "amount" : amount}
        users[str(user.id)]["bag"] = [obj]        

    with open("mainbank.json","w") as f:
        json.dump(users,f)

    await update_bank(user,cost*-1,"wallet")

    return [True,"Worked"]

#

@client.command()
async def buy(ctx,item,amount = 1):
    await open_account(ctx.author)

    res = await buy_this(ctx.author,item,amount)

    if not res[0]:
        if res[1]==1:
            await ctx.send("That Object isn't there!")
            return
        if res[1]==2:
            await ctx.send(f"You don't have enough money in your wallet to buy {amount} {item}")
            return
    else:
      await ctx.send(f"You just bought {amount} {item}")
#

@final iron

slate swan
#

what does the class method decorator do?

visual island
# slate swan what does the class method decorator do?

before that you should know what's the difference between an instance and a class:

class Foo:
    pass

Foo  # this is a class
Foo()  # this is a method

a class method means that the function can be called from a class, normal method only can be called from an instance

slate swan
#

ill google it lol

slate swan
patent lark
visual island
# slate swan im not quite sure still

Difference between classmethod and instance method (normal method):
A class method means that the function decorated by it can be called from both, class or instance. Normal method only can be called from an instance.

Example

class Foo:
  def normal_method(self):
      pass

  @classmethod
  def class_method(cls):
      pass

# instance
Foo().normal_method()  # works fine
Foo().class_method()  # also works fine

# class
Foo.normal_method()  # raises TypeError
Foo.class_method()  # works fine

here, you can see the differences:

Class Method

  1. Takes cls as the first parameter. cls behaviour is similar to self but the only difference is cls is the object of Foo not an instance of Foo.
  2. Works on both, class and instance

Instance Method

  1. Takes self as the first parameter. self is the instance of Foo
  2. Works only on instance, not class
magic ore
#

Foo.normal_method() doesn't raise attribute error

sick birch
#

Also thinking of @classmethods as sort of from_* functions helps me understand it better, and many times they are used as that. For example, in discord.py, there are functions like from_rgb(), from_hsv(), that are classmethods

#

They take one form of input and basically return a full class rather than ints or strings or whatever like normal functions

#

Not sure if that helps but it helps me understand it

magic ore
#

They can return anything

sick birch
#

Well yes but I think having it not return an instance kind of breaks the whole point

#

After all it is a classmethod

worthy wagon
#

Anyone know why this doesn't remove the roles?

#

Or am I just a bit slow?

sick birch
#

What error are you getting

worthy wagon
#

None

#

Literally nothing

sick birch
#

Let me check something one moment

worthy wagon
#

No problem

sick birch
#

For that you should probably str() it as long as it's a default discord emoji

wary zenith
#

what about when its not default

sick birch
#

Then you can employ is_custom_emoji()

worthy wagon
#

Cause adding the reaction adds the role

sick birch
#

And use the ID/name

worthy wagon
#

And it's not a custom emoji

#

it's a basic one.

#

Using the emoji name doesn't work.

sick birch
#

Oh it adds but won't remove the role?

worthy wagon
#

I've tried that, and it wouldn't add the roles anymore

wary zenith
#

try unicode?

worthy wagon
#

Yes, it adds the roles, but just doesn't remove them

sick birch
#

Most likely the if statement isn't passing

#

Actually i don't see why else it wouldn't

#

Trying doing str() on it

#

Just humour me

worthy wagon
#

wdym

#

str() what

sick birch
#

str(payload.emoji)

#

rather than payload.emoji.name

worthy wagon
#

On the remove?

sick birch
#

Yes

worthy wagon
#

bet

#

nope

#

didn't work

sick birch
#

Can I see the code after you used str on it?

worthy wagon
#

emoji = str(payload.emoji)?

sick birch
#

That should be right

worthy wagon
#

yep

sick birch
#

payload.emoji is a discord.PartialEmoji

worthy wagon
#

so

#

here's the weird part

#

This passes fine in the onrawreactionadd

sick birch
#

What's the code for the add

worthy wagon
#

Here:

sick birch
#

Oh my

#

I think you should have a dict that maps emojis to their ID and do it that way but that's beside the point

worthy wagon
#

adding works fine

#

It just seems to be the removing that breaks on something

#

Could it be the fact that I'm using 2 different listeners?

sick birch
#

If it's a listener shouldn't be an issue

worthy wagon
#

I'm going to upload the code for you to look at fully

sick birch
#

If it's an event then yes

worthy wagon
#

Anywhere specific I upload?

sick birch
#

Hastebin I think the name is?

worthy wagon
#

sec

#

wtf

sick birch
#

It's aight i can see it

worthy wagon
#

Ok

#

I don't know what toptal is

sick birch
#

Eh i can see it who cares haha

#

It's weird because from your error payload.member is returning NoneType

#

Ah you know what

#

"Only available if event_type is REACTION_ADD and the reaction is inside a guild."

worthy wagon
#

What's up?

#

The reaction is in the guild.

sick birch
#

So you don't get the member when they remove the reaction

worthy wagon
#

🤔

#

so what about just

#

on_reaction_remove

#

would using that change anything

sick birch
#

Let's see

worthy wagon
#

Alright

sick birch
#

You should it's typehinted to Union[Member, User]

worthy wagon
#

wait....

sick birch
#

Other one was typehinted to Optional[Member]

worthy wagon
#

squint could it be because the reactions are mine?

#

and not the bots reactions?

sick birch
#

Don't think like the docs said on_raw_reaction_remove doesn't provide you with the member

worthy wagon
#

the reactions are mine, but yeah, using on_reaction_remove didn't change anything

sick birch
#

Yeah you were getting an error

worthy wagon
#

I'm going to see if I make the reactions the bots reactions, it'll work, if not, I'm out of ideas.

worthy wagon
#

plus on_reaction_remove takes 3 args, I only have 2 provided, so I have to stick with on_raw_reaction_remove

sick birch
#

I don't think you get the difference between the 2

#

It's not just about the args

#

on_reaction_remove only works for messages that are in the cache, and provides a better input to you such as the user and the reaction objects in itself
on_raw_reaction_remove works regardless of the internal message cache, so it will still pick up reactions from messages a long time ago that are no longer in the cache. It provides a more raw format and expects you to get any useful data out of it

worthy wagon
#

bro, so when it's the bots reactions on the embed, the roles don't add to the member.

#

but when they're mine, it works on adding roles

worthy wagon
visual island
worthy wagon
sick birch
worthy wagon
#

how would I get the author of a message in an on_raw_reaction_add event if I can't use ctx.author

slate swan
brazen raft
#

You can also check if the payload had guild_id and try fetch a member with that data

jade tartan
#

If i want my bot to mention a message in vs code terminal is this how its done? print{member} Welcome to the {server}

brazen raft
#

Mentioning is a Discord thing. The application transforms a string into a mention, so using it anywhere else will be a string.

jade tartan
#

i mean something like heyy {member} welcome to the {server}

slate swan
#

the member turns to a Gangsterhood101#8346

jade tartan
#

Yes

#

Correct

final iron
#

What is the difference between the brief and description kwarg in the command decorator?

boreal ravine
final iron
#

I'm guessing this would only matter if you're subclassing the help command?

slate swan
#

brief is usually the short help

slate swan
#

It Does

pure field
#

hey guys how do i get these kinds of text things in my embeds?

pure field
#

how do you implement them?

slate swan
#

<t:<timestamp integer>:Type>

pure field
#

mhm

slate swan
#

There's an internal function in discord.utils too but I'm unable to recall it

boreal ravine
#

!d discord.utils.format_dt

unkempt canyonBOT
#

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
slate swan
#

^

knotty apex
#

not really related to bots but people on ny server are telling me that webhooks are really exploitable and shouldnt be used byt u cant see how. Does anyone know why?

pliant gulch
#

They are only exploitable if you leak the webhook's token

slate swan
#

if you don't keep providing manage_webhooks to random people there's nothing wrong with it
Basically it can be misused by people by copying the webhook url and sending messages

pliant gulch
#

And by exploitable the most you can do is spam messages

knotty apex
#

yeah idk what people are freaking out about

#

but its tye same with a bot if you leak the token

slate swan
#

bot token leak can be really harmful to servers which provide additional perms to bots

#

As it can simply do anything within the server , webhooks are limited to sending messages , thw worst they can do is spam and send everyone pings

knotty apex
#

yeah

shadow wraith
#

my bot for a server doesn't have mention everyone pings

shadow wraith
# unkempt canyon

holy shit that exists? i always used to do it the hard way with datetime and calendar

slate swan
#

I turned it off for mine completely , everyone pings , role pings and reply pings are turned off

shadow wraith
#

a module iirc

#

built-in

slate swan
#

If you use the util

shadow wraith
#

true true so like a datetime.datetime() obj

slate swan
#

yeah

boreal ravine
#

ok

#

give command ideas

shadow wraith
#

think of a psyichal game irl, then put into your bot

slate swan
#

or maybe a smart phone

shadow wraith
#

wait do y'all make a class to just do bot=Class() and is it better to do it?

visual island
#

I do, and that's just for overriding some methods

shadow wraith
#

what methods will be overrided?

boreal ravine
serene lynx
#
@commands.Cog.listener()
    async def on_message(self, message):
        if record := await self.get_all(message.guild.id):
            print(record)
            for i in record:
                if message.guild.id == i["guild_id"]:
                    user = discord.utils.get(self.bot.get_all_members(), id=i["user_id"])
                    print(user)```
#
$  /usr/bin/env d:\\servernotif\\env\\Scripts\\python.exe c:\\Users\\andan\\.vscode\\extensions\\ms-python.python-2021.12.1559732655\\pythonFiles\\lib\\python\\debugpy\\launcher 62877 -- d:\\servernotif\\servernotif.py      
Logged in as Ping Notifications#4447
[<Record guild_id=836464932236165140 guild_name='Server Sebelah' user_id=811051954389647372 user_name='Ditttt#6059'>]
None```
#

why the result is None?

visual island
#

do you have member intents enabled?

serene lynx
maiden fable
woven ingot
#

Hello so i have a function that is trigered with *convert

#

async def convert(ctx: commands.Context, count: int):

#

Is there a way to make it trigger with *cher convert instead?

#

So it would have 2 words that would trigger it with a space in between?

#

I know i can do *cherconvert

#

But would like to use *cher convert instead is this possible?

#

The function converts a number inputed by the user

#

*convert 10

#

so it converts number 10

shadow wraith
#

why doesn't this work:

@bot.command()
@commands.guild_only()
@commands.cooldown(1, 3, BucketType.default)
async def rhyme(ctx, *, word):
    try:

        def check(r: disnake.Reaction, u: Union[disnake.Member, disnake.User]):
            return (
                u.id == ctx.author.id
                and r.message.channel.id == ctx.channel.id
                and str(r.emoji) in ["🔄"]
            )

        async with aiohttp.ClientSession() as session:
            newword = quote_plus(word)
            url = await session.get(f"https://api.datamuse.com/words?rel_rhy={newword}")
            urlJSON = await url.json()

        rdn = random.choice(urlJSON).get("word")
        success = await ctx.reply(f"Word: {word}\nWhat rhymes: {rdn}")
        await success.add_reaction("🔄")
        event = await bot.wait_for(
            event="reaction_add",
            check=check,
            timeout=30.0,
        )
    except IndexError as ie:
        await ctx.reply(f"There are no words rhyming with {word} :(")
    except asyncio.TimeoutError:
        pass
    else:
        newWord = random.choice(urlJSON).get("word")
        if str(event.emoji) == "🔄":
            await success.edit(f"Word: {word}\nWhat rhymes: {newWord}")

my error is: 'tuple' object has no attribute 'emoji'

sage otter
#

because on_reaction_add returns (reaction, user)

slate swan
#

!d discord.on_reaction_add

unkempt canyonBOT
#

discord.on_reaction_add(reaction, user)```
Called when a message has a reaction added to it. Similar to [`on_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message_edit "discord.on_message_edit"), if the message is not found in the internal message cache, then this event will not be called. Consider using [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") instead.

Note

To get the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") being reacted, access it via [`Reaction.message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Reaction.message "discord.Reaction.message").

This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.

Note

This doesn’t require [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") within a guild context, but due to Discord not providing updated user information in a direct message it’s required for direct messages to receive this event. Consider using [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") if you need this and do not otherwise want to enable the members intent.
slate swan
#

You get (reaction, user) as the response

shadow wraith
#

oh

boreal ravine
#

just index it

woven ingot
#

No help for me 😦

shadow wraith
#

so event[0] or smth

sage otter
#

yes

slate swan
#

*your

sage otter
#

event[0].emoji

shadow wraith
#

oj

woven ingot
# slate swan You issue pls?

Hello so i have a function that is trigered with *convert
async def convert(ctx: commands.Context, count: int):
Is there a way to make it trigger with *cher convert instead?
So it would have 2 words that would trigger it with a space in between?
I know i can do *cherconvert
But would like to use *cher convert instead is this possible?
The function converts a number inputed by the user
*convert 10
so it converts number 10

#

No issue just a question

shadow wraith
#

sad new error now

slate swan
#

!d discord.ext.commands.group

unkempt canyonBOT
#

@discord.ext.commands.group(name=..., cls=..., **attrs)```
A decorator that transforms a function into a [`Group`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group").

This is similar to the [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.command "discord.ext.commands.command") decorator but the `cls` parameter is set to [`Group`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group") by default.

Changed in version 1.1: The `cls` parameter can now be passed.
shadow wraith
#

!d disnake.Message.edit

unkempt canyonBOT
#

await edit(**fields)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the message.

The content must be able to be transformed into a string via `str(content)`.

Changed in version 1.3: The `suppress` keyword-only parameter was added.

Note

If the original message has embeds with images that were created from local files (using the `file` parameter with [`Embed.set_image()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_image "disnake.Embed.set_image") or [`Embed.set_thumbnail()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_thumbnail "disnake.Embed.set_thumbnail")), those images will be removed if the message’s attachments are edited in any way (i.e. by setting `file`/`files`/`attachments`, or adding an embed with local files).
slate swan
# shadow wraith

You need to mention what you are editiing ie content = "THR MESSAGE"

woven ingot
shadow wraith
#

if this works thanks sarthak and tylerr

#

it does!!! but it only works for 1 reaction :[

#

how can i make it infinite or something

sage otter
#

use a while loop.

shadow wraith
#

oh yeah and if str(event[0].emoji) == ":arrows_counterclockwise:": would check if the USER has reacted, not the bot right?

sage otter
#

no......

shadow wraith
#

fuck

slate swan
#

just add , an and condition...

shadow wraith
#

i don't use not that much and was thinking and ctx.author not bot.user or and ctx.author != bot.user

slate swan
#

Sure

#

Use the 2nd one

shadow wraith
#

ok

sage otter
#

why you comparing the that to ctx.author tho

shadow wraith
#

¯_(ツ)_/¯

#

wait so reactors have author attributes?

slate swan
#

true , ctx.author won't be a bot user ever

shadow wraith
#

ok but then do reactors have an author attr

sage otter
#

no on_reaction_add returns the user that reacted

slate swan
#

you get the user

shadow wraith
#

wait i forgor

#

on_reaction_add returns (reaction, emoji) as tylerr said so im confused if there is an author attr or something similar

#

wait tylerr alr specified

sage otter
#

You're just trying to see if the reactor is your bot right?

shadow wraith
sage otter
#

Yeah that was a mistake on my end

#

compare event[1] with ctx.bot or sum

shadow wraith
#

so and event[1] != ctx.bot 🤔

#

!d disnake.ext.commands.Context.bot

unkempt canyonBOT
shadow wraith
#

ok this exists

sage otter
#

That would work i guess.

shadow wraith
#

now moving on to the while part

#

wouldn't that just make the bot 24/7 edit the message

slate swan
#

Why not just exclude all bots , and not event[1].bot

shadow wraith
#

uselessly genius idea

#

ok since we have if the reactor is not the bot

sage otter
#

On your first timeout you could break the loop.

#
while True:
    try:
        await Bot.wait_for(timeout=30)
    except asyncio.TimeoutError:
        break
boreal ravine
shadow wraith
slate swan
#

😂

shadow wraith
sage otter
#

Yeah if a user did add an emoji before the timeout ends it will continue onto the next iteration.

slate swan
#

Basically , it gets disabled when the emoji is not clicked atleast once in every 30 seconds

shadow wraith
#

ok but then what happens if the user reacts to the emoji in the loop?

#

i do know the positioning of the loop does change shit

sage otter
#

The loop continues.

shadow wraith
sage otter
#

when someone reacts oogh.

#

If someone reacts to the message the loop will continue. If not within the 30 second timeout it breaks the loop and it will no longer wait for emojis

shadow wraith
#

so it doesn't endlessly edit the msg, air (am i right?)

#

when the user has reacted

#

it should edit the message once

#

not how much letters are there in the bee script into edits

clear pebble
#

how to switch lines when ur bot is sending a long message?

shadow wraith
#

\n

#

that's for new lines

clear pebble
#

ok like

await.message.channel.send('message' + '/n' + 'message' 
#

like that?

shadow wraith
shadow wraith
#

you don't need a plus

#

"for example:\nthis works!"

sage otter
#

It does whatever you make it do whenever someone reacts to the message

clear pebble
#

thanks

slate swan
unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

001 | hello
002 | world
sage otter
#

The loop is just something that will make it continue to listen for someone to react to the message. Like, thats all it does.

shadow wraith
#

well after the reaction and edit it sends a message x]

#

which is not an error one

#

its just the success = await ctx.reply(f"Word: {word}\nWhat rhymes: {rdn}") from my code

sage otter
#

well yeah then ig, everytime someone reacts it will do that.

shadow wraith
#

aw man so i can't remove that? :[

sage otter
#

I mean, if you dont want it to endlessly keep sending messages everytime someone reacts just take it out of the loop.

shadow wraith
#

tru tru so at the else: statement where the reaction action is

loud junco
shadow wraith
loud junco
#

but normal we call it ctx not message

shadow wraith
loud junco
#

oo

sage otter
#

Message.channel.send

shadow wraith
#

^

loud junco
#

ok i get what u mean now

shadow wraith
#

sends a message in the channel

#

that's why it's message.channel.send

loud junco
#

...

#

they are the same thing

shadow wraith
#

message.reply does the same except just replies

loud junco
#

just with different names

#

message is ctx named mesage

#

:/

shadow wraith
#

well this is an event so it'd be weird to add ctx here

loud junco
#

idk what about in an event

#

nvr try that before

shadow wraith
#

message.reply exists

#

!d discord.Message.reply

unkempt canyonBOT
#

await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").

New in version 1.6.
loud junco
#

:/

shadow wraith
#

it's similar to your response

#

it's like ctx.reply in an on_message event

loud junco
#

ya

#

message is ctx

#

but different name

slate swan
#

not really

loud junco
#

:/

slate swan
#

ctx is short for commands.context

shadow wraith
#

nobody saw that

slate swan
#

i forgot

loud junco
#

maybe my mistake

slate swan
loud junco
#

maybe

slate swan
#

in this case the class commands.Context

#

thats why sometimes you see

@bot.command()
async def command(ctx: commands.Context) -> None:
    await ctx.send("msg")
slate swan
#

its 4am give me a break

shadow wraith
#

async command 💀

slate swan
#

and im on mobile

slate swan
shadow wraith
#

if it was 1 hour earlier then 💀

slate swan
#

¯\_(ツ)_/¯

shadow wraith
#

3am moment

slate swan
#

lol

shadow wraith
#

ill remember you typed async command

slate swan
tiny ibex
#

I wonder if I can attach a file inside embed ?

shadow wraith
slate swan
#

!d discord.File

unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
tiny ibex
slate swan
tiny ibex
shadow wraith
#

use embed links perm

slate swan
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
tiny ibex
shadow wraith
#

i don't think you can...

tiny ibex
slate swan
shadow wraith
#

you could always set the wav file above the embed

tiny ibex
shadow wraith
#

as the content

slate swan
#

oh a wav file😭

#

im going to go to sleep Gn guyspithink

shadow wraith
#

good morning guys

shadow wraith
#

no jk its morning in my country rn

slate swan
tiny ibex
slate swan
#

its 4am so ig

slate swan
slate swan
shadow wraith
#

!paste

unkempt canyonBOT
#

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.

shadow wraith
#

wait fuck

#

that's my entire bot code 💀

tiny ibex
loud junco
loud junco
#

wdym

shadow wraith
#

check it

sage otter
visual island
shadow wraith
sage otter
#

I honestly don’t understand what’s going on with your stuff anymore.

#

Like can you explain what you wanna do with this command again.

shadow wraith
#

oh yeah alright

#
  • look for a rhyming word with the word given
  • it sends the word and rhyming word with the word
  • adds a 🔄 reaction to get another rhyming word
  • yeah i forgor but i think that's it
rancid light
#

How can i get all the guild id the bot is in?

sage otter
visual island
#

[guild.id for guild in bot.guilds]

sage otter
#

That map should cover everything you want.

shadow wraith
rancid light
maiden fable
sage otter
#

Do the bot.wait_for() in the loop. As well as the message editing.

#

Or it’s not gonna continuously wait for reactions. Like you want it to.

shadow wraith
#

the try statement, the except statements, the else statement

sage otter
#

ok if you did all that and followed the map I just gave you. Everything you want from that command should happen, no?