#discord-bots

1 messages · Page 84 of 1

slate swan
#
client.on("message", message => {
    if (message.channel.id !== "ChannelID") return false;

    // Execute your commands here
}); ```
primal token
#

It makes you look like a fool no offense, given old code as "help"

slate swan
#

is

#

its more discord.js....

slate swan
#

ok but still can someone actually help me w my pasted code like fr i was playing around but stil

slate swan
#

ye

#

u told me to put value but never told me where

naive briar
#

at line 88

slate swan
#

so like this?

meager chasm
#

Why r u guys helping such an obvious troll lol, just ignore them

slate swan
#

invalid syntax at 2 dots and 1 ,

slate swan
meager chasm
#

You don't put them there literally

slate swan
#

i can still send dms to bot and its still replying

paper sluice
slate swan
#

dots 😔

#
async def luckboost(ctx):
  pfp = ''
  em = discord.Embed(color=800000)
  em.set_thumbnail(url=pfp)
  em.set_footer(text="d")
  em.add_field(name= "Luckboost")
  await ctx.reply(embed=em) ``` **Someone please tell me where i put the value **
slate swan
#

ok
the em.add_field

slate swan
slate swan
placid skiff
slate swan
#

bro im so confused

slate swan
placid skiff
#

!d discord.Embed.add_field

unkempt canyonBOT
#

