#discord-bots

1 messages ยท Page 827 of 1

hushed galleon
#

probably not named commands since that shows the commands extension

pine crypt
hushed galleon
#

that should do

slate swan
#

what is this

pine crypt
hushed galleon
#

oh wait why did you call commands()

pine crypt
#

oops

hushed galleon
#

also that other for loop for group in groups[0, 4]: is probably causing that error

pine crypt
#

new error

pine crypt
#

so how to fix this now?

hushed galleon
#

well what do you think those two for loops at the bottom are meant to do?

#

or a better question, what do you want it to do with the list of groups afterwards

pine crypt
#

split self.client.commands into groups of four and add a field for each set of four

#

4 different fields

hushed galleon
#

right, that first part you've done above

pine crypt
#

yes

hushed galleon
#

so you need to finish writing the second part

#

adding the fields

pine crypt
hushed galleon
#

in other words you want to take each group of commands, join their names together as a string, then add a field with those names

pine crypt
#

along the lines of this but 4 commands, once it has reached that limit there will be buttons Next and Back to switch between embeds

hushed galleon
#

oh so field per command

pine crypt
#

buttons i dont want to focus too much on right now

hushed galleon
#

you should have a list of embeds since thats what your paginator will have to traverse through

pine crypt
#

is there a more efficient way in case later on i have 50+ or so commands, that will be laborious

hushed galleon
#

its neither that complex or computationally expensive

pine crypt
#

ok

hushed galleon
#

embeds = []
for each group
create new embed
add field for each command in group
add your new embed to list

start paginator with your list of embeds

pine crypt
#

would the for group in groups or for command in self.client.commands come first?

hushed galleon
#

why do you need the command for loop?

pine crypt
#

helpEmbed takes in name as command.name and value as command.description

#

I need to define command somewhere

hushed galleon
#

well each group is a list of 4 commands

#

theres your command

pine crypt
#

good point but how would i then make individual fields

hushed galleon
#

loop through each command in the group and call add_field inside

pine crypt
#

what would the name then be set to

hushed galleon
#

the command's name, of which the command comes from using another for-loop on the group

final iron
final iron
pine crypt
#
for group in groups:
    for command in self.client.commands:
        #create field
slate swan
final iron
pine crypt
hushed galleon
pine crypt
#

how would the for loops work then?

hushed galleon
#
table = [[1, 2],
         [3, 4]]
for row in table:
    for n in row:
        print(n)  # 1, 2, 3, 4```
pine crypt
#

for command in group?

hushed galleon
#

yes

pine crypt
pine crypt
#

embeds?

hushed galleon
#

ya

pine crypt
#

line 17 i would need to remove?

hushed galleon
#

mhm you'll be creating the embeds in your second part

pine crypt
#

so is it 1 embed per command?

hushed galleon
#

1 embed per group

pine crypt
#

ah ok

#

now just append to list?

hushed galleon
#

the embed has to be created per group, i.e. not inside the command for-loop

#

otherwise it would create an embed per command

pine crypt
#

what would be next?

#

i am not familiar with paginator

hushed galleon
#

doing what i said above, and then you can continue to running your paginator with the list of embeds

#

what your code does right now is creating an embed for one command, then resetting that embed by redefining it and adding the next command

pine crypt
#

yes

hushed galleon
#

another example of the issue ```py
for i in range(5):
total = 0
total += i
print(total)

prints 4 rather than the sum of 1+2+3+4```

final iron
#

What happened here

#

๐Ÿ˜•

modest plover
#

How would I do a timeout based on a slash command?

hoary cargo
#

pepeannoyed what timeout

final iron
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.
gentle badger
#

How to make a command of on the commands?

final iron
#

Like a help command?

sick birch
quaint epoch
#

ig no one reading it

#

sed

full lily
#

yeah delete it so nobody else can read it

buoyant quail
#

xd

quaint epoch
full lily
#

Good thinking ๐Ÿฅบ

quaint epoch
#

):

quaint epoch
#

because you two seem very alike

#

red, skull, undead

slate swan
#

ot

small igloo
#

is it possible to make my bot send message at specified channel when i interact with button

final iron
#

Yeah

small igloo
final iron
#

Just fetch the channel

small igloo
final iron
#

You'll need access to your bot class

#

So technically it can be in any file as long as you can access the bot class

final iron
#

mhm

small igloo
# final iron mhm

await interaction.response.send_message

where to add the fetched channel variable

final iron
#

Anywhere you want?

#

You would be sending to it

small igloo
# final iron Anywhere you want?

so, it can be like: (x is the variable)

  • await x.interaction.response.send_message
  • await interaction.x.response.send_message
  • await interaction.response.x.send_message
  • await interaction.response.send_message.x
final iron
#

So

logging_channel = bot.fetch_channel(123456789)

await logging_channel.send(...)
final iron
#

If it makes it easier for you, just think of interaction as a ctx but with less attributes

final iron
#

If you think about it it's wrong but at a very basic level its a fine comparison

small igloo
#

xd k

flat solstice
#

In discord.py can you force guilds into specific bot shards?

small igloo
#

waht

final iron
#

Then don't make a discord bot

#

!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.

final iron
#

Learn fundamental concepts and then try to make a bot

slim ibex
#

pls don't be another one that doesn't know python and tries to make a bot

flat solstice
#

Discord.py is a (deprecated) library for python which enables Devs to write bots in python

slim ibex
#

use !pip disnake

#

!pip disnake

unkempt canyonBOT
slim ibex
#

bruh what

#

lmfao

solar summit
#

dudes just quit cause of discord bots

slim ibex
#

why the fuck

slim ibex
#

why did you quit

solar summit
#

it's not that hard

slim ibex
#

^

solar summit
#

discord bots are easy

wicked atlas
slim ibex
#

โ“

final iron
#

Sure, some commands are

slim ibex
#

python isn't hard

final iron
#

