#discord-bots

1 messages · Page 826 of 1

slate swan
#

use disnake if you wanna have the same dpy syntax

nimble plume
#

Do i need to edit or make entire new code..

slate swan
nimble plume
buoyant quail
#

xd

nimble plume
#

F

gaunt ice
nimble plume
#

Is hikari a different lauguage??

slate swan
gaunt ice
#

if i include the if statement it isnt working

slate swan
nimble plume
#

Ok.

slate swan
#

yes.

nimble plume
#

Better than js??

slate swan
gaunt ice
#

bruh lol it aint another lang

#

its python

nimble plume
#

I want the best cuz i dont want to change in future

#

Cuz hikari dont has same

#

As ash said

slate swan
nimble plume
#

What are advantages

#

From hikari amd disnake

placid skiff
#

.-.

nimble plume
#

What hikari has that snake didnt

#

!d

slate swan
nimble plume
hallow tangle
#

ok the command doesn't work this was the code ```py
deletion_list = []
@bot.command()
async def deleteadd(ctx, user: disnake.User):
await deletion_list.append(user.id)
await ctx.send("Done.")

@bot.event
async def on_message(msg):
if msg.author in deletion_list:
await msg.delete()```

placid skiff
nimble plume
#

Switching to disnake

#

Pycord also yes yes

gaunt ice
nimble plume
#

:quote:

gaunt ice
#

my thing works but everytime some one reacts again its sends it again

placid skiff
gaunt ice
nimble plume
#

Both works fine

gaunt ice
#

listen works

nimble plume
#

For me

nimble plume
placid skiff
#

No, he has to check if the number of reactions is greater than 1, or 2 if the bot adds the reaction

nimble plume
#

Huh?

hallow tangle
#

I need test guilds i guess

placid skiff
#

wait why?

#

it isn't a slash command

hoary cargo
hallow tangle
gaunt ice
# nimble plume Try printing emoji name

no so basically when the quote emoji is added the message shud be sent in that channelbut i dont want it to repeat everytime when another user added that same emoji

quaint epoch
#

is there an event to detect when the bot joins a guild?

hoary cargo
#

on_guild_join

quaint epoch
#

nice

slate swan
unkempt canyonBOT
#

discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.

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

....

placid skiff
# gaunt ice OHH TYSMM

that will don't work if the user will delete the reaction, make sure to check if an user has already addedd a reaction too

timber crag
#

also whats the context where its not getting "updated"

#

is it,

a: your internet
b: your IDE
c: didnt save code
d: none of the above

hallow tangle
#

d

timber crag
#

ok

hallow tangle
#

vs code

timber crag
#

alright

#

so when did it start

hallow tangle
#

start?

timber crag
#

yes

#

what were you doing when it wasnt updating

hallow tangle
#

I added a new command

timber crag
#

in a cog or the main file

hallow tangle
#

and was not able to find it in help menu after running the script

#

main file

timber crag
hallow tangle
#

yes

timber crag
#

can you send the code for the command

#

and ill check for errors

timber crag
quick gust
#

either use @bot.listen() or process the commands

timber crag
quick gust
#

!d discord.ext.commands.Bot.process_commands

unkempt canyonBOT
#

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

This function processes the commands that have been registered to the bot and other groups. Without this coroutine, none of the commands will be triggered.

By default, this coroutine is called inside the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event, then you should invoke this coroutine as well.

This is built using other low level tools, and is equivalent to a call to [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") followed by a call to [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").

This also checks if the message’s author is a bot and doesn’t call [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
timber crag
#

no ctx

timber crag
hallow tangle
#

I'll use @bot.listen()

quick gust
#

happens

timber crag
#

just put it at the bottom of the on_message

hallow tangle
#

oh

quick gust
#

processing is easier but listen is recommended with some exceptions

timber crag
#
@bot.event
async def on_message(message):
  do stuff here
  await bot.process_commands(message)
quick gust
#

just change .event to .listen()

#

!d discord.ext.commands.Bot.listen

unkempt canyonBOT
#

@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")

The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.9)").

Example...
timber crag
quick gust
timber crag
#

ctrl + f

quick gust
#

u can have multiple .listen()'s aswell

timber crag
#

and you can also use it for errors

#

idk if listen can be used for error handling

#

i dont use it

quick gust
#

yeah just use on_command_error for that

#

bot.event is useful in some cases for on_message, as I said

hallow tangle
#

error now

#
TypeError: object NoneType can't be used in 'await' expression```
#

in this line py await deletion_list.append(user.id)

hallow tangle
#

did

timber crag
#

thats it

hallow tangle
#

let me wait for output

quaint epoch
#

is there a on_guild_leave event?

quick gust
#

on_guild_remove

timber crag
#

i did it wrong

#

it exists though

quaint epoch
#

!d disnake.on_guild_remove

unkempt canyonBOT
#