add_field(*, name, value, inline=True)```
Adds a field to the embed object.

This function returns the class instance to allow for fluent-style chaining. Can only be up to 25 fields.
slate swan
#

how do i make a bot ignore dms? or close dms

#

BRO NOW IVE GOT A ERROR IM ABT TO CRY OML

placid skiff
#

!d discord.ext.commands.guild_only

unkempt canyonBOT
#

@discord.ext.commands.guild_only()```
A [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that indicates this command must only be used in a guild context only. Basically, no private messages are allowed when using the command.

This check raises a special exception, [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").

If used on hybrid commands, this will be equivalent to the [`discord.app_commands.guild_only()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.guild_only "discord.app_commands.guild_only") decorator. In an unsupported context, such as a subcommand, this will still fallback to applying the check.
placid skiff
#

value must be a string

slate swan
pseudo spoke
#

I made a tic tac toe bot with python :P

slate swan
#

ok

primal token
slate swan
slate swan
#

Ellipses seems so cool to just say 😳

placid skiff
#

If you don't know python then you should not use d.py

slate swan
placid skiff
#

it is not beginner friendly

slate swan
placid skiff
#

Because that is spoonfeeding, here we discuss about discord bots, resolve problem/issue, help people to learn

#

We do not spoonfeed D_D

slate swan
slate swan
vocal snow
placid skiff
#

i literally gave you the docs, just read it D_D

primal token
placid skiff
slate swan
#

and u cant ban me for that since its a medical term

blissful lagoon
#

@slate swan don't use ableist language

#

and please be less rude and annoying to people that you're asking for help

#

you can check out our #code-of-conduct if you have questions about our expectations

slate swan
blissful lagoon
#

you can either ask for help or not, that's up to you

#

following our code of conduct is not optional though

slate swan
#

as i just said ive asked for help everyones giving me code that gives me errors

placid skiff
#

we helped you, but your python, generally coding, knowledge is not enough, you'll have to study more, and in this discord you will found people that will help you learn, but if we just give you some code that you don't even understand you will never learn

hollow badger
#

It's clear your Python ability doesn't match your ambition to create a bot. This is not a slight, Discord bots aren't considered a beginner project. May I suggest you get up to speed with something like Automate the Boring Stuff or other beginner resources.

#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#

no

slate swan
primal token
#

Being so stubborn and ignorant wont make you any better or get you any help so please refer to the help given to you by the small group of people over being annoying to others.

slate swan
#

Help please!?

dull terrace
slate swan
#

How to make a bot send a embed at first then delete it?

slate swan
proper fossil
#

idk

slate swan
hollow badger
slate swan
#

How to make a bot send a embed first then delete it?

sick birch
#

!e print(this_variable_does_not_exist)

unkempt canyonBOT
#

@sick birch :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'this_variable_does_not_exist' is not defined
sick birch
#

Look familiar?

slate swan
#

How to make a bot send a embed first then delete it?

dull terrace
paper sluice
#

!d discord.TextChannel.send

unkempt canyonBOT
#
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=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/latest/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.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/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/latest/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.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
paper sluice
#

^ it has a delete_after kwarg, use that

slate swan
#

Please help

sick birch
sick birch
#

There’s the problem

#

Making discord bots is not a good idea if you don’t know what variables are

#

In short it’s a container that holds a value

unkempt canyonBOT
#

Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

dull terrace
#

Neat, thanks

silk fulcrum
#

thanks for luck, I won in drawn or even lost position :)

slate swan
sick birch
#

We are helping, you’re just not very receptive, no offense

primal token
ripe jackal
#

Hello guys I am trying to make a command in Nextcord which helps me type thru the bot. (the command is in a cog) Whenever I run the command I get this error:

nextcord.ext.commands.errors.BadArgument: Converting to "nextcord.channel" failed for parameter "channel_id".```

And this is the code:
```python
   @commands.command()
   @commands.has_permissions(manage_messages=True)
   async def send(self, ctx, channel_id: nextcord.channel,*,msg):
       channel=self.bot.get_channel(channel_id)
       await channel.send(f"{msg}")```
sick birch
silk fulcrum
#

not nextcord.channel

primal token
silk fulcrum
#

and I think it's nextcord.Channel

primal token
sick birch
#

As far as a high level programmer is concerned a box that holds a valid is good enough even if that’s not what it actually is

meager chasm
#

It has always been. You're referring to an identifier

#

Variables have always referred to spaces in memory which hold data.

primal token
#

?

sick birch
primal token
meager chasm
#

And the container is called a variable. So how was he wrong

ripe jackal
glad cradle
#

battle essays about variables

silk fulcrum
sick birch
#

I agree it’s not entirely correct, but the point was to explain how it can be thought of on a higher level

primal token
meager chasm
#

I didn't say its a container pointing to an address.
An identifier points to some space in memory. That space (container) is the variable.

sick birch
#

You don’t need to know how references to mem addresses work, just that it holds a value to be able to use it

primal token
#

You're literally proving my point, please read up on my points as maybe you misunderstood my point

silk fulcrum
#

i think this is not the topic of this channel 🗿

meager chasm
#

it's a container that holds a value
i.e, a variable

primal token
meager chasm
#

No, i would consider that as the identifier/address

primal token
#

Thats literally what i said

meager chasm
#

Although I suppose while talking about programming those two terms are used quite interchangeably

primal token
meager chasm
#

☺️

paper sluice
#

Variables in python are like variables in math 🗿

primal token
paper sluice
#

You don't have to worry about whats happening behind the scenes

placid skiff
#

bruh what are you all talking about D_D

silk fulcrum
pulsar solstice
#
@commands.command()
async def hi(self, ctx):
  await ctx.send('hi')```
#

why am I getting this error

#
TabError: inconsistent use of tabs and spaces in indentation```
placid skiff
#

!pep8

unkempt canyonBOT
#

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
PEP 8 document
Our PEP 8 song! :notes:

faint sapphire
#

only when discord bans accounts themselves
im talking ab bots banning ppl from guilds
they just use alts to join back

so for ppl who self bot ect, i need to ip ban them

placid skiff
#

you can't ipban

faint sapphire
#

no, u can just make an alt discord

#

and thats the problem i have, i got ppl joining pormoting financial scams, ppl cookie logging/ beaming server members acc

pulsar solstice
placid skiff
#

Senev is right, bans are ip-based

pulsar solstice
#

what does it even mean

placid skiff
#

if they join again probably the selfbot are under VPN

faint sapphire
#

bro i have like 7 discord alts
when u get banned from a guild u can just use an alt

faint sapphire
placid skiff
faint sapphire
#

i said guild ban

#

bruh

placid skiff
#

Like a captcha verification or something

faint sapphire
#

no, discord can ban users ip

faint sapphire
#

so is ip banning from my server feasible

#

with a discord bot

placid skiff
faint sapphire
#

listen, when u ban a member from your discord server
it isnt an ip ban

when u report a person to discord support and that they ban them, then it is ip ban

#

my case is: banning scammers from my server
though they can rejoin
so im looking at possibilities to ip ban individuals

#

since when

#

did that come out last week?

#

then maybe, otherwise it has never been the case bruh

#

have u even tried yourself

#

u rly think i would talk ab this without knowing ppl can rejoin

#

bruh

#

but if i ip ban them, itll surely stop some

#

even if others use vpn

#

ig i can also make it so, ppl using vpns cant use the server
by collecting ips of free vpns

placid skiff
#

Bro when you ipban someone you ban that account and you don't let other people with the same ip joining the server

#

but if the one that has the same ip changes that ip, it will be able to join with another account

faint sapphire
placid skiff
#

just to clarify:

faint sapphire
#

let me ask you, have u ever gotten banned somewhere, and tried rejoining with an alt

placid skiff
#

i have user_1 in my guild, i ban him
now user_1 create the account user_2 and tries to join my guild with user_2, he can't because he has the same ip as user_1
Now, him joins a VPN, so his IP has now changed, now he can join the guild again using the account user_2

faint sapphire
placid skiff
#

the ipban doesn't mean that it bans all the users with that ip, it just bans the account that is banned, then deny the same ip to join the guild again

faint sapphire
#

i have 7 alts, ive gotten banned like 10 times in places, every time i could rejoin with an alt with the same ip

placid skiff
#

what i mean is that if you check the user ban list in your guild you will only see the one banned

faint sapphire
placid skiff
faint sapphire
#

ive been doing that since 2019 with a bunch of alts bruh

#

i got banned so often in servers

#

and rejoined with same ip

maiden fable
#

Nice

#

#ot3-discord-bots

faint sapphire
#

but if you havent done it urself why u keep contradicting me
i have 3 years of experience with what im talking ab

maiden fable
#

Let's just drop this...

faint sapphire
#

ask a mod here

#

ima look for a staff member in general

slate swan
#

Hello! I have some issue right now with my bot. "**chunk = f'{len(chunk):X}\r\n'.encode('ascii') + chunk \ **
TypeError: can't concat dict to bytes

Do you guys know what happens? (So my bost isn't responding over discord once I've type the command)

#

guys u can join from alt if u got bannedby using a vpn @faint sapphire

#

if u got banned from s erver

faint sapphire
#

with same ip im saying

slate swan
#

yeah u can but u cant if u got ip banned

#

theres a command called "hackban" to ip ban

faint sapphire
#

so u agree normal ban with discord command doesnt actually ip ban

faint sapphire
slate swan
faint sapphire
#

is that new?

slate swan
#

or wick

faint sapphire
#

oh u need premium right

slate swan
#

nah its a bot feature

#

nope

strong crow
#

How does that IP ban somebody?

faint sapphire
#

wait i need to find this command

slate swan
#

i lowkey dont know but the command is made to ip ban

#

nope

faint sapphire
#

man u a clown at this point

#

this guy just confirmed

#

i just found carl bot has hackban

slate swan
#

let me tell u my honest opinion , it happens that some countries have default ip ban and some dont

faint sapphire
#

wow

#

bruh

slate swan
#

so ig id give it rigjits true

#

its true

static epoch
faint sapphire
#

i think its possible to get passed vpns to get ips

static epoch
#

can we settle that and let this channel return to it's topic now?

slate swan
#

yes

faint sapphire
slate swan
#

@faint sapphire dm

strong crow
ripe jackal
#

Hello guys I am trying to make a command in a cog, using Nextcord and wait_for is playing with me. On this command

    @commands.command()
    @commands.has_permissions(manage_messages=True)
    async def embedsend(self, ctx):
        def check(message):
            return message.author == ctx.author and message.channel == ctx.channel
        await ctx.send('Waiting for a title')
        title = await self.bot.wait_for('message', check=check)
        await ctx.send('Waiting for a description')
        desc = await self.bot.wait_for('message', check=check)
        await ctx.send('Channel ID')
        channel_id = await self.bot.wait_for('message', check=check)
        channel = self.get_channel(int(channel_id.content))
        embed = nextcord.Embed(title=title.content, description=desc.content, color=nextcord.Color.green())
        await channel.send(embed=embed)```

I get this error: https://paste.nextcord.dev/?id=1663170800138361
And if someone know how to deal with it please help me I'm so stuck
vocal snow
#

can you send your full code?

ripe jackal
#

it's 2k+ lines in different cogs

vocal snow
#

are you using threading/multiprocessing anywhere?

ripe jackal
#

Sorry, I don't know what is that.

vocal snow
#

are you creating more than one event loop?

ripe jackal
#

I think yes

vocal snow
#

could you show where (and why)

ripe jackal
#

I am not sure why, but I got it in my moderation cog (where is the command) and my main.py file
This is it python asyncio.set_event_loop(asyncio.new_event_loop())

vocal snow
#

that would explain things

#

you should remove that, it is causing the problem

#

only have it in the main.py file where you're probably creating the main event loop

ripe jackal
#

I get the same error If both are removed and if it's only in main.py

#

the error shows when I run the command

vocal snow
ripe jackal
#

will send in dms

vocal snow
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.

somber ferry
#

Hello, i'm using discord.py library for make a bot. I'm using cogs for the music bot, but when i do command like !join !play appear an error: discord.ext.commands.errors.CommandNotFound: Command "play" is not found.

Someone can help me?
(Please tag me)

somber ferry
#

Oh, sorry

#

Why if can i ask?

cloud dawn
#

It violates YouTube terms of service.

somber ferry
#

And in any case this problem arises for every cog 👀

somber ferry
#

that

slate swan
#

guys i need help

faint sapphire
#

with my disc bot, i can use the bots loop, to couroutine a "wait 1 hour" function to run another function every hour yh?
or is it rly that much better to use another bot in a server, that sends a message

every hour, that triggers my bot to run the desired function
(dyno can send messages every hour automatically)

faint sapphire
#

but then i rely on dyno so idk

sick birch
#

I’ve tested

#

I can’t join with alt on the same computer, but using a VPN works

faint sapphire
#

well 2 legit bots have ip ban command for premium users, bloxlink and rover

#

and a server using one of them, made it so i was actually ip banned

#

unlike others

sick birch
#

An IP ban is a regular ban, not sure why they put that under premium lol

faint sapphire
#

well other servers using carl bot, dyno, ect, never rly ban me

vocal snow
#

easy scam lmao

sick birch
#

Fr

sick birch
#

Use the tasks extension

faint sapphire
#

from asyncio?

sick birch
faint sapphire
#

ok

cloud dawn
#

Well I guess big bots that have people connect their account to their website could get a connection between ip and the discord user to essentially ip ban you.

faint sapphire
#

so i have to make 2 functions yh
one that lasts 1 hour
then the desired function

#

actually both in one

sick birch
cloud dawn
faint sapphire
#

not rly

#

bro im not the only one saying this here

cloud dawn
#

iirc they aren't.

sick birch
faint sapphire
#

this is rly weird

sick birch
faint sapphire
sick birch
#

The second I turn on a VPN though..

cloud dawn
faint sapphire
#

are like 50% of routers using dynamic?

sick birch
#

ISP dependent

cloud dawn
sick birch
faint sapphire
#

like using same wifi, same device, i could rejoin servers with alts
but in a server using ip ban premium command, with same wifi, same device, i couldnt rejoin with alt

sick birch
#

Can you provide an example of a bot with a premium ip ban command?

#

As far as I know the API doesn’t take any options as to IP banning or not

faint sapphire
#

rover, and bloxlink

sick birch
#

I’ve never heard of those 2

faint sapphire
#

check this though

sick birch
#

Either placebo, bullshit, or both

faint sapphire
#

rover and bloxlink are roblox based bots, they require u to go on their website to verify ur roblox acc

#

so thats how ig

cloud dawn
sick birch
#

Regardless IP banning a bot account spamming your server ain’t going to do much to abate it

faint sapphire
#

a guy said bans arent ip bans everywhere
so prob not in eu

cloud dawn
#

Well they would also ban your roblox account so not many people would even hassle to get around it. Also we're talking about <14 people

faint sapphire
#

actually youre right

#

theyre prob using the verified roblox accounts to determine they can rejoin

cloud dawn
#

Not that, that would stop me.. i.. like to watch it burn 🐒

faint sapphire
faint sapphire
#

im lost lol

thorn seal
#

how to i mention a user without ctx

sick birch
#

Do you have their ID?

cloud dawn
sick birch
#

I don’t think any of us were very intelligent at 12

cloud dawn
faint sapphire
#

at 12, best thing i had was a nintendo ds
actually i had an archos tablet, but yh lol

thorn seal
faint sapphire
#

my best friend tho, was programming on a mac since he was 8 lol

cloud dawn
cloud dawn
faint sapphire
#

mac is okay wuab

faint sapphire
#

idk his parents gave him their spare comp

cloud dawn
thorn seal
#

how do i mention a user without ctx

faint sapphire
#

so theres no point for me to find a way to fetch the ip of a person i wanna ban
cause it would be exactly the same thing as discord guild bans
but those bans clearly almost never work (apparently bc they got dynamic ips)

so anyone got an idea how i could more effectively keep banned members away?
through a website ig, with cookies?

#

why so many ppl use slash commands

cloud dawn
#

You passed the class as text, do view=view

cloud dawn
#

True but you are passing the repr of the object since you send it as a string. So inside the ctx.response use the view kwarg to specify that what you are passing is a drop down menu.

slate swan
#

?

cloud dawn
faint sapphire
#

use heroku instead btw

paper sluice
#

replit uses poetry

faint sapphire
#

idk why theres so many haters (i read the first message in discord bot hosting), but heroku is great for me
if u just a beginner its cool

#

ik it stops its free thing in november, but they say they have plans for student benefits

faint sapphire
#

aka free hosting

#

idk bro, just use message.content lmfao

paper sluice
faint sapphire
#

slash commands arent necessary
its easier to use prefixes imo

#

on my phone slash commands dont work too, might be cause discord aint up to date idk

#

i havent manually updated it since 2020

paper sluice
faint sapphire
#

i wasnt answering to something in ur code directly, i was talking ab a diff method

paper sluice
primal token
# primal token How?

Slash commands have their own GUI abstractions over prefixed message commands like how isnt that enough to know they are better?

vocal snow
#

you aren't instantiating the DropdownColours class

#

You use parentheses and pass the parameters required by it

#

Like how you call a function

#

i did... instantiate the class

#

hi nova

#

how are you doing

grim oar
#

bussin

vocal snow
#

:D

vocal snow
#

what do you mean "no" lol

#

nvm lol why do i even bother helping people here

slate swan
#
@client.event
async def on_member_join(member):
    with open('guilds.json', 'r', encoding='utf-8') as f:
        guilds_dict = json.load(f)

    channel_id = guilds_dict[str(member.guild.id)]
    await client.get_channel(int(channel_id)).send(f'{member.mention} welcome to the Otay! Support server! Enjoy your stay!:tada:')


@client.command(name='welcome')
async def set_welcome_channel(ctx, channel: discord.TextChannel):
    with open('guilds.json', 'r', encoding='utf-8') as f:
        guilds_dict = json.load(f)

    guilds_dict[str(ctx.guild.id)] = str(channel.id)
    with open('guilds.json', 'w', encoding='utf-8') as f:
        json.dump(guilds_dict, f, indent=4, ensure_ascii=False)
    
    await ctx.send(f'Sent welcome channel for {ctx.message.guild.name} to {channel.name}')

Saves a welcome channel but doesn't send a message when someone arrives.

thorn seal
#

'startTime is not defined'

paper sluice
#

can you show the line above on_ready?

grim oar
slate swan
grim oar
#

oh im blind

#

enclose client.get_channel in brackets

#

await (client.get_channel(int(channel_id))).send(f'{member.mention} welcome to the Otay! Support server! Enjoy your stay!:tada:')

slate swan
grim oar
#

it shud error

#

any errors

slate swan
#

if there were errors, I would not write here and it just isn't

grim oar
#

do you have any error handlers

slate swan
#

no

grim oar
#

hmm

#

its just not sending message right

#

the event is getting called?

slate swan
#

I just don't know what the error is

vocal snow
#

do u have member intents enabled

slate swan
#

yes

vocal snow
#

in code and dev protal

slate swan
#

yeah

grim oar
#

jeff is there an on_raw for this event 🤔

vocal snow
untold iron
#

Hey there im trying to create a command that creates a channel named Transaction, however i want it to also add a value e.g. Transaction1 if there is already a channel created called Transaction

#

That way there is never the same name for the new channel, it has a value added to it so it can be differentiated from the other channels

#

How can i go about doing this? Many thanks

wanton cipher
#

is there anyway you can have a interaction last for a certain amount of time only? (timeout only works after an interaction is made, it counts down that amount of time)

#

I tried by doing something like so...```py
class JoinView(disnake.ui.View):
message: Optional[disnake.Message]

def check_timeout(self) -> float:
    seconds = (self.end - datetime.datetime.now()).total_seconds()

    if seconds < 1:
        self.end += datetime.timedelta(seconds=1)
    return seconds if seconds > 1 else 1

@disnake.ui.button(label="Join", emoji="📥", style=disnake.ButtonStyle.blurple)
async def button_join(self, _: disnake.ui.Button, interaction: disnake.MessageInteraction):
    await interaction.response.defer()
    self.timeout = self.check_timeout()
#

but it's very unreliable, ticks over too far, and just... it works, but if and/or when it wants to instead of should

#

anyone have any ideas?

#

(ping if/when responding please)

slate swan
#

acc nvm what i said i didnt read ur message correctly ^

untold iron
#

Its alright ty tho

untold iron
slate swan
untold iron
slate swan
#

await

untold iron
#

Not sure what it means by awaited

slate swan
#

await channel.send

#

add the await before the channel.send

untold iron
#

Ohh understood

slate swan
#

np

untold iron
#

Tyvm

slate swan
#

np

slate swan
#

that code

slate swan
cloud dawn
#

I only see pseudo code.

#

It's not an if statement.

#

It's called ephemeral messages used by interaction.

slate swan
#

soemone said that

#

but it errors

cloud dawn
#

It's added when sending a message not in the embed.

slate swan
#

how the embed is:

await ctx.respond(
  embed=discord.Embed(embed shit yk)
)
#

after the brackets?

cloud dawn
#

yep

#

It's a kwarg of response not embed.

slate swan
wild spoke
#

Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: '2.webp

wild spoke
#

already fixed

rare echo
#

@cloud dawnlong time no see panda dance

slate swan
#

# Classes:
class Button(discord.ui.View):
    def __init__(self) -> None:
        super().__init__(timeout = None)
    
    # Left
    @discord.ui.button(label = 'Left', style = discord.ButtonStyle.blurple, custom_id = 'Left')
    async def Left(self, interaction: discord.Interaction, button: discord.ui.Button):
        if OCCUPIED['OWNERS'][interaction.user.id] is not None and OCCUPIED['OWNERS'][interaction.user.id].instance.id == interaction.message.id:
            await OCCUPIED['OWNERS'][interaction.user.id].update_direction('left')
                
    # Up            
    @discord.ui.button(label = 'Up', style = discord.ButtonStyle.blurple, custom_id = 'Up')
    async def Up(self, interaction: discord.Interaction, button: discord.ui.Button):
        if OCCUPIED['OWNERS'][interaction.user.id] is not None and OCCUPIED['OWNERS'][interaction.user.id].instance.id == interaction.message.id:
            await OCCUPIED['OWNERS'][interaction.user.id].update_direction('up')

    # Down
    @discord.ui.button(label = 'Down', style = discord.ButtonStyle.blurple, custom_id = 'Down')
    async def Down(self, interaction: discord.Interaction, button: discord.ui.Button):
        if OCCUPIED['OWNERS'][interaction.user.id] is not None and OCCUPIED['OWNERS'][interaction.user.id].instance.id == interaction.message.id:
            await OCCUPIED['OWNERS'][interaction.user.id].update_direction('down')

                

#

Why does this code disable every button for 3 seconds, upon a first button being clicked?

#

After every other button press, it works perfectly.

#

Does anyone know why?

wicked atlas
#

What code you have? The usual way to do it is

embed.set_image(url="https://www.linktoiamgemyreallycoolimage.com/reallycoolimage.jpg")
#

Looks fine, except you haven't created embed

quaint epoch
#

Uu closed brackets

#

Unclosed

#

Discord.Embed is an object

#

Class*

wicked atlas
#

set_image is a method of a discord.Embed object, which usually people put in a variable named embed, or something similar

quaint epoch
#

You need to instantiate an object from there

flint isle
#

uhh how can I run something when a forum post is created?

pliant gulch
#

!d discord.on_guild_channel_create

unkempt canyonBOT
#

discord.on_guild_channel_delete(channel)``````py

discord.on_guild_channel_create(channel)```
Called whenever a guild channel is deleted or created.

Note that you can get the guild from [`guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.GuildChannel.guild "discord.abc.GuildChannel.guild").

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

Forums are just channels, so they fall under this event. Just isinstance

wicked atlas
#

I think on_thread_create might be it. Forum channels use threads, not channels.

slate swan
#

how do i make a welcome command in a specific channel?

async def on_member_join(member):
    #main server
    if member.guild.id == 971319429461835836:
        await bot.fetch_channel(971319830064017458).send(f"Welcome {member.mention}, this is our main chat!", delete_after=30)```

im using pycord, and my previous code no longer works...
wicked atlas
#

In what way does it not work? If it's just not triggering, you may just need to enable member intents

wicked atlas
#

!intents

unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default discord.py has all intents enabled except for Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

intents = Intents.default()
intents.members = True

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

slate swan
#

its enabled already

wicked atlas
#

same im sure goes for pycord

slate swan
#

from discord import Intents
from discord.ext import commands

intents = Intents.default()
intents.members = True

bot = discord.Bot(intents=intents)

wicked atlas
#

Try putting a print statement in the event, see if it's triggering

slate swan
#

that code was from discord.py,
and i moved to pycord so its not working

wicked atlas
#

Why did you move?

umbral palm
#

So it's not triggering, eh?

#

Do you get any errors from it, or is it just nothing?

slate swan
slate swan
#

its just not triggering

umbral palm
#

If you copied this over and it worked before, that means the IDs have to be the same...

slate swan
#

yeah its the same thing from my v1 code

wicked atlas
slate swan
umbral palm
wicked atlas
#

It was no longer maintained, until the guy came back

umbral palm
#

that retirement was not even six months in length

wicked atlas
#

yeah, was more surprised by the comeback than the retirement

umbral palm
#

eeyup

slate swan
#

its discountinued already

umbral palm
#

According to what

slate swan
#

search on google

umbral palm
#

because the github is still getting issues
and the master branch got merged onto like 2 days ago

#

it's plenty active

slate swan
#

so how esactly do i fix this issue? in pycord

umbral palm
#

That's what I want to find out as well... it's small, so there shouldn't be that many places to look

slate swan
#

is the code correct though?

umbral palm
#

no, since the new libs came up around the time v2.0 was released

#

and likely implemented the planned changes as a starting point

umbral palm
#

no meaning it's not likely to be the source of the problem in my eyes

slate swan
#

then how do i fix it? if there are no errors

umbral palm
#

I'm trying to figure it out

slate swan
#

ok

pliant gulch
#

At face value from the information you have given us, it looks like there could only be two issues as to why it doesn't trigger. You could either have passed the intents incorrectly, or member.guild.id is being compared to the wrong guild ID

flint isle
#

how can i await a forum tag edit and check to see if it has a specific tag

pliant gulch
#

If you 100% know it still wouldn't hurt to check

#

And be sure to check the id you are comparing member.guild.id too

slate swan
#

its all correct

pliant gulch
naive briar
slate swan
slate swan
# pliant gulch Can you show the output of the print?

Warning (from warnings module):
File "/Users/bai/Documents/Personal Things/Do not delete/Only viewable by me/Aww Pika Discord Bot/script/main/aww pika discord bot v2.py", line 43
await bot.fetch_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
RuntimeWarning: coroutine 'Client.fetch_channel' was never awaited
Ignoring exception in on_member_join
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/Users/bai/Documents/Personal Things/Do not delete/Only viewable by me/Aww Pika Discord Bot/script/main/aww pika discord bot v2.py", line 43, in on_member_join
await bot.fetch_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
TypeError: coroutine.send() takes no keyword arguments

naive briar
#

!e

from asyncio import run

async def some_func():
    return [10]

async def main():
    await some_func().append(0)

run(main())
naive briar
#

Weird

pliant gulch
#

The precedence is causing the issue here

#

If you use parenthesis it'll fix it

pliant gulch
#

await (await fetch()).send(...)

#

I'm not sure if it's needed to even fetch for each member joined

#

The cache should be valid for the guild

#

Since GUILD_CREATE events

slate swan
#
async def on_member_join(member):
    #main server
    if member.guild.id == 971319429461835836:
        await (await bot.fetch_channel(971319830064017458)).send(f"Welcome {member.mention}, this is our main chat!", delete_after=30) #main channel```
#

its still not triggering

twin mantle
#

not triggering or not sending?

slate swan
#

i realised that i forgot to import tasks from discord.ext 😅

twin mantle
#

i have an error which includes the word tasks

#

might as well try importing that too lmaooo

#

nop

slate swan
#

How do I complete an interaction?

sick birch
primal token
#

Doesnt deferring it respond to it?

slate swan
#

I do defer but then how come it doesnt work?

primal token
slate swan
#

@sick birch @primal token I fixed the issue of my buttons disabling 🙂

#

I just hadd to add interaction.response.defer() at the top

#

now... the only issue

#

is that there is a delay 😭

#
async def protocol(self) -> None:
        while self.lost is False:
            await self.move()
            await asyncio.sleep(self.DELAY)
primal token
#

What do you mean delay?

#

I think you arent reffering to asyncio.sleep, right?

slate swan
#

the thing doesn't update until after the move is done

sick birch
slate swan
#
async def move(self) -> None:
        
        # Update head
        y, x = self.DIRECTIONS.get(self.direction, (0, 0))
        self.head = (self.head[0] + y, self.head[1] + x)
        
        # Loss detection
        if self.head[0] < 0 or self.head[0] > (self.COLUMNS - 1):
            self.lost = True
            await self.CTX.channel.send(f'You lost! Your score was: {self.score}')
            return None
        elif self.head[1] < 0 or self.head[1] > (self.ROWS - 1):
            self.lost = True
            await self.CTX.channel.send(f'You lost! Your score was: {self.score}')
            return None
        
        # Apple eating
        if self.head == self.apple:
            self.body.insert(len(self.body) - 1, self.previous_head)
            self.generate_apple()
            self.score += 1
        
        # Body trail
        self.body.insert(0, self.previous_head)
        previous_body = self.body.pop()
        self.board[previous_body[0]][previous_body[1]] = ':black_medium_square:'
        self.previous_head = self.head
        
        # Update board
        self.update_board()
        await self.post(edit = True)
#

This is the function that changes direction.

sick birch
#

Does it take a significant amount of time? Should only be a second or less right?

slate swan
#
async def update_direction(self, direction: str) -> None:
            
        # Guardian statements
        if self.check_direction(direction) is False:
            return None
        
        self.direction = direction
        
        if self.started is False:
            self.started = True
            await self.protocol()
#

The direction change should be instant, but the movement should have a delay to give time for the user.

sick birch
#
            await asyncio.sleep(self.DELAY)

you have a delay set here, that's why your button won't update until this is done. I'm not fully understanding the issue at hand though

slate swan
#

Okay, I'm sorry for not explaining it well.

#

I get that there is a delay

#

but is there a way to make the direction update instantly, so that its not affected by the delay?

sick birch
#

It theoretically shouldn't since it's before the asyncio.sleep()

slate swan
#

hmm

#

Do you want to test it out?

#

Weird question, I know, but maybe that'll help explain it? Maybe I'm not doing it right

sick birch
#

I dunno. I'd rather have you just explain it

slate swan
#

Okay, let me see if I can try to explain it better, again I apologize for how stupid I am.

sick birch
#

No no, just a failure to communicate. If you can explain the problem I'll try my best to assist

slate swan
#

Basically, when I press a button,

#

It takes like 1 second to respond, and there are random delays in the game for some reason.

#

I do edit the message every 0.75 seconds, is that an issue? (This is only for one or two servers)

sick birch
#

I do believe you only get 5 message edits per 5 seconds

slate swan
#

I want the game to be uh.. as accurate to the real snake as possible, bt I get that discord is not the best game engine

#

Ah okay, so 1 edit a second?

sick birch
#

Probably a bit more just to be safe

#

Or you could do a thing where the snake moves each time you press a button, might be better. Design choice so it's up to you though

slate swan
#

so I'm trying to make it as accurate as possible to real snake.

#

RIGHT NOW IT WORKS PERFECTLY, so thanks robin 🙂

sick birch
#

My pleasure. Let me know if there's anything else I can help with 😄

slate swan
#

🙂 ❤️ Have a good night or day depending where you are from.

sick birch
#

Thanks. I've been having a rough day, that really helped

robust fulcrum
#

Guys how can I make my bot collect reactions from comamnd user till 2 minutes?

robust fulcrum
slate swan
#

Is there any UI i can improve?

sick birch
#

Maybe align the buttons like you'd see them on a keyboard?

#

Or in an + shape

robust fulcrum
robust fulcrum
#

Oh cool

drifting arrow
#

Whats the maximum discords my bot can be in before I am forced to use slash commands?

vocal snow
#

100 iirc

rare echo
vocal snow
rare echo
#

gotcha, thnx

austere vale
#

im trying to migrate my bot to my pc. what does Import "import name" could not be resolved Pylance(reportMissingImports) mean?

#

its giving me this error, even though i installed the modules through shell. how do i fix this?

vocal snow
#

!pypi keep_alive

unkempt canyonBOT
vocal snow
#

Is this what you're using? Are you sure it's installed?

ashen perch
austere vale
#

windows command prompt

ashen perch
#

In the documentation it says to do pip install keep-alive

#

So maybe try that?

austere vale
vocal snow
unkempt canyonBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

vocal snow
#

And then run your python script with python script.py

ashen perch
#

What python verssion u usng

slate swan
#

code:

@bot.event
async def on_member_join(member):
    #main server
    if member.guild.id == 971319429461835836:
        await bot.fetch_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
        await bot.fetch_channel(987268323731439646).send(f"{member.mention}, pls check out these giveaway channels!", delete_after=30) #giveaways info channel
        await bot.fetch_channel(971319847352950835).send(f"Welcome to the server! Please do remember to get reaction roles in #⟡💫・reaction-roles channel!") #main chat

error when someone joins:

await bot.fetch_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
TypeError: coroutine.send() takes no keyword arguments

now ive migrated to pycord, and im using slash commands
pls help here with my code

naive briar
slate swan
dull terrace
#

I did a Google and it look like it's get_channel not fetch_channel

naive briar
placid skiff
#

get and fetch are two different methods, get does a lookup within the internal cache, if it founds the required object, then the object is returned
fetch is an API call

slate swan
#
@bot.event
async def on_member_join(member):
    #main server
    if member.guild.id == 971319429461835836:
        await (await bot.get_channel(971319830064017458)).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
        await (await bot.get_channel(987268323731439646)).send(f"{member.mention}, pls check out these giveaway channels!", delete_after=30) #giveaways info channel
        await (await bot.get_channel(971319847352950835)).send(f"Welcome to the server! Please do remember to get reaction roles in [#971319865623318528](/guild/267624335836053506/channel/971319865623318528/) channel!") #main chat
#

is it like this?

naive briar
#

Yeah, like that

slate swan
#

do u mind helping me test it out?

#

by joining and leaving

naive briar
#

No

slate swan
#

ok then ill ask my friend to help, thanks anyways

dull terrace
slate swan
# naive briar Yeah, like that

await (await bot.get_channel(971319830064017458)).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
TypeError: object TextChannel can't be used in 'await' expression

naive briar
slate swan
#

so how do i fix it?

naive briar
#

If you want to use that

#

Get the await out

await bot.get_channel(...).send(...)
slate swan
#
@bot.event
async def on_member_join(member):
    #main server
    if member.guild.id == 971319429461835836:
        await bot.get_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30) #proofs channel
        await bot.get_channel(987268323731439646).send(f"{member.mention}, pls check out these giveaway channels!", delete_after=30) #giveaways info channel
        await bot.get_channel(971319847352950835).send(f"Welcome to the server! Please do remember to get reaction roles in #⟡💫・reaction-roles channel!") #main chat

so is it like this?

naive briar
#

Ye

slate swan
#

u sure this will work?

naive briar
slate swan
#

it works thanks so much @naive briar

slate swan
#
ballresponses = ['It is certain',
                 'It is decidedly so',
                 'Without a doubt',
                 'Yes, definitely',
                 'You may rely on it',
                 'As I see it, yes',
                 'Most likely',
                 'Outlook good',
                 'Yes, signs point to yes',
                 'Dont count on it',
                 'My reply is no',
                 'My sources say no',
                 'Very doubtful',
                 'Reply hazy, try again',
                 'Ask again later',
                 'Better not tell you now',
                 'Cannot predict now',
                 'Concentrate and ask again']

@bot.slash_command(name="8ball", description="ask anything!")
@commands.cooldown(1, 10, commands.BucketType.user)
async def eightball(self, question):
    await ctx.respond(random.choice(ballresponses))

error:

   raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NameError: name 'ctx' is not defined
naive briar
maiden fable
#

And u dont have ctx in a slasg command anyways

placid skiff
#

my god D_D

#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

maiden fable
slate swan
# naive briar You didn't define `ctx`

is it like this

@bot.slash_command(name="8ball", description="ask anything!")
@commands.cooldown(1, 10, commands.BucketType.user)
async def eightball(ctx, self, question):
    await ctx.respond(random.choice(ballresponses))```

like this?
placid skiff
maiden fable
#

Btw @placid skiff while converting that Java code, did u get Overflow errors? 👀

naive briar
maiden fable
#

Because sized arrays

naive briar
#

Idk why they call it ctx

maiden fable
#

Because it's... py-cord

slate swan
#

so how do i fix it

naive briar
slate swan
#

fixed it already thanks
async def eightball(ctx, question):

maiden fable
#

@vocal plover we NEED an answer

#

Nice u writing a paragraph

placid skiff
# maiden fable Btw <@704973651698778225> while converting that Java code, did u get Overflow er...

Yup, i had to do this essentially to make them "adimensional"

public void adimensionalArrays() {
  int totalLength = 0;
  File dist = new File("some_dist/");
  File[] toSearch = dist.listFiles();
  while(toSearch.length != 0) {
    File nextFile = toSearch[toSearch.length -1];
    toSearch = removeValue(toSearch, nextFile); //This is a method that i used to remove the last element from the array, it returns the same array without that elemet
      if(nextFile.listFiles().length != 0) {
          totalLength = toSearch.length + nextFile.listFiles().length;
          File[] toAdd = nextFiles.listFiles();
          File[] result = new File[totalLength];
          System.arraycopy(toSearch, 0, result, 0, toSearch.length);
          System.arraycopy(toAdd, 0, result, toSearch.length, toAdd.length);
          toSearch = result;
      }else{
        //The rest of the code
      } 
  }
}
maiden fable
#

Thanks for the overflowing information I have lost the ability to understand anything now

placid skiff
#

Now you've lost years of experience too

slate swan
#
@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        em = discord.Embed(title=f"Hey, please slow it down!", description=f"Try again in {error.retry_after:.2f}s")
        await ctx.respond(embed=em)```

this isnt working
instead of letting it send "application did not respond"
when user on cooldown, i want it to send this embed
#

pls help here

placid skiff
#

I had a sort of timer handled with the uC internal timer, so I made a function to check, when the millis goes overflow, if x time was passed from max_internal_timer to actual_internal_timer smth like that

placid skiff
# slate swan ```python @bot.event async def on_command_error(ctx, error): if isinstance(e...

It's because another error is raised but you are not handling it, you are only handling one exception ignoring all the others.
You will need to add an else statement that will handle all unhandled exception, using this code to get the traceback of the error

import sys, traceback

#your code
else:
  print(f"Ignoring exception in {ctx.command.name}", file=sys.stderr)
  traceback.print_exception(type(e), e, e.__traceback__, file=sys.stderr)
  await ctx.send("An unknown error occurred while executing this command")

Then you can check your console for the full traceback

vocal plover
placid skiff
#

Probably he wanted to mention me LMAO

vocal plover
unreal halo
#

Anyone wanna help me test my discord bot? Note: you will be invited to a server. If so please dm me

maiden fable
delicate hornet
#
import requests

t = ''
url = 'https://discord.com/api/v10/users/@me'
print(f'Authorization: Bot {t}')
print(requests.get(url, headers={'Authorization': f'Authorization: Bot {t}'}).json())

im trying to get the current users info
t is the bot token

{'message': '401: Unauthorized', 'code': 0}
naive briar
spring needle
#

How to add custom emoji from a server that has the bot into SelectOption?

vocal plover
#

I dont have time to read a ton of messages of context kek

maiden fable
vocal plover
#

So the question being asked is why the word 'ctx' is used in commands?

maiden fable
#

in slash commands, in py-cord lol

vocal plover
#

It's easier to just ask me what you want to know rather than sending me on a game of cat and mouse looking for messages

slate swan
#

its an ApplicationContext ez

vocal plover
#

idk I don't use or maintain pycord

#

my assumption would be that people are familiar with it so they keep using it

maiden fable
#

Wait, I thought u r one of the core devs

vocal plover
#

I've never touched pycord's code

maiden fable
#

mb sorry

slate swan
#

how to send a message as embed?then it delete itself then apears another embed

tropic burrow
#

why am i get too many requests? replit btw

#

the token line is errored btw

placid skiff
#

I name it itx, cuz interaction is too long and inter is ugly

robust fulcrum
#

Guys i want to make a game in my discord bot
Can anyone give me suggestion?

rugged shadow
#

terrible attempt at changing the subject but it worked i guess

ionic edge
#
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] <html><body><h1>502 Bad Gateway</h1>
The server returned an invalid or incomplete response.
</body></html>
: 0```
#
    @commands.command()
    async def status(self, ctx):
        r = requests.get("http://iphere/players.json")
        data = r.json()
        players = data["players"]

        embed = discord.Embed(title="UCRP FiveM Status", description="UCRP FiveM Status", color=0x00ff00)
        embed.add_field(name="Players", value=players, inline=False)
        print(players)
        await ctx.send(embed=embed)

robust fulcrum
rugged shadow
#

tic tac toe

slate swan
#

hi im making a discord bot and this is my embed

@bot.command()
async def payments(ctx, member:discord.Member = None):
    if member == None:
        member = ctx.author

    name = member.display_name
    avi = member.display_avatar

    embed = discord.Embed(title="Payment Methods", color=discord.Colour.dark_purple())
    embed.add_field(name="PayPal", value=" ![Paypal](https://cdn.discordapp.com/emojis/1013196734387720195.webp?size=128 "Paypal")  ``simonmorari@gmail.com``", inline= False)
    embed.add_field(name="Bitcoin", value="``17CneTWFPa1kfpAE1fL7TLV2g8hLgiJX1z``", inline= False)
    embed.add_field(name="Ethereum", value="``0xF39eF56a40b9BCadafc7e088499149970Fa75073``", inline= False)
    embed.add_field(name="Litecoin", value="``ltc1q2qkfakfzua4mawjt76lgvdwf79wnnrlwrupgaw``", inline= False)
    embed.add_field(name="Bitcoin Cash", value="``qpzqkmhcap5pltzskd3cr4tgn52a4xey2gm9mq3gaw``", inline= False)
    embed.add_field(name="Monero", value="``43eJkg3f9PqEsazFjEnDX1dib6AVJiBrtdCq5VmvJVyUghDtTTV5N1i2ZPBpxkom9UUtu6kkATN6wQ8YMpgB7AH8PizoDot``", inline= False)
    await ctx.reply(embed=embed)

bot.run('token removed for safety')``` and you can see im trying to put custom emoji in the footer for paypal but this is what it shows when command is ran ":Paypal : blah blah blah it doesnt show the emoji
robust fulcrum
placid skiff
rugged shadow
robust fulcrum
#