But if you want to make something interesting it can actually get quite complicated at some times

final iron
small igloo
#

AttributeError: partially initialized module 'bitch' has no attribute 'hello' (most likely due to a circular import)

dis suck

slim ibex
#

thats what a circular import is

small igloo
buoyant quail
#

hey, someone here use mongodb?
what to do with [WinError 10054] An existing connection was forcibly closed by the remote host ?
await Guild_Collection.find_one({"_id": message.guild.id}) earlier it worked

small igloo
#

lul

unkempt canyonBOT
#

Hey @slate swan!

It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

buoyant quail
#

uninstall seems good

slim ibex
#

an example:

you have your main file, and two other modules
in your modules, A and B, module A imports a function from B, and B imports a function from A. you run the program from main, which imports something from A.

When you run the program, main starts initializing module A because it imports a function from module A. But the first line in module A imports a function from module B. A's initialization is stopped and B starts to be initialized. But B also imports something in A. B stops being ran, and it starts going to A. But, A is already being initialized and this creates circular import

small igloo
slim ibex
#

yes

#

what are you trying to do

small igloo
buoyant quail
#

your import is like
from file import f1, f2?

small igloo
#

import a
import b

slim ibex
#

import the specific names so your namespace isn't littered with shit you don't use

slim ibex
#

no

small igloo
#

ImportError: cannot import name 'hello' from partially initialized module 'bitch' (most likely due to a circular import) (C:\Users\User\Downloads\PycharmProjects\main.py\bitch.py)
duck

slim ibex
#

i just told you why

#

fix the circular import'

small igloo
unkempt canyonBOT
#

Hey @small igloo!

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

final iron
#

huh

small igloo
final iron
#

Lemme alert someone

small igloo
final iron
#

nah

#

Too much effort

#

That from the paste bin link. I'm not even downloading anything

small igloo
#

ok

hoary cargo
#

This is not even a question for this channel pepeannoyed

#

If you can't even install python how u gonna use it AG_WeirdChamp

slim ibex
#

we won't help if you talk like that

hoary cargo
#

Ah yes another weirdo crying oMg u gUyS wOnT heLp mE
And they talk like shit
Please get out

slim ibex
#

^

final iron
#

<@&831776746206265384>

slim ibex
slate swan
#

Hey guys!

#

Is this a bad time?

final iron
#

No

hoary cargo
#

Before learning how to install a program learn how to talk to someone pepeannoyed

final iron
hoary cargo
blissful lagoon
#

@hoary cargo this is not acceptable behavior for our community
please read our code of conduct and be more welcoming to beginners

#

@slate swan do not be rude to other people, especially when asking for help

slate swan
#

Okay so

#

I have some doubts about this whole making bots thing

#

I have like a few ideas but i cant cause i dont know how to

#

Whats like a good place to stART?

hoary cargo
slate swan
#

Oookay ill come later

blissful lagoon
#

if you have a problem with someone, ping moderators or contact @novel apex

blissful lagoon
hoary cargo
#

Because their question was off topic like we are forced to help even if it's not about #discord-bots
But whatever pepeOK my bad

daring olive
#

mm we're going to drop this topic now please

final iron
#

Can you guys just check this out rq?

hoary cargo
patent lark
#

the topic was told to be dropped.

hoary cargo
#

HmmLeave I'll come back when chat is healthy again

patent lark
#

good idea.

final iron
#

Didn't get punished smh

#

๐Ÿ˜”

patent lark
#

not our problem, contact staff.

oblique laurel
#

Whatโ€™s the best fork of dpy atm?

final iron
#

I pinged mods

#

nextcord/disnake

patent lark
final iron
#

minaberry ghosting chat smh

oblique laurel
#

Is it very different from the original?

daring olive
final iron
#

Nope

patent lark
oblique laurel
#

Alr thx ๐Ÿ™

final iron
daring olive
#

there are consequences, don't worry

#

by that i mean to say, we take detailed notes of incidents such as these. so if scenarios repeat themselves, we know not to be lenient

final iron
#

Understandable

daring olive
#

i get it :) i'd probably feel the same in your shoes

patent lark
daring olive
#

do you guys use IDE debuggers while writing your bots?

#

is there something special you have to do when trying to debug async code?

maiden fable
#

No

slim ibex
#

i don't no

maiden fable
#

Just run and debug for me in vsc

daring olive
#

like putting the breakpoints in specific spots or smth?

maiden fable
#

I never really used those tbh

final iron
#

Never used a debugger in my life

daring olive
#

lol really!

#

they're very handy

#

do you do a lot of print statements instead?

maiden fable
#

Break points would be used only if u can't find an error haha

daring olive
#

or you just write perfect code p_sparkles02

maiden fable
final iron
#

I've had a few situations where I guess using a debugger would be useful but I never wanted to learn how to use them

#

I don't usually run in to a lot of errors

maiden fable
#

@final iron which ide u use

pliant gulch
#

Breakpoint's aren't very helpful imo, at least for me. I much more prefer writing unit tests for things

daring olive
#

https://youtu.be/5AYIe-3cD-s i've been meaning to finish this video, but it might be a good intro to debugging that you may find helpful. her focus is using pdb (terminal debugger) and vsc, but the concepts should carry over to whatever tools you use

Presented by:
Nina Zakharenko

Still debugging your code with print? Learn how to level up your ability to troubleshoot complex code situations by using the power of a fully-featured debugger in this talk aimed at all levels of programming ability.

Debuggers allow you to examine your program state, watch as the values of important variables cha...

โ–ถ Play video
pliant gulch
#

Assert is also a very amazing tool, but should never be left in production

#

^ Like a raise as you can also write messages with them

#