disnake.on_guild_remove(guild)```
Called when a [`Guild`](https://docs.disnake.dev/en/latest/api.html#disnake.Guild "disnake.Guild") is removed from the [`Client`](https://docs.disnake.dev/en/latest/api.html#disnake.Client "disnake.Client").

This happens through, but not limited to, these circumstances...
timber crag
#

same as with members with

on_member_join

and

on_member_remove

nimble plume
#

Give disnake docs

hallow tangle
timber crag
#

you get the user id, and you are looking for the name

hallow tangle
#

oh

timber crag
#

now, you are looking for the matching id

nimble plume
#

Im using cogs can it be used in disnake

quick gust
#

ofc

nimble plume
#

Okk

quick gust
#

disnake is a fork

balmy ivy
#

How can i make it so it @s them so its blue?

#

when i did message.mentios it didnt like make it look like this @balmy ivy

timber crag
#

what?

hallow tangle
#

thx

timber crag
#

thats just how vsc looks

quick gust
#

!d disnake.Member.mention

unkempt canyonBOT
nimble plume
#

Buffalo bills

balmy ivy
quick gust
timber crag
quick gust
timber crag
nimble plume
timber crag
#

i have no idea why he said "so its blue" it threw me off track

quick gust
timber crag
nimble plume
balmy ivy
nimble plume
#

There functuons are same

#

Just add a class

timber crag
quick gust
balmy ivy
#

also for this what would i do for it to @ the bills team?

quaint epoch
#

or just obj.mention

quick gust
balmy ivy
#

yea

quick gust
#

!discord.Role.mention

#

!d discord.Role.mention

unkempt canyonBOT
quaint epoch
#

yea so get the role and mention it

quick gust
#

if u have the role object, just .mention it

quaint epoch
#

but yes .mention is better

quaint epoch
#

before i knew message.jump_url existed - f'https://discord.com/channels/{message.guild.id}/{message.channel.id}/{message.id}'

quick gust
#

lol

balmy ivy
#

wait so it would be + mention],

nimble plume
#

100% copied docs of discord. Py

shrewd inlet
#

what’s the member variable without the discriminator?

#

like

#

“ernesto” not “ernesto#1234”

nimble plume
#

.name

shrewd inlet
#

ty

nimble plume
#

Lol

final iron
unkempt canyonBOT
#

property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.name "discord.User.name")
quick gust
nimble plume
quaint epoch
#

difference between -

unkempt canyonBOT
#

property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.name "discord.User.name")
quaint epoch
#

and

#

!d discord.Member.display_name

unkempt canyonBOT
#

property display_name: str```
Returns the user’s display name.

For regular users this is just their username, but if they have a guild specific nickname then that is returned instead.
nimble plume
#

Nick

#

Display nick is for nicknames

timber crag
quaint epoch
unkempt canyonBOT
#

property me: discord.member.Member```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
balmy ivy
timber crag
balmy ivy
#

yeah its a role

timber crag
#

alr

quick gust
nimble plume
#

Hmm

quick gust
nimble plume
#

Infernum where do i add disnake class in or outside cogs class

quick gust
#

what?

nimble plume
#
Class cogs(stuff)
      Class disnake 
slate swan
#

Disnake is not a class, it's a library

gaunt ice
#

how to count the no.of reactions of one emoji

nimble plume
#

Oh

#

I dont knwo that :/

#

Im not from pc bruhhh

#

class sometning(disnake whatever)

timber crag
gaunt ice
#

LIKE THAT COUNT

nimble plume
#

???

gaunt ice
#

sr for caps

slate swan
unkempt canyonBOT
#

async for ... in users(*, limit=None, after=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/master/api.html#discord.AsyncIterator "discord.AsyncIterator") representing the users that have reacted to the message.

The `after` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

Examples

Usage

```py
# I do not actually recommend doing this.
async for user in reaction.users():
    await channel.send(f'{user} has reacted with {reaction.emoji}!')