I can try making tic tac toe

robust fulcrum
rugged shadow
#

do it

robust fulcrum
placid skiff
rugged shadow
#

assuming by your past messages it would probably be really hard for you

placid skiff
unkempt canyonBOT
placid skiff
placid skiff
#

bruh really?

slate swan
#

yea

placid skiff
#

guild must be a guild object (discord.Guild), the id must be a valid emoji id and send is the method of the channel or the context (discord.TextChannel, discord.ext.commands.Context)

placid skiff
robust fulcrum
rugged shadow
#

mhm

slate swan
#

im new idk what ur saying

placid skiff
#

!resources then you should study this first. discord.py is not beginner friendly

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

robust fulcrum
#

How can I make the game board?

bold kernel
#

Hello, is it possible to pass a lists on args of a slash commands ?
something like when we pass async def member(ctx, member: discord.Member) but replace member with a lists ?

placid skiff
#

you mean that you want to take a list of members for example?

#

it is not possible either for a slash commands or a message command, with the slash you will have to take a string, tell the user that he has to mention one or more member, then use the split method and try to convert that mentions to a Member object, with the message command is pretty the same except for the argument that you set in the command

vocal snow
#

Slash commands don't support variadic arguments out of the box

bold kernel
#

i try it but TypeError: unhashable type: 'list'