!e ```py
assert 1 == 2, "No it isn't!"

unkempt canyonBOT
#

@pliant gulch :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AssertionError: No it isn't!
unkempt canyonBOT
#

Never use print() to debug again; inspect variables, expressions, and program execution with a single, simple function call.

maiden fable
#

Never really used it, but seems fun

daring olive
#

interesting

spring verge
#

Ohh nice

final iron
pliant gulch
#

๐Ÿ‘๏ธ ๐Ÿ‘๏ธ

final iron
#

what

scarlet rune
#

hey, i wanted to make a @security.is_owner() whereas it checks if the userid is included in a json folder. This is the function i wrote in security.py, but when i executed it before a @bot.command, the command doesn't seem to be executed even if the user id is included in the json folder. Here's the checking code: (i forked this btw, just wanna understand how it works)

def is_owner():
    async def predicate(context: commands.Context) -> bool:
        with open("settings.json") as file:
            ownerids = json.load(file)
        if context.author.id not in ownerids["owner"]:
            raise NotOwner
        return True

    return commands.check(predicate)
``` does anyone know why it doesn't execute the command?
#

example:

@security.is_owner()
@bot.command
async def on_message(message: disnake.Message):
    if message.content == 'cmd':
        await message.channel.send('confirmed!')```
slate swan
#

Is the owner json-key a list of integers?

scarlet rune
#

yes

#
{
  "owner": [
    "389034898666553344",
    "847268640508215317"
  ],
  "prefix": [
    "e!"
  ],
  "token": "insert token here"
}```
slate swan
#

does it raise the NotOwner error?

scarlet rune
#

i used a tuple

slate swan
#

!custom-check

unkempt canyonBOT
#

Custom Command Checks in discord.py

Often you may find the need to use checks that don't exist by default in discord.py. Fortunately, discord.py provides discord.ext.commands.check which allows you to create you own checks like this:

from discord.ext.commands import check, Context

def in_any_channel(*channels):
  async def predicate(ctx: Context):
    return ctx.channel.id in channels
  return check(predicate)

This check is to check whether the invoked command is in a given set of channels. The inner function, named predicate here, is used to perform the actual check on the command, and check logic should go in this function. It must be an async function, and always provides a single commands.Context argument which you can use to create check logic. This check function should return a boolean value indicating whether the check passed (return True) or failed (return False).

The check can now be used like any other commands check as a decorator of a command, such as this:

@bot.command(name="ping")
@in_any_channel(728343273562701984)
async def ping(ctx: Context):
  ...

This would lock the ping command to only be used in the channel 728343273562701984. If this check function fails it will raise a CheckFailure exception, which can be handled in your error handler.

scarlet rune
sick birch
#

also you have to raise NotOwner() not raise NotOwner

#

actually

#

instead of raising an error on the check, you should instead just pass in True/False like the docs say

#
return authorid in ownerids

(psuedocode but will do)

pliant gulch
#

Raising NotOwner without calling it should work, there is no required argument in the constructor

sick birch
#

But wouldn't you just be raising the class object rather than an instance

#

!e

class MyException(Exception):
  pass
raise MyException
unkempt canyonBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | __main__.MyException
sick birch
#

!e

class MyException(Exception):
  pass
raise MyException()
unkempt canyonBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | __main__.MyException
sick birch
#

looks to be the same yeah

pliant gulch
#

!e ```py
try:
raise ValueError
except ValueError:
print("caught")

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your eval job has completed with return code 0.

caught
sick birch
#

Yeah, though I think they should still be returning a boolean rather than raising an error inside of a predicate

pliant gulch
#

They also shouldn't be opening the file everytime

#

It would be smarter, and more preform-ant to cache the file on startup with only a single open, later appending to it and saving

sick birch
#

yep, grabbing from the file and storing it as a list in a bot var perhaps

slate swan
scarlet rune
#

oho

alpine vault
#

Which one of these is a better practice?


def mydecor(func):
    def wrapper(*args, **kwargs):
        if random.choice([True, False]):
            # args[0] must be context of the command
            args[0].send("This command won't work because screw you")
            return
        return func(*args, **kwargs)
    return wrapper

def mycheck():
    return random.choice([True, False])
    # we will decorate commands with @commands.check(mycheck)
    # then we will then make a error handler for this
hardy wing
#

what does the error mean when it says "dict is not callable

quick gust
hardy wing
#

ok well how would I make it callable?

quick gust
#

you can't

#

why would you wanna call a dict

hardy wing
#
if "type2" in defender():```
trying to check if a string called type2 is in the defender dict
slate swan
#

dont ()

quick gust
#

^

hardy wing
#

but it works if checking if something is in a datastore isn't a datastore a dictionary?

#

database I mean

slate swan
#

only functions/methods need to be called, dict is a datatype and you dont call it

hardy wing
#

ok then is there an alternate way to check type2 exists in that dictionary

slate swan
#