```...
slate swan
#

And use len on it

gaunt ice
#

ahhh how do i explain

#

the same emoji

#

but the count of it

nimble plume
#

Paint

slate swan
#

yes, discord.Reaction.users will return the users who reacted with an emoji (yes, same emoji)

placid skiff
#

How to create a cooldown for specific user? @cooldown will work?

slate swan
gaunt ice
slate swan
placid skiff
nimble plume
#

Im typing with finger 1

#

1 finger

slate swan
shrewd inlet
nimble plume
#

Show code

shrewd inlet
#

alr

spring verge
#

I was wondering how does dank memer actually make progress bars with the emojis?

slate swan
#

Use len on it

gaunt ice
#

ohh okk

final iron
spring verge
slate swan
nimble plume
#

Ok

slate swan
spring verge
#

what do they multiply with and how do they change the emoji

gaunt ice
spring verge
#

to fit the percentage

gaunt ice
#

@slate swan

slate swan
# gaunt ice

ah payloads, sorry haven't worked with them yet.

gaunt ice
spring verge
#

payload

#

looks very similar to ctx or context

spring verge
#

idk which library is that tho

#

anyone else who uses hikari and lightbulb here?

nimble plume
#

Lightbulb

final iron
nimble plume
#

No

final iron
#

Or a fork

spring verge
#

ooo

spring verge
nimble plume
#

Use disnake python

spring verge
#

I mean hikari-lightbulb

#

I think its great :)

nimble plume
final iron
#

!d discord.RawReactionActionEvent

unkempt canyonBOT
#

class discord.RawReactionActionEvent```
Represents the payload for a [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") or [`on_raw_reaction_remove()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_remove "discord.on_raw_reaction_remove") event.
final iron
quick gust
nimble plume
spring verge
nimble plume
#

Epi

final iron
nimble plume
#

!python

spring verge
nimble plume
#

False opinion use disnake

spring verge
#

python = snake and python = discord server and discord server = snake

#

so disnake 0-0

nimble plume
#

Python = snake so bot = snake+discord = disnake

nimble plume
#

¯\_(ツ)_/¯

nimble plume
#

@slate swan hbday ^_^

slate swan
#

I'm doing that from even before dpy was closed :p

nimble plume
#

Flex

#

🥲

slate swan
#

anyways, ot

nimble plume
slate swan
nimble plume
#

None wished me on dc 🥲

#

🥲

slate swan
#

!ot they didnt wish me too, im fine

unkempt canyonBOT
rancid tendon
#

There are bots that have cooldowns.
How are they actually doing those?
I'm trying to find another way than "simply" using asyncio.sleep(), since it also has to work after a restart.

nimble plume
#

Toatally not ot

maiden fable
#

Oh hi there NIR

pale turtle
pale turtle
maiden fable
#

👋

sick birch
cold sonnet
pale turtle
sick birch
#

Oh I see

slate swan
sick birch
#

Yeah you’ll want to store it in a database

nimble plume
#

Robinhood

cold sonnet
slate swan
#

isnt that too much of a load?

maiden fable
#

👀 changing cooldowns?

cold sonnet
#

change what's stored

#

in the database

rancid tendon
nimble plume
maiden fable
#

Hmm, preferred would be to use threading and run it in a different thread tbh

rancid tendon
nimble plume
#

Maybe use hours

stone moon
#

how to get bot to check for "hi" in a specific channel by channel name?

stone moon
timber crag
stone moon
timber crag
stone moon
timber crag
stone moon
#

THANK YO

timber crag
#

@stone moon or you can search the channel for the word using await channel.history(limit=1000).flatten()

#

then

stone moon
#

but i wanna get it by channel name using like discord.utils.get so its versatile but i forgot syntax

timber crag
#
  channel = bot.get_channel(channelID)
  messages = await channel.history(limit=123).flatten()
  if "word" in messages:
    do stuff
slate swan
#

How do I hid or customize this help message

timber crag
#

then you can make your own

unkempt canyonBOT
#

discord.utils.get(iterable, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/master/api.html#discord.utils.find "discord.utils.find").

When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.

To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.

If nothing is found that matches the attributes passed, then `None` is returned.

Examples

Basic usage...
timber crag
slate swan
timber crag
timber crag
slate swan
#

Okay

slate swan
timber crag
#

utils.get is varied compared to bot.get_channel.

slate swan
#

I know

timber crag
#

its been deprecated since anything after 1.8.x

maiden fable
#

Huh?

#

Who says utils is deprecated

slate swan
#

Wha...

slate swan
timber crag
maiden fable
#

No?

timber crag
maiden fable
#

Who tf says that

slate swan
maiden fable
#

Lmao Ash God 🙏

slate swan
#

thanks, lol

#

Its not even commented yet ngl :/

maiden fable
#

Who even comments their code nowadays lol

timber crag
maiden fable
#

I never did that, except for a school project but anyways

timber crag
#

i need serious help

slate swan
maiden fable
#

Same but for school only

slate swan
#

Cool

#

!ot

unkempt canyonBOT
maiden fable
#

Since my projects are closed source idc

maiden fable
timber crag
maiden fable
#

Hmm cool

slate swan
slate swan
maiden fable
#

Sure, I don't have a problem

maiden fable
slate swan
timber crag
maiden fable
timber crag
#

can you guys answer something for me

maiden fable
timber crag
#

@quaint epoch is there a way i can make a url my embed title?

quaint epoch
#

you mean like, put a url embed IN the embed?

slate swan
#

a hyper link in a title?

timber crag
#

like the title redirects to a url

quaint epoch
timber crag
slate swan
#

nah idk if you can

timber crag
slate swan
#

only in descriptions iirc

quaint epoch
slate swan
timber crag
#

you know those markdown links

slate swan
#

ok you mean something like this

here

and here is a link

quaint epoch
#

yes

timber crag
#

like that, if you can picture it

slate swan
#

thats how you do it

timber crag
#

its for a reminder command. with the message.jump_url

#

i also have one more problem

#

but its kind of weird

timber crag
#

i got it

#
  @commands.command(brief="🕒 | Set a reminder up to a month! (1d, 1h, 1m, 1s) 'm!reminder 10m do the dishes'")
  async def reminder(self, ctx, time, *, reminder):
    embed = discord.Embed(
      description = f":MechaAccepted: | Set a reminder for {reminder} in {time}!",
      color = discord.Color.green()
    )
    msg = await ctx.send(embed=embed)
    ctime = {"s":1, "m":60, "h":3600,"d":86400}
    mtime = int(time[0]) * ctime[time[-1]]
    await asyncio.sleep(mtime)
    embed = discord.Embed(
      title = "Reminded!",
      url=msg.jump_url,
      description = f"{time} ago you asked me to remind you of {reminder}. To see the message, please click the title of this embed!",
      color = discord.Color.green()
    )
    try:
      await ctx.author.send(embed=embed)
    except:
      await ctx.send(content=ctx.author.mention, embed=embed)
``` @slate swan
#

there is another problem

#

if i try to make it ten minutes it only does it for one minute

#

and it gives no error

#

but i cant find it

rich lantern
#

Hello, can I apply here for help related to programming?

timber crag
#
ctime = {"s":1, "m":60, "h":3600,"d":86400}
mtime = int(time[0]) * ctime[time[-1]]
await asyncio.sleep(mtime)
``` is mainly the thing
timber crag
slate swan
slate swan
#

or just helping users

timber crag
#

and also it gives errors when i add the "d" or "m" for minutes

rich lantern
#

I understood this, I just went in, the problem is different, if I need help, will they help me?

timber crag
#

yes

rich lantern
#

okay

timber crag
#

@slate swan do you have any idea why it isnt working because im lost lmao

#
ctime = {"s":1, "m":60, "h":3600,"d":86400}
    mtime = int(time[0]) * ctime[time[-1]]
    await asyncio.sleep(mtime)
slate swan
timber crag
slate swan
timber crag
slate swan
timber crag
slate swan
balmy ivy
#

?

slate swan
#

!f-strings

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

timber crag
slate swan
slate swan
timber crag
slate swan
#

a better solution would be to store it somewhere and use some polling mechanic

#

a db

#

you store the time and you check it maybe every 30mins so many users can use it with their snowflake id binded and just place holders if using sql to avoid sql injection

rich lantern
#

I have a very strange request for help, now I will try to describe

#

It's just that my teacher sent me a file (4.63mb; exe, apparently just a deliberately broken file). No code, no information. The only thing to do is open it. The word (musical instrument) should appear in the console.
I've tried ALL methods, but nothing comes up. I started to think he was just playing a trick on me. Does anyone have any ideas? I will be very grateful.

timber crag
#

@slate swan im going to test this now

@commands.command(brief="🕒 | Set a reminder up to a month! (1d, 1h, 1m, 1s) 'm!reminder 10 min do the dishes'")
  async def reminder(self, ctx, time: int, timetype="s", *, reminder):
    embed = discord.Embed(
      description = f":MechaAccepted: | Set a reminder for {reminder} in {time}{timetype}!",
      color = discord.Color.green()
    )
    msg = await ctx.send(embed=embed)
    if timetype == "m":
      mtime = time * 60
    elif timetype == "h":
      mtime = time * 3600
    elif timetype == "d":
      mtime = time * 86400
    await asyncio.sleep(mtime)
    embed = discord.Embed(
      title = "Reminded!",
      url=msg.jump_url,
      description = f"{time}{timetype} ago you asked me to remind you of {reminder}. To see the message, please click the title of this embed!",
      color = discord.Color.green()
    )
    try:
      await ctx.author.send(embed=embed)
    except:
      await ctx.send(content=ctx.author.mention, embed=embed)
slate swan
timber crag
#

how can i make it so i dont need the space

#

but its still 2 args

slate swan
#

you always need them

timber crag
#

rip

rich lantern
hoary cargo
#

string concatenation topggThumbsDown
f string topggThumbsUp

unkempt canyonBOT
slate swan
#

maybe ot channels

timber crag
#

@slate swan

#

it goes after like 2 seconds

#

and it doesnt change the time

rich lantern
#

Everyone is silent

#

in 'ot'

timber crag
#

fixed

#
mtime = 0
    if timetype.lower() in ["s", "sec", "seconds"]:
      mtime = time
    elif timetype.lower() in ["m", "min", "minutes"]:
      mtime = time * 60
    elif timetype.lower() in ["h", "hrs", "hs", "hours", "hour", "hr"]:
      mtime = time * 3600
    elif timetype.lower() in ["d", "day", "da"]:
      mtime = time * 86400

i had == instead of in

keen talon
#

Use re pithink

#

And datetime module

slate swan
#

bro f strings are a thing

timber crag
#

do this.

embed = discord.Embed(
  title = "aaa",
  description = "ok",
  color = 0xfffff
)
await message.channel.send(embed=embed)
slate swan
#

!e

print(str)
unkempt canyonBOT
#

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

<class 'str'>
balmy ivy
slate swan
#

yes it would

balmy ivy
#

bro do you want me to show you?

slate swan
#

embed is just an instance of the class it doesnt matter

balmy ivy
#

i already tried but i will show you

slate swan
#

its basic oop

keen talon
slate swan
#

lol

keen talon
#

@slate swan 👋

slate swan
#

hi

keen talon
#

Saw you after a million years

slate swan
#

ikr hyd

keen talon
slate swan
balmy ivy
# slate swan nice

so with that type of embed how will i mention the role and the mention the user?

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

slate swan
#

and thats not a type of embed

slate swan
#

thats just a instance of a class

balmy ivy
keen talon
balmy ivy
#

no ik that but how would i set that up

keen talon
#

Damn you need to read some docs pithink

timber crag
balmy ivy
slate swan
unkempt canyonBOT
#

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

001 | crazy numbers are:
002 | 1234567890
003 | new stuff
timber crag
#

use

embed = discord.Embed(
  title = f"{message.author.mention}"
)
await message.channel.send(embed=embed)
#

@balmy ivy

timber crag
#

well not in that sense

keen talon
slate swan
#

no need for the f string

timber crag
#

yeah i get what you mean now

#

but he has text i shouldve included

keen talon
slate swan
#

!e

a = "lol"
print(a)
print(f"lmao{a}")
unkempt canyonBOT
#

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

001 | lol
002 | lmaolol
timber crag
#
embed = discord.Embed(
  title = f"What a great day, {message.author.mention}! Dont you agree?"
)
await message.channel.send(embed=embed)
#

that makes more use of the f string

slate swan
#

yes

timber crag
#

@balmy ivy

#

!e

a = "this is great!"
print(f"you know what..\n{a} we shouldve done this sooner!")
unkempt canyonBOT
#

@timber crag :white_check_mark: Your eval job has completed with return code 0.

001 | you know what..
002 | this is great! we shouldve done this sooner!
brittle flume
#

What is wrong with this?

import discord
import os
from discord.ext import commands
from dotenv import load_dotenv

bot = commands.Bot(command_prefix = '.')

token = os.getenv['TOKEN']

@bot.event
async def on_ready():
  msg = f'{bot.user[:-5]} is ready for action'
  print(msg, '\n', '-'*len(msg))

bot.run(token)

Error:

Traceback (most recent call last):
  File "/data/data/com.termux/files/home/Codes/Bots/Hashirama/main.py", line 1, in <module>
    import discord
ModuleNotFoundError: No module named 'discord'

Modules installed:

ffmpeg-python==0.2.0
future==0.18.2
imageio-ffmpeg==0.4.5
numpy==1.22.2
pycord==0.1.1
python-dotenv==0.19.2

Using latest pycord
Used all instruction given in the docs

final iron
#

Have you installed pycord?

brittle flume
#

yes

final iron
#

Are you using a venv?

brittle flume
#

yes

final iron
#

Have you selected the correct interpreter?

brittle flume
#

wdym

final iron
#

You need to select the python executable in the venv iirc

slate swan
#

Helpp

tidal hawk
#

TypeError: get_channel() missing 1 required positional argument: 'id'

#

What ?!

manic wing
#

seems like self.config[...] is returning None

#

print(self.configs["channel_level_update"])

#

unless the error is different to where you sent

#

search for get_channel()

steel void
#

how do I make it where if youre not bot owner it'll respond saying "this command is restricted to the bot owner"

#
@CLIENT.slash_command(name = "shutdown", description = "Allows vondy to shutdown the bot.")
@commands.is_owner()
async def shutdown(ctx):

    em = discord.Embed(title = f"The bot is shutting down.", color = discord.Color.red())
    await ctx.respond(embed = em)

    exit()```
cloud dawn
#

!d disnake.ext.commands.NotOwner

unkempt canyonBOT
#

exception disnake.ext.commands.NotOwner(message=None, *args)```
Exception raised when the message author is not the owner of the bot.

This inherits from [`CheckFailure`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.CheckFailure "disnake.ext.commands.CheckFailure")
steel void
#

is there a video to understand the docs cause I have no idea how to read docs

tidal hawk
# manic wing search for `get_channel()`

Even if I replace the self.configs... with actual pure id, it's still giving the same error: TypeError: get_channel() missing 1 required positional argument: 'id'

naive spoke
#

how do i make a command

dry kelp
#
0|spooky  | Ignoring exception in on_guild_remove
0|spooky  | Traceback (most recent call last):
0|spooky  |   File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 351, in _run_event
0|spooky  |     await coro(*args, **kwargs)
0|spooky  |   File "/root/SPOOKY/Bot/bot_auto_events/on_guild_remove.py", line 34, in on_guild_remove
0|spooky  |     embed = discord.Embed(title=f"__REMOVED__\n{guild.name}", description=f"`Owner     :` {guild.owner}\n`Humans    :` {len(list(filter(lambda m: not m.bot, guild.members)))}", color=discord.Color.red)
0|spooky  |   File "/usr/local/lib/python3.8/dist-packages/discord/embeds.py", line 189, in __init__
0|spooky  |     self.colour = colour if colour is not EmptyEmbed else color
0|spooky  |   File "/usr/local/lib/python3.8/dist-packages/discord/embeds.py", line 318, in colour
0|spooky  |     raise TypeError(f'Expected discord.Colour, int, or Embed.Empty but received {value.__class__.__name__} instead.')
0|spooky  | TypeError: Expected discord.Colour, int, or Embed.Empty but received method instead.
#

huh

manic wing
dry kelp
#
        embed = discord.Embed(title=f"__REMOVED__\n{guild.name}", description=f"`Owner     :` {guild.owner}\n`Humans    :` {len(list(filter(lambda m: not m.bot, guild.members)))}", color=discord.Color.red)
        embed.set_footer(text=f"Total: Servers: {Servers}, Members: {Members}")
manic wing
#

its a classmethod

dry kelp
#

oh yea

cloud dawn
#

tbf they should've made it a property.

manic wing
#

discord.Color returns hex

#

red is a classmethod

#

not a sin tbh

neat pagoda
#

Anyone use replit? If so, do you have the hacker plan?

manic wing
#

no.

pliant gulch
#

As what if I only wanted blue? Then I would be forced to have an instance that has all the other colours as well

manic wing
#

self promo isnt allowed

cloud dawn
#

We don't allow recruiting here.

neat pagoda
#

ok

cloud dawn
naive spoke
#
@client.command(name='VVD')
    async def on_message(ctx: commands.context):
      await ctx.send("is the best defenda")

this doesent work for some reason i think its because on_message is sorta dimmed why is that

manic wing
naive spoke
#

a) ok
b) ?
c) yes