placid skiff
placid skiff
#

!e

print(eval("[' ', ' ', ' ', ' ']"))
unkempt canyonBOT
#

@placid skiff :white_check_mark: Your 3.11 eval job has completed with return code 0.

[' ', ' ', ' ', ' ']
placid skiff
#

but you will need to get a string anyways, and then convert the string to a discord object

paper sluice
#

eval 👀

placid skiff
#

i've suggested, now is up to him LMAO

paper sluice
#

???

vocal snow
bold kernel
placid skiff
#

I was going to reply to him with a for loop in asm

slate swan
#

why not just make a custom converter lmao

placid skiff
#

It's the same thing, with a converter you will just have a converter that does it lmao

#

but anyways you will have to convert n strings to objects

slate swan
#

I know, I'm not so dumb

#

😭

slate swan
placid skiff
#

I didn't want to make you feel dumb pepe_sadman

placid skiff
slate swan
placid skiff
#

My teacher taught me to think as the dumbest person in the world D_D

slate swan
#

understandable why

whole sparrow
#
  File "c:\Users\rifat\Documents\Code\Discord Bots\mikkellind\cogs\example_cog.py", line 40, in confirm_button_callback
    await user.add_roles(role)
AttributeError: 'User' object has no attribute 'add_roles'
#

why does inter.author.add_roles(role) not work?