!e ```py
dict_ = {'key1':1,'key2':2}
for i in dict_:
print(i)

unkempt canyonBOT
#

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

001 | key1
002 | key2
hardy wing
#

type2 is a string in the dictionary

slate swan
#

just remove ()

spring flax
#

For functions in my bot that like do a database operation, should I do def of async def?

#

I assume i should do async def when the code has like await or such?

slate swan
quick gust
#

async def for db stuff, at the first place your db should require await else it's blocking

spring flax
#

yeah using aiosqlite

quick gust
#

async function then

pine crypt
#

I have a list called embed and it is empty, every time the loop runs through, it should append the variable helpEmbed to the list.

#

When using print(embeds I found the value being added was [<discord.embeds.Embed object at 0x000001465900E950>]

#

Is there any other way to add embeds to embeds list?

slate swan
spring flax
#
async def check_if_can_ping(member : disnake.Member):
    async with bot.db.execute("SELECT obj_id from mod_ping WHERE obj_id = ? AND type = ?", (member.id,'Member',)) as cursor:
        single_member = await cursor.fetchone()
    async with bot.db.execute("SELECT obj_id from mod_ping WHERE type = ?", ('Role',)) as cursor:
        list_of_roles = await cursor.fetchall()
    if any(role[0] in ctx.author._roles for role in list_of_roles): 
        print('failed')
        return False
    if single_member:
        print('failed')
        return False
    return True

Anyone mind pointing what's wrong? It's returning True even when my role is in the DB

lament mesa
lament mesa
#

print list_of_roles

spring flax
#

Yeah, I'm pretty sure list_of_roles is at tuple

#

I did print it and saw yeah

#

But where's the role object you said?

lament mesa
#

ctx.author._roles

spring flax
#

That's what i did

#

Oh wait nvm

spring flax
#

ID*

lament mesa
#

my bad i thought it was a list of role objects

spring flax
#

I did ctx.author._roles on another command and it printed SnowflakeList('Q', [812365057236533308]) (i only had one rolee)

#

@bot.command()
async def test(ctx):
    async with bot.db.execute("SELECT obj_id from mod_ping WHERE obj_id = ? AND type = ?", (ctx.author.id,'Member',)) as cursor:
        single_member = await cursor.fetchone()

    async with bot.db.execute("SELECT obj_id from mod_ping WHERE type = ?", ('Role',)) as cursor:
        list_of_roles = await cursor.fetchall()

    print(list_of_roles)
    print(ctx.author._roles)

This prints
[(812365057236533308,)] SnowflakeList('Q', [812365057236533308])

#

is it because I can't do if role in ctx.author._roles comparing a <class 'disnake.utils.SnowflakeList'> and a <class 'list'>

dusky fox
#
print("What operation do you want?")
operator = input("Enter either +, -, or *: ")

n1 = float(input("Enter first number: "))
n2 = float(input("Enter second number: "))
if operator=="+":print(n1+n2)

elif operator=="-":print(n1-n2)

elif operator=="*":print(n1*n2)

else :print("error")
manic wing
#

!e print([1] in [1,2])

unkempt canyonBOT
#

@manic wing :white_check_mark: Your eval job has completed with return code 0.

False
dusky fox
#

!e

unkempt canyonBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

dusky fox
#

!e

print("What operation do you want?")
operator = input("Enter either +, -, or *: ")

n1 = float(input("Enter first number: "))
n2 = float(input("Enter second number: "))
if operator=="+":print(n1+n2)

elif operator=="-":print(n1-n2)

elif operator=="*":print(n1*n2)

else :print("error")
spring flax
#

what else can I do?

keen talon
#

What can I do to check if a user is already using a command

quick gust
#

!d discord.ext.commands.max_concurrency i think

unkempt canyonBOT
#

@discord.ext.commands.max_concurrency(number, per=discord.ext.commands.BucketType.default, *, wait=False)```
A decorator that adds a maximum concurrency to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses.

This enables you to only allow a certain number of command invocations at the same time, for example if a command takes too long or if only one user can use it at a time. This differs from a cooldown in that there is no set waiting period or token bucket โ€“ only a set number of people can run the command.

New in version 1.3.
slate swan
slate swan
keen talon
quick gust
#

nvm this is command specific

slate swan
keen talon
#

For doing that ?

slate swan
keen talon
maiden fable
slate swan
#

Hunter God is here to help

spring flax
keen talon
#

No need ๐Ÿ‘‹

maiden fable
#

Don't mess with the internals, they gonna mess with yr bot

keen talon
maiden fable
#

Cool

spring flax
#
if any(role[0] in ctx.author._roles for role in list_of_roles): 

this is what I have

#

so I do

maiden fable
#

Don't...

#

What do u wanna do?

spring flax
slate swan
#

Lol

spring flax
#

wait

maiden fable
spring flax
#

check if any role Id in the database is equal to any one of a member's role

slate swan
maiden fable
#

utils.get(member.roles, id=...)

#

Or just check in role.members after getting the role object

spring flax
#

like for a blacklist command, I'm making so you can blacklist a role

maiden fable
#

Using a bot check?

spring flax
#

now I have to see if a member has that role and in the check put it to return False

maiden fable
spring flax
#

so basically I have to do utils.get for the number of records in the DB

#

there isn't any alternative?

maiden fable
#

Uhhh?

#

Well, u can do one thing

#

On startup, just get every blacklisted role from the db

slate swan
#
local_db_role_id = [role1id, roleid]

for role in member.roles:
     if role.id in local_db_role_id:
              #do stuff```
maiden fable
#

And whenever u run the blacklist cmd, update the botvar u made on startup

maiden fable
spring flax
#

is that more efficient than the tils?

maiden fable
#

Yup

spring flax
#

utils*

maiden fable
#

Okay cool

spring flax
maiden fable
#

Well, according to me, yes

#

Since checking on each command invocation means wasting resources

spring flax
#

so I store it in a bot variable as a list?

maiden fable
#

Sure

#

Store the role objects

spring flax
#

also, what does the whole internals mean for _?

maiden fable
#

Wym

#

Internals just mean some private variable, functions and other stuff discord.py has defined, not to be used by people, so as to function properly

spring flax
#

oh and what are the bad things about having an eval, when it's set to @commands.is_owner and can you suggest any ways to protect some bad things from happening?

maiden fable
#

As long as it has that deco, u r fine

#

Also u should make another deco to make sure the command doesn't take more than x seconds (my bot has set that to 10)

slate swan
#

Umm

maiden fable
slate swan
#

Is using the is_owner decorator better or do conditionals work just fine?

maiden fable
#

The deco is neater but the rest depends on you

slate swan
#

I see

maiden fable
#

Actually I made that for my bot. Lemme get that

#
def cancel_long_invoke(timeout: int = 10, in_a_cog: bool = True):
    def deco(func: Callable[..., Any]):
        @functools.wraps(func)
        async def wrapper(*args, **kwargs):
            if isinstance(args[0], Context) and not in_a_cog:
                ctx: Context[Bot] = args[0]
            elif in_a_cog:
                ctx: Context[Bot] = args[1]
            task = ctx.bot.loop.create_task(  # type: ignore
                wait_for(
                    fut=func(*args, **kwargs),
                    timeout=timeout
                )
            )
            try:
                return await task
            except TimeoutError:
                task.cancel()
                return await ctx.send(f"Hey there! Sorry, but the command timed out after {timeout} seconds, {ctx.author}")  # type: ignore
        return wrapper
    return deco