manic wing
#

its either one or the other

naive spoke
#

oh

manic wing
#

im joking

naive spoke
#

k

manic wing
naive spoke
#

yea

manic wing
#

but that shouldnt break it

slate swan
#

Hello I want to make it so after a webhook sends 10 messages it stops

naive spoke
manic wing
#

?

naive spoke
#

like

#

only the cap?

manic wing
#

yes

#

but one capital makes a huge difference

naive spoke
#

ok

slate swan
#

@naive spoke caps are really important it can cause your whole code to fail

naive spoke
#

alright

#

when i ran ?help i got this TypeError: on_message() takes 0 positional arguments but 1 was given

manic wing
#

can we see your code please? i have a theory

naive spoke
#

ok

lyric tusk
#

code ```py
@commands.command(aliases =['Mute'])
async def mute(self, ctx, members: commands.Greedy[discord.Member],
mute_minutes: typing.Optional[int] = 0,
*, reason: str= "None"):

    if not members:
        await ctx.send("You need to name someone to mute")
        return
    if member == ctx.author:
        return await ctx.send("You can not mute yourself")

    muted_role = discord.utils.find(ctx.guild.roles, name="Muted")

    for member in members:
        if self.bot.user == member: 
            embed = discord.Embed(title = "You can't mute me, I'm an almighty bot")
            await ctx.send(embed = embed)
            continue
        await member.add_roles(muted_role, reason = reason)
        await ctx.send("{0.mention} has been muted by {1.mention} for *{2}*".format(member, ctx.author, reason))

    if mute_minutes > 0:
        await asyncio.sleep(mute_minutes * 60)
        for member in members:
            await member.remove_roles(muted_role, reason = "time's up ")

error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'member' referenced before assignment
Ignoring exception in command None:

manic wing
pine crypt
#

How would you get the number of cogs the bot has as a string and append to a list?

manic wing
pine crypt
#

My more advanced help command than yesterday

final iron
manic wing
manic wing
pine crypt
#

lol

pliant gulch
#

This could be a lot cleaner by subclassing HelpCommand and using that as a skeleton class

#

As there are some good tear down methods, etc

manic wing
pine crypt
#

So this works?

tidal hawk
#

What does TypeError: 'InvokableSlashCommand' object is not subscriptable mean

naive spoke
lyric tusk
final iron
unkempt canyonBOT
#

@final iron :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: 'int' object is not subscriptable
pine crypt
tidal hawk
pine crypt
#

What attributes does self.client.cogs have?

lyric tusk
final iron
pine crypt
final iron
#

!d discord.ext.commands.cog.Cog

unkempt canyonBOT
#

class discord.ext.commands.Cog(*args, **kwargs)```
The base class that all cogs must inherit from.