placid skiff
#

!d discord.Member.add_roles

unkempt canyonBOT
#

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

Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
whole sparrow
#

user = inter.author btw

placid skiff
whole sparrow
#

disnake

placid skiff
#

BRUH

#

full code?

whole sparrow
#

uhh

#

aight

slate swan
placid skiff
#

the command that raised the error lmao

whole sparrow
#

anyway to get past this issue?

placid skiff
#

oh so that's why

whole sparrow
#
    @commands.slash_command()
    @commands.dm_only()
    async def pro(self, inter:disnake.CommandInteraction, email):
        if db.check_if_pro_role_request(inter.author.id) is True:
            await inter.send(f"You already sent a request. Wait for an admin to review your request", ephemeral = True)
            return
        db.add_pro_role_request(inter.author.id)
        user = inter.author
        channel:disnake.TextChannel = self.bot.get_channel(config.CHANNEL_ID)
        approve_button = Button(label="Confirm", style=disnake.ButtonStyle.green)
        deny_button = Button(label="Deny", style=disnake.ButtonStyle.danger)
        
        view = View()
        async def confirm_button_callback(interaction:disnake.CommandInteraction):
            #### Embed you want to send
            embed = disnake.Embed(description = f"Your request has been accepted by {interaction.author.mention}", color = disnake.Color.green())
            ####
            await inter.author.send(embed=embed)
            approve_button.disabled = True
            deny_button.disabled = True
            embed = disnake.Embed(description = f"Pro role request", colour = disnake.Color.blurple())
            embed.add_field(name = f"User ID: {inter.author.id}", value = f"User:{inter.author.mention}\nEmail: {email}\nhttps://test.tld/{email}")
            embed.set_author(name=f"{inter.author.name}", icon_url=inter.author.display_avatar)
            embed.set_footer(text = f"Request has been approved by {interaction.author.name}#{interaction.author.discriminator}")
            await interaction.response.edit_message(embed=embed, view=view)
            role = interaction.guild.get_role(config.ROLE_ID)
            print(role)
            await user.add_roles(role)
            db.remove_pro_role_request(inter.author.id)