velvet tinsel
#

I spent 10 mins trying to find that ping

spring flax
#

Yours is 10s?

maiden fable
#

Indeed

#

Well, I hardly use my bot, so that's kinda useless now

maiden fable
#

Wym

spring flax
#

I'm thinking to put mine at 3s

maiden fable
#

Useless as in, the deco haha

maiden fable
#

10 seconds was fine for me tbh

#

Also it's a task, so it won't really block yr bot, as long as u don't use time.sleep or smth

spring flax
#

I mean it's only going to be for printing or sending messages

maiden fable
#

Okay, yr wish haha

fervent shard
#

how can i make a discord.py code doing โ€œif message in channel, react with โ€œ๐ŸŽ‰โ€โ€

maiden fable
#

!d discord.Message.channel

unkempt canyonBOT
cloud mason
#

are these codes correct

#

it's been a while

#

i am trying

maiden fable
#

What's the error

#

Bot ain't sending the message?

cloud mason
#

so you think it's right

maiden fable
#

The reason yr bot ain't sending anything is cz it got ratelimited

cloud mason
#

i need to add a code

#

so that it stays online all the time

#

it's works only then

maiden fable
#

U mean uptimerobot?

cloud mason
#

when i run it

cloud mason
maiden fable
#

Hmm okay

cloud mason
maiden fable
#

?

cloud mason
#

nothing

#

i am learning python

maiden fable
#

Cool

cloud mason
#

so i am like a noob

#

in python

#

it's a udemy course

maiden fable
#

!resources u will want to checkout these too

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.

cloud mason
#

thankyou

#

you are really nice

#

!resources

maiden fable
#

Won't work again. There's a cooldown

cloud mason
#

oh ok

#

do you work on hardware too

#

like you write codes for your robot

#

i have a hardware kit of lego

#

lego spike prime

maiden fable
#

Nope

cloud mason
#

i need more motors

#

it only has 3

#

at least 6

#

and 1 hub

#

i don't have a team

#

so

#

i can only use my set

slate swan
#

Plus, who makes a normal function while also using requests

maiden fable
slate swan
maiden fable
#

Okay ยฏ_(ใƒ„)_/ยฏ

spring flax
#

oh nvm i got it

#

I'm not really familiar with that type of deco, do I use it as a command decorator like normal?

spring flax
slate swan
spring flax
#

^ is what I'm not sure how to do

graceful rune
#

hi

#

i want to learn python

#

can anyone teach me

spring flax
#

!resorces

#

!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.

graceful rune
#

i am not able to find

#

or cant download

nimble plume
graceful rune
#

i want to code a web or app

#

can anyone

#

help me

vale wing
#

Is that new feature called "Modals" a kind of forms or smth

graceful rune
#

?

vale wing
#

Ok time to try it out ๐Ÿ˜

slate swan
#

how do I make cooldown for specific server for my discord bot?
e,g,
server 1 cooldown 10
server 2 cooldown 5 second
i am using sql to save data

maiden fable
maiden fable
spring flax
maiden fable
# nimble plume ??

Like from discord import Embed changes to from disnake import Embed and so on

nimble plume
#

and disnake.embed

maiden fable
nimble plume
#

Ok thats it?

maiden fable
nimble plume
#

Ye ik captiaps

heavy folio
#

!pypi slash_util

unkempt canyonBOT
spring flax
heavy folio
nimble plume
#

Do i need class like class s(disnake.)

maiden fable
#