A cog is a collection of commands, listeners, and optional state to help group commands together. More information on them can be found on the [Cogs](https://discordpy.readthedocs.io/en/master/ext/commands/cogs.html#ext-commands-cogs) page.

When inheriting from this class, the options shown in [`CogMeta`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CogMeta "discord.ext.commands.CogMeta") are equally valid here.
final iron
pine crypt
#

How would you find the name of a command?

#

qualified_name?

final iron
#

!d discord.ext.commands.core.Command

unkempt canyonBOT
#

class discord.ext.commands.Command(*args, **kwargs)```
A class that implements the protocol for a bot text command.

These are not created manually, instead they are created via the decorator or functional interface.
final iron
#

You can look though the attributes

#

But, yes, it is qualified_name

pine crypt
#

Does command have a .name attribute?

final iron
manic wing
# pine crypt

why tf you're putting [] around it i will never know

pine crypt
#

So I have the variable pages but when I / 4 if len(contents) is less than the next multiple of 4 then it prints a decimal number of pages. How to round that up to next whole number

manic wing
pine crypt
#

Sooooooooooo? What

naive spoke
manic wing
naive spoke
#

.

naive spoke
pine crypt
manic wing
pine crypt
#

Where does the u and n come from?

glad palm
#

out of curiosity, does anyone know if discord bots connect to discord's servers via a secure protocol, or is it plaintext data transfer?

manic wing
#

[-1] returns the last character

pine crypt
#

Where?

rotund frigate
#

how come this doesnt work?

#
    if ctx.message.author.guild_permissions.administrator:
      await member.kick(reason=reason)

    await ctx.send(f'User {member} has kicked.')

    elif:
    await ctx.send("You don't have permission to kick members.")```
manic wing
#

look at contents

pliant gulch
rotund frigate
glad palm
manic wing
naive spoke
rotund frigate
#

i want to fix the else

naive spoke
pine crypt
#

@manic wing example as in a simpler version that I could possibly understand instead of yours which is what 200+ lines long?

scarlet aurora
#

e

manic wing
pine crypt
#

I deleted the help command and I'm restaring I think I have a general idea of how I want it to work

manic wing
#

good luck

slow fog
#

i will sus you

slate swan
#

🥺

manic wing
#

you've got member intents?

#

try debugging it (adding prints in various places to see where it triggers/doesnt trigger)

slate swan
#

Okay

pine crypt
#

command has an attribute named value?

manic wing
pine crypt
#

What about description?

manic wing
#

yes

#

!d discord.ext.commands.command

unkempt canyonBOT
#

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

By default the `help` attribute is received automatically from the docstring of the function and is cleaned up with the use of `inspect.cleandoc`. If the docstring is `bytes`, then it is decoded into [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") using utf-8 encoding.

All checks added using the [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") & co. decorators are added into the function. There is no way to supply your own checks through this decorator.
manic wing
#

this will show it all

pine crypt
#

Anything I could improve on or does it all look good so far?

scarlet aurora
#

what's the best tool to obfuscate code?

final iron
scarlet aurora
#

what's the best tool to obfuscate PYTHON

final iron
scarlet aurora
#

it's python

final iron
#

But it's not discord bots

#

Read the channel description

scarlet aurora
final iron
#

How many times do I have to say it's not relevant to this channel

pine crypt
#

What does this error mean?

manic wing
#

it means that you didnt listen to me the last time i told you what it meant shipit

final iron
pine crypt
#

ye

pine crypt
viral wolf
#
  curseWord = ['word1', 'word2']
  if any(word in message.content.lower() for word in curseWord):
    await message.delete()

When I run this, the message just flickers a bit and stays, does anyone know why this doesn't work?

#

The bot has manage messages perms too

slate swan
#

As you would do normally?

final iron
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

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

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
final iron
#

Just to note, coming here shouldn't be your first resource

left crater
#

read the docs bruv

final iron
#

The order should be docs -> Google -> here

#

Depending on your search engine you can use ctrl + f to search for keywords in the docs

#

You can even search right here. Searching for add reaction brings up the result you needed

slate swan
#

Can someone help I got a command that I wanna repeat

#

And it stops when you do !stop

#

Dw it’s not spamming api

final iron
#

Just ask

slate swan
#

What

pine crypt
#

Can't fix this

slate swan
#

I just lost 60 brain cells

final iron
#

"Can someone help"

#

Just ask your question

slate swan
slate swan
pine crypt
slate swan
#

from discord_webhook import DiscordWebhook, DiscordEmbed

webhook = DiscordWebhook(url='your webhook url', username="New Webhook Username")

embed = DiscordEmbed(title='Embed Title', description='Your Embed Description', color='03b2f8')
embed.set_author(name='Author Name', url='https://github.com/lovvskillz', icon_url='https://avatars0.githubusercontent.com/u/14542790')
embed.set_footer(text='Embed Footer Text')
embed.set_timestamp()
embed.add_embed_field(name='Field 1', value='Lorem ipsum')
embed.add_embed_field(name='Field 2', value='dolor sit')
embed.add_embed_field(name='Field 3', value='amet consetetur')
embed.add_embed_field(name='Field 4', value='sadipscing elitr')

webhook.add_embed(embed)
response = webhook.execute()

GitHub

GitHub is where over 73 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

#

@pine crypt this is the layout you should use

slate swan
final iron
#

What are you talking about

slate swan
#

@final iron it’s all embed webhook related stuff setup

slate swan
final iron
pine crypt
slate swan
pine crypt
#

I am a beginner

slate swan
#

I just gave example

final iron
#

He's not even using webhooks

slate swan
pine crypt
#

What are webhoooks?????

final iron
#

What are you talking about

#

They're not using webhooks

#

lmao

slate swan
#

I feel so stupid rn

#

I’ve been explaining webhooks for nothin

#

💀

pine crypt
final iron
#

You didn't even explain them well

#

You're using a 3rd party lib for no reason

pine crypt
#

I did pip install discord-webhook

#

Doesn't work

final iron
pine crypt
#

Can I have an answer that fits along the lines of my original code

final iron
#

They had no idea what they were talking about

pine crypt
final iron
pine crypt
final iron
#

Thats not the full traceback

#

Also, variables should be in snake_case

pine crypt
slate swan
final iron
#

Even if it was a webhook it made no sense

slate swan
#

Sorry it’s just the way I do it

slate swan
pine crypt
#

Yes, and how to fix what it says

slate swan
#

it tried to do a request with missing fields and returned a 400 http code

slate swan
# pine crypt

theres only 3 fields iirc and why are you making a field for each command

#

thats why its reponse status is a 400

haughty quartz
#

any idea how I can remove the send message permission for a channel for a certain user?

slate swan
#

@haughty quartz make mute role

haughty quartz
slate swan
haughty quartz
#

not for the whole server

pine crypt
slate swan
#

With mute command

#

Roles

slate swan
slate swan
haughty quartz
#

like is it possible?

slate swan
pine crypt
slate swan
haughty quartz
#

do u know what method it is

slate swan
slate swan
haughty quartz
#

yeah okay I'm gonna do some research ig

slate swan
pine crypt
slate swan
#

dpy docs are easy

royal jasper
#

how can i do a if isinstance(error, MissingPermissions): as if the bot responds to this: ERROR I do not have the permission {permission} to execute this command?

slate swan
haughty quartz
#

thanks u two

slate swan
slate swan
#

error is that exception and missing perms is the type

#

How do I loop a command

#

And then stop loop on command

#

I’m not good w loops

pine crypt
slate swan
slate swan
#

Embed limits
Embed descriptions are limited to 4096 characters. There can be up to 25 fields. A field's name is limited to 256 characters and its value to 1024 characters.

dang google is helpful

pine crypt
#

This uses buttons?

slate swan
#

ok?

#

its 2 different embeds?

#

so a paginator?

pine crypt
#

how does all this workkkkkkk?

slate swan
#

btw each field should have a value so thats why the error is raising

royal jasper
#

there is any way to?

slate swan
royal jasper
slate swan
#

im not sure what youre refering to

royal jasper
#

i just want to show You are missing Ban Members permission(s)

#

this ban members

#

which, in this case, is the name of the missing permission

slate swan
#

!d discord.ext.commands.MissingPermissions

unkempt canyonBOT
#

exception discord.ext.commands.MissingPermissions(missing_permissions, *args)```
Exception raised when the command invoker lacks permissions to run a command.

This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
pliant gulch
unkempt canyonBOT
#
No way, José.

No documentation found for the requested symbol.

slate swan
pliant gulch
#

huh

pine crypt
slate swan
slate swan
slate swan
#

every 30 secs or so

slate swan
pine crypt
#

I don't use python3.6

royal jasper
slate swan
unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
slate swan
unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slate swan
slate swan
royal jasper
#

without the 'You are missing'

slate swan
royal jasper
pine crypt
slate swan
royal jasper
# slate swan then?

i dont know explain very well, but, if i type

await ctx.reply(f'**ERROR** | You need to have the permission of {error}', mention_author=False)

the bot returns ERROR | You need to have the permission of You are missing Ban Members permission(s) to run this command.
and i want to show only ERROR | You need to have the permission of Ban Members to run this command.

slate swan
#

well error returns that

#

just check what andy sent

slate swan
royal jasper
#

thats not what i wanted, but thanks anyway for the help

hoary cargo
slate swan
#

im not sure if you can maybe check all the attrs and stuff

slate swan
hoary cargo
#

That's what I'm talking about

#

Why add you miss... when the error already says this

#

Let it be just that

slate swan
pine crypt
#

How would I make it so 4 commands are displayed per page?

#

And if there are no pages, add a page to continue

slate swan
#

@slate swan yes I have made the most dumbest way of doing it

@tasks.loop(seconds = 10) # repeat after every 10 seconds
async def myLoop():
async def checker(ctx):
        r = requests.get(f'https://tiktok.com/@{users}')
        if r.status_code == 200:
            print(Fore.WHITE+"🚫"+Fore.RED + "Taken"+ Fore.RED+ f' {users}')
        else:
            print(Fore.WHITE + "✅" + Fore.YELLOW + "Available" + Fore.YELLOW + f' {users}')
            ctx.send(f'{users}')
@tasks.loop(seconds=5.0)    ```
#

God tier

pine crypt
#

How would I make it so four commands appear per page?
And if there are no pages, add a page to continue?

slate swan
pine crypt
#

Google have very general help, not specific to most of the things I want to do

slate swan
final iron
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
final iron
#

Since when do tasks take in ctx

slate swan
final iron
slate swan
#

@final iron my head is broken rn 😭 :

async def checker(ctx):
        r = requests.get(f'https://tiktok.com/@{users}')
        if r.status_code == 200:
            print(Fore.WHITE+"🚫"+Fore.RED + "Taken"+ Fore.RED+ f' {users}')
        else:
            print(Fore.WHITE + "✅" + Fore.YELLOW + "Available" + Fore.YELLOW + f' {users}')
            ctx.send(f'{users}')```
#

@tasks.loop(seconds=5.0, count=5)
async def slow_count():
print(slow_count.current_loop)

#

This is like the only part of loop that I understand

final iron
#

Have you tried learning python?

summer thunder
#

you could just do ERROR | {error}

slate swan
final iron
#

Then go back

#

You obviously don't have enough knowledge

slate swan
slim ibex
steep wind
slim ibex
#

how do you instantiate your bot

royal jasper
#

but thank you anyway

steep wind
#

Traceback (most recent call last): File "main.py", line 106, in <module> @Bot.command(aliases=["mirai"]) AttributeError: type object 'Bot' has no attribute 'command'

slim ibex
steep wind
#

what does that mean

hushed galleon
# steep wind halp

error looks like you both used a class different from commands.Bot and forgot to call the class

slim ibex
#

like bot = commands.Bot(…)

#

importing Bot and using that isn’t work

#

wont*

slate swan
#

@steep wind bot = commands.Bot(command_prefix= "!")

steep wind
#
  global bot
  bot = commands.Bot(command_prefix=".", self_bot=True)```
slim ibex
#

uhh

#

what

hushed galleon
#

huh?

slate swan
#

@steep wind add this: bot = commands.Bot(command_prefix= "!")

#

At top

slim ibex
#

If you have a bot class it should subclass commands.Bot

slate swan
#

That should work

slim ibex
#

and then you define a custom constructor and methods

slate swan
#

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

slim ibex
#

it doesn’t inherit object

slate swan
#

Personally I use this

slate swan
steep wind
#

yes

slim ibex
slate swan
#

Use that

steep wind
#

im trying

slate swan
steep wind
#

same error

slate swan
slim ibex
#

if you want to have a bot class, it should inherit commands.Bot

pine crypt
#

How would I use my page and pages variable to make 4 commands per page?

slim ibex
#

And you define the constructor with __init__

#

you don’t use global variables or inherit from object

slate swan
steep wind
slim ibex
slim ibex
final iron
#

You take it from here. I don't know much about subclassing

#

🗿

pine crypt
#

How would I make 4 commands per page???

hushed galleon
pine crypt
steep wind
#

does anyone know how to fix or na

slim ibex
#

If you want to subclass it would be like this

class Bot(commands.Bot):
    def __init__(self):
        super().__init__(…)

    # other methods

If you aren’t subclassing you just do
bot = commands.Bot(…) in global scope

summer thunder
#

i belive you have eyes

steep wind
#

na

bold surge
#

lowercase B smh

hushed galleon
slim ibex
#

Glowstik 👀

bold surge
#

||nothing to see here||

slim ibex
#

it’s aliases

bold surge
#

ah then i just forgor

steep wind
#

💀

slim ibex
#

!d discord.ext.commands.Command

unkempt canyonBOT
#

class discord.ext.commands.Command(*args, **kwargs)```
A class that implements the protocol for a bot text command.

These are not created manually, instead they are created via the decorator or functional interface.
hushed galleon
slate swan
slim ibex
hushed galleon
#

plenty of ways to do that but they all pretty much involve common python stuff

#

e.g. using slicing py groups = [] group_size = 4 for i in range(0, len(client.commands), group_size): groups.append(client.commands[i:i+group_size])

hushed galleon
#

oh, forgot it returned a set

#

why did you add the code inside your other for-loop though?

pine crypt
#

is it meant to be outside?

hushed galleon
#

that outer for loop kinda isn't needed

pine crypt
#

It still returns the same set error

#

Is there a way to fix that?

hushed galleon
#

convert it into a list()

pine crypt
#

what do i convert?

hushed galleon
#

the client commands...

#

could also be a nice opportunity to sort the list afterwards

#

otherwise your commands will be in some arbitrary order

pine crypt
#
for i in range(0, len(list(self.client.commands)), group_size):
            groups.append(self.client.commands[i: i+group_size])
hushed galleon
#

not just there, you'll need it in the bottom line too

#

use another variable for it

#

i.e. commands = list(self.client.commands)

#

well