placid skiff
#

if the user cast the command in the guild it will return the member

#

oh is dm_only

#

then you will have to convert that user into a member

whole sparrow
#

How can I?

placid skiff
#

!d disnake.Guild.get_member

unkempt canyonBOT
placid skiff
slate swan
#

.author should automatically return a Member if it was a guild context tho

slate swan
#

!d disnake.Interaction.author

unkempt canyonBOT
slate swan
#

the user "or member" 🦀

placid skiff
#

don't know, you have emphasize USER so i taught of that D_D

whole sparrow
#

yeah makes sense,

whole sparrow
#

AttributeError: 'User' object has no attribute 'guild'

#

so ashley i believe will work

placid skiff
#

yeah you will need a guild object D_D

whole sparrow
#

whats the typehint for self.bot

#

i mean, whats the class of self.bot

slate swan
#

"ashley I believe will work" that sounds so wrong lmao

whole sparrow
#

so I can use autocomplete

slate swan
whole sparrow
#

lmao im speeding

#

tyyy

slate swan
#

wlcm

placid skiff
slate swan
placid skiff
#

you use self.bot in cogs too D_D

slate swan
#

where else do you guys use it 💀

whole sparrow
#
            await interaction.response.edit_message(embed=embed, view=view)
            role = interaction.guild.get_role(config.ROLE_ID)
            print(role)
            guild = self.bot.get_guild(inter.author.guild.id)
            member = guild.get_member(inter.author.id)
            await member.add_roles(role)
            db.remove_pro_role_request(inter.author.id)
            
#

This is what I have but it's not really working

#

wait im dumbasf

#

interaction.guild_id mb

slate swan
whole sparrow
#

:o it works :D lets gooo

#

ty @slate swan and @placid skiff

naive briar
slate swan
#

tvrsier is very helpful yes