Now just do bot.blacklisted_roles = [roles_tuple[0] for roles_tuple in list_of_roles since cursor.fetchall() returns a list of tuples iirc

nimble plume
maiden fable
#

Yes

nimble plume
#

Is there anything o i can change all things with same text

maiden fable
#

Yea

#

Which IDE u r using?

nimble plume
#

Pls tell

#

Vs code

maiden fable
#

Ctrl Shift S

nimble plume
#

Bro can u give class ill add it

quick gust
#

or Ctrl f2

quick gust
spring flax
maiden fable
nimble plume
maiden fable
#
async def get_blocked_roles():
    await bot.wait_until_ready()
    async with bot.db.execute("SELECT obj_id from mod_ping WHERE type = ?", ('Role',)) as cursor:
        list_of_roles = await cursor.fetchall()
    bot.blacklisted_roles = [roles_tuple[0] for roles_tuple in list_of_roles]
#

Smh just fix the indent

quick gust
#

๐Ÿฅฃ

maiden fable
#

I'm on mobile, can't help it

maiden fable
quick gust
#

I'm kidding lol

maiden fable
#

Just making myself clear

spring flax
maiden fable
#

Don't want anyone to hate me for spoonfeeding, already got a bunchful of those haha

quick gust
maiden fable
spring flax
#

ah

#

i see

boreal ravine
boreal ravine
#

it doesn't send anything even though I did what it wanted me to do (line 28)

maiden fable
#

sift...

#

!paste exists, just WHYYY

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.

boreal ravine
#

it's the same thing

#

literally

maiden fable
spring flax
#

if it's in a function

maiden fable
maiden fable
unkempt canyonBOT
#

Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:

bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"

@bot.command()
async def get(ctx: commands.Context):
    """A command to get the current value of `test`."""
    # Send what the test attribute is currently set to
    await ctx.send(ctx.bot.test)

@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
    """A command to set a new value of `test`."""
    # Here we change the attribute to what was specified in new_text
    bot.test = new_text

This all applies to cogs as well! You can set attributes to self as you wish.

Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!

boreal ravine
spring flax
maiden fable
#

Soooo?

#

See the setval command

spring flax
#

this will work?

quick gust
#

yes...

spring flax
maiden fable
#

So wherever u got access to the bot instance, u can use bot.blacklisted_roles there

nimble plume
spring flax
#

oh i see the mistake

#

just another stupid mistake

maiden fable
maiden fable
boreal ravine
#

no

spring flax
#

i did bot.list_of_roles (i initially named the botvar list_of_roles and updated but forgot to change command)

maiden fable
#

Ah okay

maiden fable
spring flax
#

so, from the screenshot above, this'll work?

@bot.command()
async def roles(ctx):
    await ctx.send(bot.blacklisted_roles)
maiden fable
#

Sure

#

But that will send the list of IDs

spring flax
#

it raises disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'blacklisted_roles'

maiden fable
#

Ouch

#

U didn't call the function on startup

boreal ravine
#

should i use the equality operator then

maiden fable
#

Do one thing... Make it blocking. So that it won't let the bot start until the db operation is complete

maiden fable
spring flax
maiden fable
spring flax
#

ah welp

maiden fable
#

Lol

spring flax
#

isn't that bad

maiden fable
#

?

spring flax
#

to do on_ready

maiden fable
#

Well, it's yr wish ยฏ_(ใƒ„)_/ยฏ

#

But I would prefer there

strong vessel
#

is bot.db just a naming convention or actually has a special meaning

maiden fable
#

Naming convention

strong vessel
#

thanks

nimble plume
#

How to import disnke commands

maiden fable
#

from disnake.ext import commands

nimble plume
#

bot=command,bot??

maiden fable
#

Yea

heavy folio
#

it's literally the same thing

nimble plume
#

Ok

heavy folio
#

why is python bot like this

nimble plume
#

Pls tel where to add class i use cogs

heavy folio
#

??? its the same thing

#

commands.Cog

nimble plume
#

I dont need to add any disnake.client

slate swan
# nimble plume Pls tel where to add class i use cogs
'''main.py/bot.py'''
import disnake
bot = disnake.ext.commands.Bot()
'''some_cog.py'''
import disnake

class hunter_uwu(disnake.ext.commands.Cog):
    def __init__(self):
           self.bot = bot
    @commands.command()
    async def botname(ctx): await ctx.send(self.bot.user.name)
maiden fable
#

kill me already Yea

nimble plume
#

do i neeed to add disnake.ext??

slate swan
slate swan
nimble plume
#

fine?

nimble plume
#

i use commands.cogs till now

maiden fable
nimble plume
#

i did pip install but disnake is not defined

slate swan
slate swan
nimble plume
slate swan
#

Restart vsc

nimble plume
#

ok

nimble plume
slate swan
nimble plume
#

all fine?

#

ye reload fix it

#
class Commands(commands.Cog):
    """huh3?."""
    def __init__(self , bot: commands.Bot):
        self.bot = bot
    @commands.Cog.listener()
    async def on_ready(self):
#

i use this type

maiden fable
#

I'm just waiting for the time when he changes the cog name from Commands to commands

nimble plume
#

huh?

#

class Commands u mean

maiden fable
#

Nvm just a joke no one really understands

maiden fable
nimble plume
#

okkk

maiden fable
#

I got a weird humor

maiden fable
#

Yea

nimble plume
#

alright

maiden fable
#

But be sure to add the setup function

nimble plume
#
def setup(bot: commands.Bot):
    bot.add_cog(Commands(bot))
#

at all last of cogs

maiden fable
#

Yea

nimble plume
#

now im changin all discord to disnake

#

via ctrl +f2

maiden fable
#

Okay

spring flax
#

What's control f2?

maiden fable
#

Search (and Replace...?)

nimble plume
#

like im shifting from discord to disnake

spring flax
#

I use control+h on vsc

nimble plume
#

disnake_components?

maiden fable
pine crypt
nimble plume
maiden fable
#

None

nimble plume
#

?

maiden fable
#

Use neither

nimble plume
#

i was using buttons

maiden fable
#

!d disnake.ui.View exists

unkempt canyonBOT
#

class disnake.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
maiden fable
#

!d disnake.ui.button

unkempt canyonBOT
#

disnake.ui.button(*, label=None, custom_id=None, disabled=False, style=<ButtonStyle.secondary: 2>, emoji=None, row=None)```
A decorator that attaches a button to a component.

The function being decorated should have three parameters, `self` representing the [`disnake.ui.View`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.View "disnake.ui.View"), the [`disnake.ui.Button`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.Button "disnake.ui.Button") being pressed and the [`disnake.MessageInteraction`](https://docs.disnake.dev/en/latest/api.html#disnake.MessageInteraction "disnake.MessageInteraction") you receive.

Note

Buttons with a URL cannot be created with this function. Consider creating a [`Button`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.Button "disnake.ui.Button") manually instead. This is because buttons with a URL do not have a callback associated with them since Discord does not do any processing with it.
nimble plume
#

ok

pine crypt
#

This is meant to append helpEmbed to embeds but the value returned is

maiden fable
#

Why not send the embed directly?

pine crypt
#

Pagination

nimble plume
#
await ctx.send(embed=embed,components=[Button(style=ButtonStyle.URL, label="Invite", url=main.MainAttributes.invitelink)])
``` help button not defined
maiden fable
#

That's not.... how it works

nimble plume
#

yes i know

#

how to do tell

maiden fable
#

The syntax is same

nimble plume
maiden fable
quick gust
#

the syntax is same

pine crypt
maiden fable
quick gust
#

You just pinged someone

nimble plume
quick gust
#

lmao

nimble plume
#

again huh?

quick gust
#

just dont do it..? and it's called a decorator fyi

nimble plume
#

someones same is uii

quick gust
#

and now u deleted so it's a ghost ping

#

bro.... I'm out

nimble plume
#

ยฏ_(ใƒ„)_/ยฏ

#

@mortal kindle @buoyant robin nothing

quick gust
#

jesus fucking christ

nimble plume
#

lol

nimble plume
#

2 pings now

#

ยฏ_(ใƒ„)_/ยฏ

maiden fable
quick gust
quick gust
nimble plume
quick gust
#

that's enough

nimble plume
#

huh?

maiden fable
#

Oops, me being slow ;-;

nimble plume
pine crypt
#

How do you append the name of the embed and not the type?

maiden fable
#

U just appended it

#

When u print the embed object, that's what it should print

nimble plume
#

blood red error (no problem)

slate swan
pine crypt
#

Why does this unicode not work when I define buttons?

spring flax
#

@maiden fable what do you think of this for blacklist a role?
just get the role objects from the DB with guild.get_role and use something like the@comands.has_role deco

nimble plume
#

i just put a = sign i fixed it

#

changed all discord to disnake

maiden fable
#

Use a bot check, or use the on_message event (preferred)

nimble plume
#

on message

spring flax
#

bot check?

nimble plume
#

!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.

maiden fable
#

Wait, u making it so that bot doesn't respond to people with blacklisted roles, right?

nimble plume
#
  File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\ext\commands\common_bot_base.py", line 487, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\ext\commands\common_bot_base.py", line 418, in _load_from_module_spec
    del sys.modules[key]
KeyError: 'utility'
PS C:\Users\hp\Desk
maiden fable
#

Even on mention

spring flax
maiden fable
nimble plume
maiden fable
#

Totally yr wish ยฏ_(ใƒ„)_/ยฏ

nimble plume
#

i use ```py
import main

spring flax
#

i just want to use the most convenient/efficient way lol

slate swan
slate swan
nimble plume
#

nvmd i put it in the file instead

slate swan
pine crypt
#

After appending the helpEmbed to embeds, how could I use pagination to run through all the embeds?

nimble plume
#
disnake.ext.commands.errors.ExtensionFailed: Extension 'utility' raised an error: ClientException: Cog named 'Commands' already loaded
slate swan
nimble plume
slate swan
#

Yes

nimble plume
#

my class named Commands

slate swan
#

Yes change that

maiden fable
nimble plume
#

ok lemee change it to Commands1

maiden fable
#

๐Ÿ‘€

pulsar knot
#

!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.

nimble plume
#

in discord.py it works well but in disnake it dont work

maiden fable
#

It will work

nimble plume
#

my all cogs class name is same

slate swan
slate swan
maiden fable
#

Lmao there u go

nimble plume
slate swan
#

I'm gonna go cry

pine crypt
#

How would I use pagination to go through embeds?

nimble plume
#

๐Ÿ˜‚ ๐Ÿ˜‚

#

RIP ASH

maiden fable
nimble plume
#

class utility

maiden fable
pine crypt
#

How would you use pagination to go through embeds?

slate swan
pine crypt
#

I can't

nimble plume
#

help how to put style???

@disnake.ui.buttonstyle(ButtonStyle.URL, label="Invite", url=invitelink)
#

wait wtf

#

disnake.ut.buttonstyle tf?

#

lol

#

i got it

maiden fable
#

!d disnake.ButtonStyle.link exists

unkempt canyonBOT
tacit token
#

hello is there any more characters in \u200b out?

maiden fable
#

No

#

U need a description now

slate swan
maiden fable
#

disnake.ButtonStyle.link*

slate swan
#

Lol

nimble plume
#

okok

maiden fable
#

.

nimble plume
#

!d disnake.Button

unkempt canyonBOT
#

class disnake.Button```
Represents a button from the Discord Bot UI Kit.

This inherits from [`Component`](https://docs.disnake.dev/en/latest/api.html#disnake.Component "disnake.Component").

Note

The user constructible and usable type to create a button is [`disnake.ui.Button`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.Button "disnake.ui.Button") not this one.

New in version 2.0.
nimble plume
#

disnake.ext.commands.errors.ExtensionFailed: Extension 'others' raised an error: TypeError: button() got an unexpected keyword argument 'url'

#

no much errors ahhh

silver sundial
#

somone help me i am beginder

nimble plume
#

hec?

maiden fable
silver sundial
#

how to use

#

somone pls help me

slate swan
silver sundial
#

how to start off

nimble plume
#

add_item=invitelink

maiden fable
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
unkempt canyonBOT
nimble plume
#

start off

#

huh

#

import disnake as d

spring flax
#

what's the best way to get each element of a list which contains all integers?

silver sundial
#

is there anyone who can make me a discord moderation bot

spring flax
silver sundial
maiden fable
#

!resources can help u get started

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.

silver sundial
#

there is nothing there

maiden fable
#

There is

nimble plume
#

docs i need u

slate swan
silver sundial
spring flax
# maiden fable loop?

you mean like [for i...] or `

for i in something:
  #code```?
Anyways, I want to get it in one line
nimble plume
spring flax
nimble plume
slate swan
flat solstice
#

So I'm thinking I have some logic issues with this commandpy @commands.command(description = "Get this bots PoC's.", usage = "poc", hidden = False) async def poc(self, ctx): key_perms = ["manage_guild", "manage_messages",] embed = discord.Embed(title = f"Point of Contact(s) for {self.bot.user.name}", colour = self.bot.primary_colour) for guild in self.bot.guilds: admins=[] mods=[] owner="" pocs=[] for member in guild.members: if member is guild.owner: owner = guild.owner elif "administrator" in member.guild_permissions: admins.append(member) elif key_perms in member.guild_permissions: mods.append(member) else: if member.id == self.bot.config.admins: member = "<@{member}>" pocs.append(member) #admins_str=', '.join(admins) #mods_str=', '.join(mods) embed.add_field(name = guild.name, value = f"PoC(s): {', '.join(pocs)}\nOwner: {owner}\nAdmin(s): {', '.join(admins)}\nMod(s): {', '.join(mods)}") await ctx.reply(embed=embed)bc the screenshot is the current output but the pocs, admins and mods are all blank when there should defiantly be users next to them for two of the guilds

nimble plume
maiden fable
slate swan
nimble plume
#

use vortex

slate swan
nimble plume
spring flax
maiden fable
#

There's Atlas too then

#

There are hundreds of those tbh

nimble plume
#

also my bot provide custom commands for special server ๐Ÿ™‚ must have 1k + members

maiden fable
#

Oh cool

#

And then there's me who doesn't work on my bot anymore ๐Ÿ˜

spring flax
# maiden fable It's already a list

okay well basically i want to query my DB and get the list of blacklisted role ID's and do @commands.has_any_role() on it but it has to be in ints, not a list

spring flax
flat solstice
nimble plume
#

also if ur server has 100k + members i can also create whole new bot for u for free! ๐Ÿ™‚

nimble plume
#

i hate buttons in disnake

maiden fable
silver sundial
#

!hello

#

susy baka

nimble plume
#

im not failed i just find 10 different types of syntax that dont work

#

finds who tell all are same

slate swan
vale wing
nimble plume
#
  • open source
#

but u want to pay for that (not against rule no help nothing stop spamming rule)

#
view = discord.ui.View()
item = discord.ui.Button(style=discord.ButtonStyle.blurple, label="Click Me", url="https://google.com")
view.add_item(item=item)
await ctx.send("This message has a button!", view=view)
heavy folio
nimble plume
#

find something

nimble plume
pine crypt
#

Why does this happen?

nimble plume
#

tryes to react

pine crypt
#

I only want 1 embed

nimble plume
pine crypt
nimble plume
#

edit embed u mean

pine crypt
#

no as in it sends 2 embeds and edits the 2nd not sure why

nimble plume
#

sorry cant help

pine crypt
#

ok

slate swan
spring flax
#

how do I pass a list that I get from a async funtion to has_any_role?

pine crypt
#

Does paginator autogenerate the number of pages based on how many commands?

vale wing
vale wing
rotund creek
#

Hi

#

I had a question

#

So For example

#

!say hello there, hi there <user>

#

How do I make the first entire argument send to me

#

Followed by the second to user

#

Thos is just example ik doing myself weird

slate swan
nimble plume
#

f

rotund creek
#

No

nimble plume
#
AttributeError: 'Member' object has no attribute 'avatar_url'
``` hec?
slate swan
#

ohhh

rotund creek
#

First arg (before xomma)

#

Second after

slate swan
rotund creek
#

Member.display_avatar.url

nimble plume
slate swan
nimble plume
#

disnake has diffferent

maiden fable
maiden fable
#

!d discord.Member.display_avatar

unkempt canyonBOT
#

property display_avatar: discord.asset.Asset```
Returns the memberโ€™s display avatar.

For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.

New in version 2.0.
maiden fable
#

You crying in a corner, Ash? ๐Ÿ‘€

nimble plume
#

@command.cog.listener not working

#
@commands.Cog.listener()
maiden fable
#

Should work

nimble plume
#

disnake

#
    @commands.Cog.listener()
    async def on_guild_channel_create(self, channel):
           embed = disnake.Embed(description=f"**Channel Created : {channel.mention}**", value="** **",color=aqua,timestamp=datetime.utcnow())
           embed.set_author(name=f"{channel.guild}", icon_url=f"{channel.guild.icon_url}")
           await channelslogs.send(embed=embed)
maiden fable
#

channelslogs isn't defined

nimble plume
#

channelslogs = await self.bot.fetch_channel(927193880116473906)

slate swan
nimble plume
#

value/

slate swan
#

What

nimble plume
#

yes what value

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

What kind of value param?

nimble plume
#

ok value of embed

nimble plume
slate swan
maiden fable
#

Lmao

nimble plume
#

๐Ÿฅฒ

maiden fable
#

Imma just go

slate swan
nimble plume
surreal sierra
#

does someone know how I fix this error? I accidentally installed NextCord (which Im not using) and deleted it later bcz it gaves me many errors and I didnt use it but now all my import that is related to Discord.py just gives errors. Just like this one on the screenshot

slate swan
nimble plume
#

huh

maiden fable
nimble plume
#

what happen??

slate swan
surreal sierra
slate swan
#

Re-open cmd

maiden fable
#

Most probably wrong Python version

nimble plume
maiden fable
#

Open cmd and run python -V

nimble plume
#

ok

maiden fable
#

Tell the output

maiden fable
nimble plume
#

its python 2.0

slate swan
surreal sierra
nimble plume
maiden fable
#

Remove that

#

value=...

nimble plume
#

embed = disnake.Embed(description=f"Channel Created : {channel.mention}", value="** **",color=aqua,timestamp=datetime.utcnow())

nimble plume
maiden fable
#

Ik...

nimble plume
#

so?

maiden fable
#

Dude I just told u

#

Remove the value=...

nimble plume
#

ok removing

maiden fable
#

@slate swan why u leave me alone

nimble plume
#

removed

nimble plume
maiden fable
#

I ain't...

#

Anyways

#

does it work now?

slate swan
slate swan
nimble plume
#

im noob

#

oh my fuck how tf its not giving error

#

disnake is weird

slate swan
#

!d disnake.Embed

unkempt canyonBOT
#

class disnake.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.10)") 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://docs.disnake.dev/en/latest/api.html#disnake.Embed.Empty "disnake.Embed.Empty").

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

need lot of edit

slate swan
#

@nimble plume even disnake does not have a value parameter in the initiator function of the Embed class

slate swan
#

no?

#

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

what kind of explanation do you want?

nimble plume
#

add_field*

#

!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.
nimble plume
#

value

slate swan
nimble plume
#

here u go

slate swan
nimble plume
#

i gived u code

slate swan
nimble plume
slate swan
nimble plume
#

hi gus

slate swan
nimble plume
#

lol