#

I literally can't type tvrsier properly in the first try but works with an a instead of v smh

placid skiff
#

because the v is an a upside down D_D

#

||reveal of the year||

slate swan
#

very informative

placid skiff
#

i think that my nickname is older than you D_D

frozen iron
#

Any bot idea I can work on? or can contribute to any not so advanced python project

placid skiff
#

nah it's not that old, but it has more than 10 years so far D_D

slate swan
#

cringe

placid skiff
#

You can't say that it is cringe, you don't even know what a tarsier is D_D

slate swan
#

why not

#

iirc it's an animal? idk

placid skiff
#

Cuz it is cuuute

slate swan
#

yes it's an animal

#

why does that remind me of okimii

placid skiff
#

lmao

vocal snow
#

lmaoo

primal token
#

lmao

vocal snow
#

speak of the devil

primal token
#

?

vocal snow
#

nuthin ☺️

slate swan
#

imagine laughing at yourself

primal token
#

But i'm not him......?

slate swan
#

wasn't pointing you out

primal token
#

But you're directing a point undirectly?!?

vocal snow
#

we arent talking about u dw

slate swan
#

^

primal token
#

ok

placid skiff
#

yeah, people here only talk about me, or hunter, or sarth, or okimi D_D

primal token
#

Yeah, its weird how they talk all about them but never actually care about them, its odd and weird

placid skiff
placid skiff
slate swan
#

To the right of that game image

#

how can I add text

slate swan
#

OH ROASTED

dull terrace
#

also, how the heck are you planning to make snake work on discord?

slate swan
slate swan
#

It's kinda bad... but I'm still trying 😦

dull terrace
#

i mean, at scale my man

slate swan
#

Oh no, this is only for 2 discord servers.

slate swan
#

It's just a personal project

dull terrace
#

you can only do 50 edits across discord per second

#

oh, i see

slate swan
#

Again, would you like to try it?

#

I still need feedback on design

dull terrace
#

sure

primal token
slate swan
#

ok noid

cloud dawn
dull knot
#

Tryna make a HackBan Cmd. Here's the code:

    @commands.command(name="hack-yeet")#, description="Usage: Ban @user") 
    @commands.has_any_role("Shuma  ヽ(💢`Д´)ノ︵ ┻━┻","Head Administrator 🌪" , "Administrators 🗝", "ꔫ・˚꒱Staff ° .", "≧ω≦")    
    @commands.has_permissions(administrator=True)
    async def HackYeet(self, inter, user: int, reason='No Reason provided'):
            guild = disnake.Guild
            if user in guild.members:
                embed = disnake.Embed(title="", description=f":RAB: Kant be Kicced as User is in Server", colour = disnake.Colour.random())
                await inter.send(embed=embed, delete_after=10)
            else:
                await inter.guild.ban(disnake.Object(user), reason=reason)
                embed = disnake.Embed(title="", description=f"**:PAL: Reason: __{reason}__**", colour=disnake.Colour.random())
                embed.set_image(url= "https://cdn.discordapp.com/attachments/953108903049191424/1011220166232780830/BanHammer_2.gif")
                await inter.send(embed=embed, delete_after=30, content=f":BanHammer: <@{user}> has been Yeeted with a Ban Hammer")

And here's the Error:

    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: argument of type 'property' is not iterable

What I'm trying to do here is check if the user is in the server. If User is in server returns True, then it will send the Code in the if statement there. How can I make that work out?

#

Also, don't mind the Inter in the parameters. Will convert it to Slash Cmd after I fix this

cloud dawn
dull knot
#
Ignoring exception in command hack-yeet:
Traceback (most recent call last):
  File "C:\Users\Alliah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\disnake\ext\commands\core.py", line 172, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\Alliah\Desktop\VS Code\Neko-Nyan\Testing\TestCmds.py", line 55, in HackYeet
    if user in guild.members:
TypeError: argument of type 'property' is not iterable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Alliah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\disnake\ext\commands\bot_base.py", line 578, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Alliah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\disnake\ext\commands\core.py", line 914, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Alliah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\disnake\ext\commands\core.py", line 181, in wrapped
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: argument of type 'property' is not iterable
cloud dawn
dull knot
#

The bot will just ban users even if they're admins if that piece of code is not implemented

cloud dawn
#
from disnake import Member

@commands.command(name="hack-yeet")#, description="Usage: Ban @user") 
@commands.has_any_role("Shuma  ヽ(💢`Д´)ノ︵ ┻━┻","Head Administrator 🌪" , "Administrators 🗝", "ꔫ・˚꒱Staff ° .", "≧ω≦")    
@commands.has_permissions(administrator=True)
async def HackYeet(self, inter, user: Member, reason: str = "No Reason provided"):
    if not member:
        await inter.send("This member could not be found.", delete_after=10)

    ...
#

I'd also typehint inter but I don't know the object rq.

#

This works since the Member object is an object converter when type hinted in a command decorator.

dull knot
cloud dawn
#

!d disnake.ext.commands.MemberConverter

unkempt canyonBOT
#

class disnake.ext.commands.MemberConverter(*args, **kwargs)```
Converts to a [`Member`](https://docs.disnake.dev/en/latest/api.html#disnake.Member "disnake.Member").

All lookups are via the local guild. If in a DM context, then the lookup is done by the global cache.

The lookup strategy is as follows (in order)...
cloud dawn
#

These converters also exists when type hinting: Flag, Game, Role, User, Emoji, Guild, Colour, Invite, Member, Thread, Message, Permissions, TextChannel, ForumChannel, GuildChannel, GuildSticker, PartialEmoji, StageChannel, VoiceChannel, PartialMessage, CategoryChannel, GuildScheduledEvent

dull knot
cloud dawn
#

But since you can also get another object if you really want to follow the book a member typehint would look something like this.

from disnake import Interaction, Member

@commands.command(name="hey")
async def test(self, inter: Interaction, member: Member | None, reason: str = "No Reason provided") -> None:
    ...
#

| meaning or ... and -> None: meaning the return keyword doesn't return anything in the function, aka void.

#

Python 3.10 else it's member: Optional[Member] = None -> from typing import Optional

dull knot
#

Appreciate the help

cloud dawn
#

np if you run into any issues further, most people here would take the time to help, you can also ping me but I don't guarantee a quick response.

dull knot
#

yeah, they're pretty cool. Really appreciate the help though. For now, I'll try out what u told me

limpid otter
#

How to get the mentioned participant in interaction?

cloud dawn
limpid otter
slate swan
#

How do I get a discord user's username from their ID

#

is that possible?

#
cannot import name 'handle_message_parameters' from 'discord.http' (C:\Users\antho\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py)
  File "C:\Users\antho\OneDrive\Bureau\scrap\ebay.py", line 1, in <module>
    import discord```
#

I don't understand this error if someone can help me (first time it happened to me)

vocal snow
unkempt canyonBOT
#

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

Retrieves a [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User") based on their ID. You do not have to share any guilds with the user to get this information, however many operations do require that you do.

Note

This method is an API call. If you have [`discord.Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members") and member cache enabled, consider [`get_user()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.get_user "discord.Client.get_user") instead.

Changed in version 2.0: `user_id` parameter is now positional-only.
slate swan
#

hmm

slate swan
cosmic agate
#

what is the code for giving a person a role? cant seem to get it......

vocal snow
#

user = await client.fetch_user(id)

vocal snow
unkempt canyonBOT
#

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

Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
slate swan
#

I don't have client

vocal snow
#

then what do you have

cosmic agate
slate swan
#
class Bot(commands.Bot):
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        
    async def setup_hook(self) -> None:
        self.tree.copy_global_to(guild = discord.Object(id = 994773768482336828))
        
        await self.tree.sync(guild = discord.Object(id = 994773768482336828))
        
        self.add_view(Button())
#

I use commands.Bot not discord.Client

slate swan
#

would it still work for both?

vocal snow
#

commands.Bot inherits from discord.Client

slate swan
slate swan
#

just open it and type pip install discord

#

its usual walk though

vocal snow
slate swan
cloud dawn
slate swan
#

but I couldn't say which ones

cloud dawn
slate swan
slate swan
slate swan
vocal snow
slate swan
#

kk

#
import micromania
import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix='/', intents=intents)

@client.event
async def on_ready():
    print('le bot est prêt !')

client.run('token')
#

@slate swan

vocal snow
slate swan
unkempt canyonBOT
#

Hey @slate swan!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

slate swan
#

@vocal snow

slate swan
vocal snow
slate swan
cloud dawn
slate swan
#

@vocal snow I am also sorry to keep pinging you but

#
@Host.tree.command()
async def leaderboard(interaction: discord.Interaction) -> None:
    toPost = ''
    for ID in SCORES:
        person = Host.fetch_user(ID)
        toPost += person.name + ': '
        toPost += str(SCORES[ID]) + '\n'
    await interaction.response.send_message(embed=discord.Embed(
        title='Leaderboard:',
        colour = 0xf7df05,
        description=toPost
    ))
#
 toPost += person.name + ': '
AttributeError: 'coroutine' object has no attribute 'name'
#

is it not .name?

vocal snow
slate swan
#

ahh im so stupid man

slate swan
cloud dawn
slate swan
slate swan
# cloud dawn

haa yes that no I am not scrap ebay at all it was before I just wanted to test something but it did not work

slate swan
#

OK LAST THING GUYS

#

IM SO FUCING SORRY TO BUG YOU ALL BUT AFTER THIS, IM DONE!

#
@Host.tree.command()
async def snake(interaction: discord.Interaction) -> None:
    """Play snake on discord!"""
    
    # Miscellaneous:
    CTX = await commands.Context.from_interaction(interaction)
    GUILD_ID = interaction.guild.id
    
    NEED_CHANNEL = PERMISSIONS.get(GUILD_ID, False)
    
    # Main:
    if NEED_CHANNEL is True:
        # Guardian statements:
        if CTX.channel.id != SETTINGS.get(GUILD_ID, 0):
            return
        if OCCUPIED['GUILDS'].get(GUILD_ID, False) is False:
            OCCUPIED['GUILDS'][GUILD_ID] = True
            OCCUPIED['OWNERS'][interaction.user.id] = Snake(CTX)
            await OCCUPIED['OWNERS'][interaction.user.id].initiate()
        else:
            await interaction.response.send_message('Sorry, this command is already being used by someone else in your server.', ephemeral = True)
    else:
        if OCCUPIED['GUILDS'].get(GUILD_ID, False) is False:
            OCCUPIED['GUILDS'][GUILD_ID] = True
            OCCUPIED['OWNERS'][interaction.user.id] = Snake(CTX)
            await OCCUPIED['OWNERS'][interaction.user.id].initiate()
        else:
            await interaction.response.send_message('Sorry, this command is already being used by someone else in your server.', ephemeral = True)
#

Ok you see that 1 command?

#

When I use it, it pops up an embed but it does it in a class, which means it does not respond

cloud dawn
slate swan
#

nothing is wrong with it

#

I use it

#

Ohhh

#

I see now, well I can change it if you want

cloud dawn
#

Yeah but why the ctx then lol

#

Well I just noticed it.

slate swan
#

I need it for the class

cloud dawn
#

Like the repr inside of the embed..?

slate swan
#

I send the CTX

#

it uses the CTX to post embeds and edit them

#

if I send an interaction, I wont be able to edit the message or have it returned to me.

#

I need the message instance

#

it's just easier to use CTX in that case.

cloud dawn
#

I see a lot of dupe code lemme clean it up first.

slate swan
#

ok

cloud dawn
# slate swan ```py @Host.tree.command() async def snake(interaction: discord.Interaction) -> ...
@Host.tree.command()
async def snake(interaction: discord.Interaction) -> None:
    """Play snake on discord!"""
    
    # Miscellaneous:
    CTX = await commands.Context.from_interaction(interaction)
    GUILD_ID = interaction.guild.id
    
    NEED_CHANNEL = PERMISSIONS.get(GUILD_ID, False)
    
    # Main:
    if NEED_CHANNEL and CTX.channel.id != SETTINGS.get(GUILD_ID, 0):
        return

    if not OCCUPIED['GUILDS'].get(GUILD_ID, False):
        OCCUPIED['GUILDS'][GUILD_ID] = True
        OCCUPIED['OWNERS'][interaction.user.id] = Snake(CTX)
        await OCCUPIED['OWNERS'][interaction.user.id].initiate()
    else:
        await interaction.response.send_message('Sorry, this command is already being used by someone else in your server.', ephemeral = True)
errant coral
#

code:

    def __init__(self):
        super().__init__(timeout=None)
    @nextcord.ui.button(label="Accept", style=nextcord.ButtonStyle.blurple, custom_id="Accept")
    async def Accept(self, button: nextcord.ui.Button, interaction: nextcord. Interaction):
        embed = nextcord.Embed(
            title="Application Accepted",
            description="The role the person is applying for is now added", color = nextcord.Color.from_rgb(3,200,255)
            )
        await interaction.channel.send(embed=embed)
@bot.slash_command(description="Opens the application menu and perform actions on an application", guild_ids=[948651326865285171])
async def appliction(ctx):
    embed=nextcord.Embed(
            title=":construction_worker: Application Menu",
            color = nextcord.Color.from_rgb(3, 200, 255)
        )
    embed.add_field(name="Applicant", value=f"{ctx.user.mention}")
    embed.add_field(name="Applying for", value=f"Role")
    embed.add_field(name="Status", value="Pending")
    embed.add_field(name=":white_check_mark: Accept Application", value="Accepts the person")
    embed.add_field(name=":x: Deny Application", value="Denieds the persons application")
    embed.add_field(name=":wastebasket: Close Appication", value="Closes the application")
    await ctx.send(embed=embed, view=accept)```
Error:
```missing 1 required positional argument: 'self'```
Please help! i been sitting with this 2 days now.
I think it another error to
slate swan
#
class accept(nextcord.ui.View):
    def __init__(self):
        super().__init__(timeout=None)
    @nextcord.ui.button(label="Accept", style=nextcord.ButtonStyle.blurple, custom_id="Accept")
    async def Accept(self, button: nextcord.ui.Button, interaction: nextcord. Interaction):
        embed = nextcord.Embed(
            title="Application Accepted",
            description="The role the person is applying for is now added", color = nextcord.Color.from_rgb(3,200,255)
            )
        await interaction.channel.send(embed=embed)
@bot.slash_command(description="Opens the application menu and perform actions on an application", guild_ids=[948651326865285171])
async def appliction(ctx):
    embed=nextcord.Embed(
            title=":construction_worker: Application Menu",
            color = nextcord.Color.from_rgb(3, 200, 255)
        )
    embed.add_field(name="Applicant", value=f"{ctx.user.mention}")
    embed.add_field(name="Applying for", value=f"Role")
    embed.add_field(name="Status", value="Pending")
    embed.add_field(name=":white_check_mark: Accept Application", value="Accepts the person")
    embed.add_field(name=":x: Deny Application", value="Denieds the persons application")
    embed.add_field(name=":wastebasket: Close Appication", value="Closes the application")
    await ctx.send(embed=embed, view=accept)
cloud dawn
slate swan
#
# Post
    async def post(self, edit=False) -> None:
        self.update_board()
        if edit is False:
            self.generate_apple()
            self.update_board()
            embed = discord.Embed(
                description=self.generate_board(),
                colour = 0x05f138,
                title = f'{self.CTX.author.name}\'s Snake Game',
            )
            self.instance = await self.CTX.channel.send(embed=embed, view = Button())
        else:
            embed = discord.Embed(
                description=self.generate_board(),
                colour = 0x05f138,
                title = f'{self.CTX.author.name}\'s Snake Game',
            )
            await self.instance.edit(embed=embed, view = Button())
cloud dawn
#

Since interaction doesn't really allow for rapid edits, it does have an edit from original message.

#

What exactly does it send?

slate swan
#

It sends this

cloud dawn
slate swan
#

but it edits every 1 second

cloud dawn
# slate swan

Does it get edited once a button has been pressed?

slate swan
#

it edits every 1 second after a button is pressed

errant coral
# cloud dawn Please provide the full traceback.

mean this

Traceback (most recent call last):
  File "C:\Users\josep\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 820, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\discordBot.py\Virus.py", line 204, in appliction
    await ctx.send(embed=embed, view=accept)
  File "C:\Users\josep\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\interactions.py", line 523, in send
    return await self.response.send_message(
  File "C:\Users\josep\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\interactions.py", line 836, in send_message
    payload["components"] = view.to_components()
TypeError: View.to_components() missing 1 required positional argument: 'self'

The above exception was the direct cause of the following exception:

nextcord.errors.ApplicationInvokeError: Command raised an exception: TypeError: View.to_components() missing 1 required positional argument: 'self'``` ?
slate swan
#

its snake but on discord

#

payload["components"] = view.to_components()

cloud dawn
slate swan
#

Wait im so sorry my mind is foggy

#

Did I say there was an issue

#

Also thanks for polishing my code

#

I have a quick question Panda

cloud dawn
cloud dawn