#discord-bots

1 messages · Page 910 of 1

lusty sky
#

I just tried it with test account and it let an account with no perms do it

supple thorn
#

!d discord.ext.commands.has_permissions

unkempt canyonBOT
#

@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.

Note that this check operates on the current channel permissions, not the guild wide permissions.

The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").

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

Oh yeah sorry

lusty sky
#

Where would I add that?

supple thorn
#

below @bot.commands()

lusty sky
#

I am using client.command()

#

would it work the same yeah?

supple thorn
#

so ```py
@bot.commands()
@commands.has_permissions()

supple thorn
lusty sky
#

Why does everyone prefer bot.commands

#

I heard its faster?

supple thorn
#

because it's a bot

lusty sky
#

XD

supple thorn
#

you name it client if you're using discord.Client

#

it's like ```py
string = 1

sick birch
lusty sky
#

am I limiting myself by writing everything in client.command then?

supple thorn
#

no

supple thorn
lusty sky
#

still workeds :p

supple thorn
lusty sky
#

I mean I thought that checks permissions?

slate swan
#

No, that's just a naming convention

supple thorn
#

your naming convention is just confusing

supple thorn
supple thorn
#

i thought it working was good

lusty sky
#

haha no still can use commands the user has no permissions for

supple thorn
#

or did you just

#

plop it in your code

supple thorn
slate swan
#

you need to pass permissions inside the has_permissions decorator

lusty sky
#

yeah my bad I didnt

supple thorn
#

im guessing it's nick perms

final iron
#

Nice token leak

#

🗿

supple thorn
#

why a duck

#

i am a monsterous duck

#

if you enlarge my avatar you can see a 7" tall man in the image

#

that's his size compared to mine

slate swan
#

duck chat

supple thorn
#

magic

slate swan
#

ssl certificate verification failed

#

import discord

client = discord.Client()

@client.event
async def on_ready():
print(f'We have logged in as {client.user}')

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('$hello'):
    await message.channel.send('Hello!')

client.run('mytoken')

final iron
slate swan
final iron
slate swan
#

i dont even have that folder

final iron
#

Are you on mac?

queen linden
#

help?

@bot.command()
async def attach(ctx, url):
    if str(ctx.channel.type) == "private":
      guild = bot.get_guild(944561115302617118)
      channels = await guild.fetch_channels()
      channel = discord.utils.get(channels, name = "general")
  
      em = discord.Embed()
      em.set_image(url=url)
      em.color = 0x2f3136
  
      await channel.send(embed=em)

theres no error but it wont send in the channel

slate swan
final iron
#

You have the folder then

slate swan
final iron
queen linden
slate swan
alpine furnace
final iron
#

!d discord.ChannelType

unkempt canyonBOT
slate swan
#

;-;

alpine furnace
#

That, yeah

#

It's not "private", it's ChannelType.private

final iron
#

Don't think it supports str()

slate swan
#

do u know where i find the folder

slate swan
alpine furnace
slate swan
#

bruhhhhhhhh

queen linden
alpine furnace
#

It's a problem with anything that interacts with a secured api, meaning youtube-dl or even scraping

dusk karma
#

Tried heroku again, and its giving me errors for lines that literally dont exist.

umbral agate
#

Hello...!

slate swan
alpine furnace
#

Yes

hardy wing
#

is it possible to get a web server and host the code on replit or do you have to use github

slate swan
#

it works gg

slate swan
#
Traceback (most recent call last):
File "main.py", line 1, in <module>
from core.Floater import Floater
File "/workspace/core/Floater.py", line 76, in <module>
bot.loop.run_until_complete(Floater.create_db_pool())
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.8/site-packages/discord/client.py", line 111, in __getattr__
raise AttributeError(msg)
AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook
sys:1: RuntimeWarning: coroutine 'Floater.create_db_pool' was never awaited 
slate swan
tacit storm
#

ERROR

slate swan
#
@bot.event
async def on_reaction_add(reaction, user):
  channel = reaction.message.channel
  await channel.send(channel, '{} Answered {} to {}, format'(user.name, reaction.emoji, reaction.message.content))

@bot.event
async def on_reaction_remove(reaction, user):
  channel = reaction.message.channel
  await channel.send(channel, '{} removed answer {} from {}'.format(user.name, reaction.emoji, reaction.message.content )) 
tacit storm
slate swan
#

Bot have no attribute send?

#

format ;-;

slate swan
sick birch
slate swan
#

Line?

slate swan
tacit storm
# slate swan Where?

Please read the error really cloesly, it does tell you where to put it.

await Floater.create_db_pool or whatever it's called

daring olive
unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @tacit storm until <t:1647577341:f> (23 hours and 59 minutes).

quick gust
sick birch
#

File "/workspace/core/Floater.py", line 76, in <module>

RuntimeWarning: coroutine 'Floater.create_db_pool' was never awaited

2 important bits

slate swan
#

She ignored me 😂

sick birch
#

Let's stay on topic please, that has nothing to do with the problem at hand

slate swan
#

Someone send code for a bot cmnd

sick birch
slate swan
#

I meant a ban cmnd

#

I’m 🍃 rn

#

sorry lol

sick birch
#

Sure, what've you got so far?

maiden fable
#

No Response lemon_pensive

hardy wing
#

Like do I have to import the code to the vps or do I just code the vps into replit

slate swan
sick birch
#

Yes, use something like vscode (native git integration for deploying to VPS) or pycharm

slate swan
#

yeah, but, pycharm is a heavier IDE than VSC, since VSC is just a text editor and pycharm is a native python editor

#

💀

#

VS is an IDE.

sick birch
#

VS

slate swan
slate swan
#

I wish VS was available for Linux too ( without wine/other external supports)

cosmic agate
#

Hey guys, Im making a timer command and i wanted it to have a reaction and if a user reacts on it, and when the timer ends, it will tell the users that the timer has ended

cosmic agate
#

it worked but now its showing that

#
    users =await susi.reactions.users.flatten()
AttributeError: 'list' object has no attribute 'users'
unkempt canyonBOT
#

async for ... in users(*, limit=None, after=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") 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.

Changed in version 2.0: `limit` and `after` parameters are now keyword-only.

Examples

Usage...
slate swan
#

you need to iterate through the list

slate swan
#
mentions = [reaction.user.mention for reaction in susi.reactions]
await ctx.send(f"{', '.join(mentions)} | The Timer has ended")

this should work ig
correct me

maiden fable
#

reaction.user.mention?

slate swan
maiden fable
#

Also

#

Isn't the list already a list of members?

slate swan
#

its a list of Reaction objects

#

of the Message object

maiden fable
#

Nvm

cosmic agate
#

hmm

#

so guys i got this

#

is this something i should worry about

#

?

maiden fable
#

U gotta put in yr CC

cosmic agate
#

?

maiden fable
#

Credit Card

cosmic agate
#

XD

#

me poor as heck

#

i only have around 5 dollars

cosmic agate
maiden fable
#

soooo

cosmic agate
boreal ravine
maiden fable
#

We are just doing paid work for free

boreal ravine
#

I don't care if it's wrong, spoonfeeding code is still bad

maiden fable
#

Indeed

cosmic agate
#

hmm

#

bruh

cosmic agate
#

sometimes i also spoonfeed

slate swan
cosmic agate
#

so what should i do?

heavy folio
#

flatten isnt a thing anymore in dpy 2

cloud dawn
#

Users is a method

maiden fable
#

Oh hmm

worldly bane
#

is it possible to use a proxy in dpy? lemon_thinking

maiden fable
#

That explains the error

heavy folio
maiden fable
#

Ouh

slate swan
#

Hm

cloud dawn
#
users_mention = [member.mention for reaction in reactions async for user in reaction.users() if isinstance(user, discord.Member)]
maiden fable
#

Nothing happened

cloud dawn
#

Since reactions doesn't have .users() since reactions is a list of reactions we first have to for loop that. Then re iterate for the reaction.users()

#

Also if the user has left the guild the reaction will return a user object so hence the check.

worldly bane
#

what would happen if I define commands.bot twice like the first one has > as its prefix but after a certain amount of time it becomes !?

cloud dawn
#

Why define it twice?

#

bot.command_prefix = "!"

cosmic agate
heavy folio
#

ofc that will

cosmic agate
#

hmm

worldly bane
cloud dawn
#

Welcome to python

cosmic agate
#

XD

cloud dawn
#

But if you are going to change a lot i do recommend making a properly structured class for it to save time.

cosmic agate
#

ummmm

slate swan
#

i want to write code to welcome new members thrug my bot but cant finfd the channeel id

cosmic agate
slate swan
cosmic agate
cosmic agate
#

should i remove

            users = [user async for user in reaction.users()]
cloud dawn
cosmic agate
#

yessir

cloud dawn
#

Show the whole command

slate swan
cold oyster
#

How do I get my bot to identify if the user is a bot

cosmic agate
#

customize the embed

cold oyster
#

Bruh ded chat

cosmic agate
cold oyster
cold oyster
#

!d discord.User.bot

unkempt canyonBOT
cosmic agate
#

oYHHHHHHHHHHHHHHHHHHH

cold oyster
#

SIUUUUUUUUUUUUUU

cosmic agate
#

XDDD

cold oyster
#

I give up (not really)

cosmic agate
#

XD

#

ikr

cold oyster
cosmic agate
#

yea

cold oyster
rocky trench
#

I even took it this far that I fixed a library myself

rocky trench
cold oyster
cosmic agate
#

lol

rocky trench
cold oyster
rocky trench
cold oyster
rocky trench
cosmic agate
#

yes i did

#

but error

rocky trench
#

What error

#

IM in the train, bad connection. Brb

cosmic agate
#

NameError: name 'reactions' is not defined

#

im noob though XD

cold oyster
#

Doesnt work

rocky trench
#

!d discord.Message.reactions

unkempt canyonBOT
cosmic agate
# rocky trench Send code
  embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{numberint}",
              colour=nextcord.Colour.random())
            embed.set_footer(text=":good stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
            susi = await ctx.reply(embed = embed)
            await susi.add_reaction("⏰")

            users_mention = [member.mention for reaction in reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))

            while number != 0:
                number -= 1
                embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{number}",
              colour=nextcord.Colour.random())
                embed.set_footer(text=":cool stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
                await susi.edit(embed=embed)
            
                hmmm = users
                await asyncio.sleep(1)
            await susi.edit(content='Ended!')
            await ctx.send(f"{ctx.author.mention}and {hmmm}! The Timer has ended!")
rocky trench
#

What line is ur error on

cosmic agate
#

????

#

umm

rocky trench
#

I see the mistake

#

U did for reaction in reactions

cosmic agate
#

the longest line

rocky trench
#

Reactions isn't defined, it should be message.reactions

#

So

cosmic agate
#

oh ok where though

rocky trench
#

susi.reactions

cosmic agate
#

??

rocky trench
#
  embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{numberint}",
              colour=nextcord.Colour.random())
            embed.set_footer(text=":good stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
            susi = await ctx.reply(embed = embed)
            await susi.add_reaction("⏰")

            users_mention = [member.mention for reaction in susi.reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))

            while number != 0:
                number -= 1
                embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{number}",
              colour=nextcord.Colour.random())
                embed.set_footer(text=":cool stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
                await susi.edit(embed=embed)
            
                hmmm = users
                await asyncio.sleep(1)
            await susi.edit(content='Ended!')
            await ctx.send(f"{ctx.author.mention}and {hmmm}! The Timer has ended!")
cosmic agate
#

hmm

gaunt ice
#

what's the problem here now

rocky trench
#

I'm on phone. Hard to inspect the code

rocky trench
cosmic agate
#

NameError: name 'users' is not defined

rocky trench
#

What is reaction.users?

cosmic agate
#

👋🏼

#

sed

rocky trench
#

!d discord.Reaction.users

gaunt ice
#

Susi.reactions.flatten

unkempt canyonBOT
#

async for ... in users(*, limit=None, after=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") 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.

Changed in version 2.0: `limit` and `after` parameters are now keyword-only.

Examples

Usage...
cosmic agate
#

ayo what

rocky trench
cosmic agate
#

yea

cosmic agate
#

i used it for giveaway command

gaunt ice
#

I'm bad at path

rocky trench
#

It works for some, but dpy 2.0 changed

cosmic agate
#

XD im on nextcord

rocky trench
#

Ah

gaunt ice
#

hm

cosmic agate
#

so now what

#

@rocky trench should i remove this

users.pop(users.index(bot.user))
rocky trench
#

What program do you use for coding

cosmic agate
#

you mean IDE?

rocky trench
#

Yeah

cosmic agate
#

vscode

rocky trench
#

Don't you see the orange lines?

#

When something isn't defined

cosmic agate
#

no

gaunt ice
#

hm

cosmic agate
#

are you talking about the vertical lines?

gaunt ice
#

lmao

#

not vertical

#

horizontal

cosmic agate
#

this?

gaunt ice
#

it shows when a word isn't defined

gaunt ice
cosmic agate
#

XD

gaunt ice
#

like this but in that

#

and orange colr

cosmic agate
#

i only see them in the sides

cold oyster
#

I cannot download nueralintents ahh

#

It says read timed out, My net-

cosmic agate
#

sed

cosmic agate
cold oyster
#

Im sure there is a way to download it as file

cold oyster
#

Ngl looks nice

gaunt ice
#

hm

cosmic agate
cold oyster
#

Sheeeeeeeeeeeeeeeeeeeeeeeeeeeee-

gaunt ice
#

so blue....

cosmic agate
#

hmm

cold oyster
cosmic agate
cold oyster
#

Nvm blue

gaunt ice
#

no it's blue

gaunt ice
cosmic agate
#

you have somok

#

ok

gaunt ice
#

what cmd is this first of all

cosmic agate
#

powershell?

gaunt ice
#

what command is this

#

not the powershell

#

like the name of the command

#

async def what

cold oyster
#

This hurts my brain

#

But is good

#

Better

formal basin
#

This command isn’t working

cold oyster
cold oyster
formal basin
cold oyster
#

I found the mistake nvm

formal basin
#

No errors

cold oyster
#

It's ctx.author.name

formal basin
#

Ok

gaunt ice
#

it's description problem

#

u didn't include description

formal basin
cold oyster
cold oyster
#

Description is not compulsry mate

gaunt ice
#

it is required

cold oyster
gaunt ice
#

ok

cold oyster
#

Not gonna fight but Leme try again

#

Nvm I can't

gaunt ice
#

lmfao replit user

formal basin
#

Still not working

gaunt ice
#

i told u

cosmic agate
cold oyster
sullen shoal
gaunt ice
formal basin
cold oyster
cold oyster
sullen shoal
cold oyster
formal basin
#

It works thanks

sullen shoal
#

also as the command is mainly to be used to view avatar, instead of setting it as thumbnail, set it as the image of the embed

cold oyster
cosmic agate
sullen shoal
#

!d discord.Embed.set_image

unkempt canyonBOT
#

set_image(*, url)```
Sets the image for the embed content.

This function returns the class instance to allow for fluent-style chaining.
gaunt ice
cold oyster
cosmic agate
#

i used it without several times

cold oyster
#

Like the error thing

unkempt canyonBOT
#

class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, 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.

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.

Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
gaunt ice
#

yerliiii

#

how u doing

gaunt ice
#

same

cold oyster
#

!rule 7

unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

sullen shoal
cold oyster
gaunt ice
#

ok yes my problem

#

sry

formal basin
cold oyster
cold oyster
formal basin
sullen shoal
gaunt ice
#

use docs

cosmic agate
formal basin
sullen shoal
cold oyster
# formal basin

Use this code instead

@client.event
async def on_command_error(ctx, error):
  if isinstance(error, commands.CommandOnCooldown):
    await ctx.reply("Slow down")
  else:
    raise error```
sullen shoal
formal basin
sullen shoal
cold oyster
slate swan
#

you get no errors except for the cooldown one

cold oyster
formal basin
#

Ok..

#

@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.reply("Slow down")
else:
raise error

sullen shoal
#

you may just add the last two lines of that code snippet to your existing code as well

cold oyster
#

mhm

formal basin
#

I have an error

#

With the f string

cold oyster
formal basin
formal basin
cold oyster
#

Hmm

sullen shoal
cold oyster
formal basin
#

I don’t?

unique lichen
#

can i edit 50 channels at once without await ?

cold oyster
#

Youtube tutorials-

cold oyster
formal basin
cold oyster
cold oyster
formal basin
#

Oh I didn’t know

sullen shoal
cold oyster
cold oyster
#

I dont rly use f while making the cooldown command

cold oyster
sullen shoal
cold oyster
#

Sorry---

cold oyster
formal basin
cosmic agate
sullen shoal
formal basin
#

Should I put ctx?

sullen shoal
formal basin
sullen shoal
formal basin
sullen shoal
sullen shoal
#

!d discord.ext.commands.CommandOnCooldown.retry_after

unkempt canyonBOT
sullen shoal
#

also its already in seconds then why even bother formatting it to two decimal point?

formal basin
formal basin
gaunt ice
#

hrs of cooldown

formal basin
formal basin
sullen shoal
sullen shoal
formal basin
formal basin
#

Uhh i know

#

But it’s not a good way to show time

sullen shoal
formal basin
sullen shoal
cosmic agate
#

@sullen shoal can you help
NameError: name 'users' is not defined

sullen shoal
slate swan
#

!e py from datetime import timedelta print(timedelta(seconds=600))

unkempt canyonBOT
#

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

0:10:00
slate swan
#

use timedelta, and you can acess seconds, minutes

reef trail
slate swan
reef trail
sullen shoal
#

the part where you called asyncio.run there

cosmic agate
sullen shoal
sullen shoal
cosmic agate
reef trail
sullen shoal
cosmic agate
# sullen shoal show entire traceback

Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 1052, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'users' is not defined

slate swan
reef trail
sullen shoal
cosmic agate
#

@sullen shoal code

            embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{numberint}",
              colour=nextcord.Colour.random())
            embed.set_footer(text=":good stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
            susi = await ctx.reply(embed = embed)
            await susi.add_reaction("⏰")

            users_mention = [member.mention for reaction in susi.reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))

            while number != 0:
                number -= 1
                embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{number}",
              colour=nextcord.Colour.random())
                embed.set_footer(text=":cool stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
                await susi.edit(embed=embed)
            
                hmmm = users
                await asyncio.sleep(1)
            await susi.edit(content='Ended!')
            await ctx.send(f"{ctx.author.mention}and {hmmm}! The Timer has ended!")
cosmic agate
# sullen shoal it should be longer than that

Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 168, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\Admin\Downloads\Palisade\main.py", line 879, in count
users.pop(users.index(bot.user))
NameError: name 'users' is not defined

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

Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 1052, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'users' is not defined

cosmic agate
vale wing
#

The problem is clearly visible

sullen shoal
cosmic agate
#

hmm

reef trail
cosmic agate
cosmic agate
# sullen shoal ?

my timer code

@bot.command()
async def count(ctx, number:int):
    try:
        numberint = int(number)
        if numberint < 0:
           await ctx.reply(embed=nextcord.Embed(title="Timer", description="number can't be a negative",colour=nextcord.Colour.random()))
           return
        if numberint > 300:
           await ctx.reply(embed=nextcord.Embed(title="Timer", description="number must be under 300", colour=nextcord.Colour.random()))
        else:
            embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{numberint}",
              colour=nextcord.Colour.random())
            embed.set_footer(text=":good stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
            susi = await ctx.reply(embed = embed)
            await susi.add_reaction("⏰")

            users = [member.mention for reaction in susi.reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))

            while number != 0:
                number -= 1
                embed=nextcord.Embed(
              title="Timer 2.0",
              description=f"{number}",
              colour=nextcord.Colour.random())
                embed.set_footer(text=":cool stuff smh", icon_url="https://cdn.discordapp.com/avatars/839171088079519776/12cdb639fe5c26dccf39bf2e5678b8fc.webp?size=1024")
                await susi.edit(embed=embed)
            
                hmmm = users
                await asyncio.sleep(1)
            await susi.edit(content='Ended!')
            await ctx.send(f"{ctx.author.mention}and {hmmm}! The Timer has ended!")
            

    except ValueError:
        await ctx.send('time was not a number')
sullen shoal
#

member.mention is str while bot.user is discord.User

cosmic agate
#

?

#

hmm

#

so now what

sullen shoal
#

remove the mention method

cosmic agate
#
 users = [member.mention for reaction in susi.reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))
sullen shoal
cosmic agate
#

this?

sullen shoal
sullen shoal
#

well bot.user is discord.User

reef trail
#
Extension 'Cogs.admin' raised an error: AttributeError: type object 'Embed' has no attribute 'Empty'```im now getting this error, theres no embeds in `admin` that are empty or empty strings
sullen shoal
#

but your list is discord.Member

unkempt canyonBOT
#

property me```
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.
sullen shoal
cosmic agate
#

so

 users = [guild.me for reaction in susi.reactions async for user in reaction.users() if isinstance(user, discord.Member)]
            users.pop(users.index(bot.user))
#

??

#

ok

sullen shoal
# reef trail thats it

are you catching the errors and printing them yourself that are being raised from cogs?

cosmic agate
#

@sullen shoal ill tell the whole story

sullen shoal
cosmic agate
#

Hey guys, Im making a timer command and i wanted it to have a reaction and if a user reacts on it, and when the timer ends, it will tell the users that the timer has ended

reef trail
sullen shoal
reef trail
#

Alright

cosmic agate
#

i normally tried via flatten

#

but didnt work

sullen shoal
cosmic agate
#

oh ok

#

yeah sure

sullen shoal
reef trail
# sullen shoal are you loading the cogs yourself or its being done by some algorithm
import os
from utils import permissions

from discord.ext.commands import AutoShardedBot

class Bot(AutoShardedBot):

    def __init__(self, *args, prefix=None, **kwargs):
        super().__init__(*args, **kwargs)
        self.prefix = prefix

    async def setup_hook(self):
        for file in os.listdir("Cogs"):
            if file.endswith(".py"):
                name = file[:-3]
                await self.load_extension(f"Cogs.{name}")

    async def on_message(self, msg):
        if not self.is_ready() or msg.author.bot or not permissions.can_handle(
                msg, "send_messages"):
            return

        await self.process_commands(msg)```
sullen shoal
cosmic agate
#

hmm thats a reminder but itll work ig

sullen shoal
#

you may use continue for that

reef trail
#

Why would info be raising any errors?

#

let me send the whole file

#

actually i think i found something that might cause issues

#

lemme see if that fixes anything

#

same thing

cosmic agate
sullen shoal
reef trail
#

its the same thing

sullen shoal
cosmic agate
#

hmm i see

sullen shoal
#

you will get better ideas of implementing your timer command

cosmic agate
#

hmm i dont like cogs

#

its pretty hard for me

#

but really cool tbh

#

takes less space

#

each code has their own space

reef trail
sullen shoal
reef trail
#

yeah d.py decided to change how everything worked

#

what needs to be changed

reef trail
#

ive read the gist

#

Oh wait

cosmic agate
#

@sullen shoal should i remove the cogs as i dont need them

reef trail
#

the thing that immediately sticks out to me is asyncio.get_event_loop(), but even though that needs to be changed in other files, info.py doesnt have anything like that

cosmic agate
#

or is it part of code

sullen shoal
# cosmic agate its pretty hard for me

if you find it hard, you probably are lacking some python skills, using OOP and use of decorators. Make personal projects with those skills and dont just try not to use cogs because you find it hard. thats not what a programmer should do

cosmic agate
#

ik

#

i get it

sullen shoal
#

i was in the same stage, I stopped making bots and made several other projects except discord bots

#

i tried to understand the concept and experiment with it

#

this whole process took me around just 1/2 months

cosmic agate
#

hmm

#

ik

sullen shoal
#

is your end goal being a discord bot developer or a software developer?

cosmic agate
#

i just want to learn easily without my mind going crazy

reef trail
#

Alright i guess im just not going to be using the new version of dpy because this makes absolutely no sense lmfao

cosmic agate
#

but

cosmic agate
sullen shoal
sullen shoal
reef trail
#

I dont understand why danny had to change how basic functions that were fine before worked

placid skiff
#

disnake is better than anything lel

cosmic agate
reef trail
#

Ill just fork dpy and fix it myself

cosmic agate
#

and i know there is a long way for achieving that

cosmic agate
reef trail
#

this is ridiculous

sullen shoal
cosmic agate
slate swan
#

20 march?

sullen shoal
cosmic agate
#

XD

slate swan
#

if you want to learn the languages you mentioned above you should have started with java, just a suggestion.

sullen shoal
slate swan
#

cause the others aint too hard, html has a completely different base

sullen shoal
#

it doesn't really matter, all the mentioned programming languages there are object oriented programming languages

#

so it doesn't make a large difference

#

if you search, string methods x programming language, where x is any of those mentioned programming languages, you will end up with similar results

cosmic agate
#

hmm

sullen shoal
#

just be good at one then later on, when needed, you learn the others

sullen shoal
# cosmic agate hmm

currently you lack the understanding of the base concepts, you should try to learn them, look around yourself, try to seek for some resource that explains the use of OOP and it's benefits compared functional programming

placid skiff
#

We can say that a developer that knows all languages is a developer who knows how the three type of languages works: Those three types are procedural language, OOP language and interpreted language. Other than this three you should learn how those three type of language works: Machine language, low level language and high level language. A good thing to know when you start studying programming is how algorithms works. Once you learned how algorithms works, how to read an algorithm and create one you are good to go

#

Essentially with this base knowledge, when you switch to a language from another, the only thing that change is the syntax

sullen shoal
#

and then learn the uses of decorators

sullen shoal
# cosmic agate ok

do you now there is a sep parameter in print? do you know that we have abs function that returns the absolute number of a given number? if you dont, after all this is clear to you or at least the OOP part, don't forget to read the official documentation of Python

cosmic agate
#

im watching rn

sullen shoal
cosmic agate
#

i see

sullen shoal
cosmic agate
#

yea but my normal preference is speaking/ voice

sullen shoal
#

well you could try text articles along the line, you might enjoy the copy pasting of code snippets and jumping to certain topics without seeking some seconds forward or backward for minutes

cosmic agate
#

yeah thats a benefit

sullen shoal
#

as you read more, you will start to read faster than before and cover more topics faster

spring flax
#

How do you do bot.get_command on a subcommand?

#

Subcommand of a commands group

cloud dawn
#

us the group

#

!d disnake.ext.commands.Group.get_command

unkempt canyonBOT
#

get_command(name)```
Get a [`Command`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.Command "disnake.ext.commands.Command") from the internal list of commands.

This could also be used as a way to get aliases.

The name could be fully qualified (e.g. `'foo bar'`) will get the subcommand `bar` of the group command `foo`. If a subcommand is not found then `None` is returned just as usual.
keen talon
#

Apples

cloud dawn
#

He meant before he is 20 so 5 years from now

low latch
#

@queen linden the message was auto-deleted because it had an invite link in it

queen linden
#

pls help

@bot.event
async def on_member_update(before, after):
    channel = bot.get_channel(950810468778410075)

    if after.bot == True:
        return

    if before.activities == after.activities:
        return
    
    required_activity = "vanity url here"
    userHasActivity = False
    for activity in after.activities:
        if isinstance(activity, discord.CustomActivity):
            if str(activity).startswith(required_activity):
                userHasActivity = True
            if str(activity).endswith(required_activity):
                userHasActivity = True
    if userHasActivity:
        emb = discord.Embed()
        emb.description = f"""
thanks for the vanity i guess
      """
        emb.color = 0x2f3136
        emb.set_footer(text="to get this role, you must put vanity here in your status.")
        emb.set_image(url="image link")
        await channel.send(f"<@{after.id}>", embed=emb)
        await after.add_roles(discord.utils.get(after.guild.roles, id=951202119434792960))
    else:
        await after.remove_roles(discord.utils.get(after.guild.roles, id=951202119434792960))

it keeps spamming the embed idk why

#

so sorry for the inv link

#

it keeps sending the embed like a few seconds or minutes after it sends one with the same user

slate swan
#

How would I fix this https://pastebin.com/P1GXsYMc basically iv got custom prefixes in every guild and whenever my bot joins a guild it adds the guild id to prefixes.json however when I use the code that’s in the pastebin it fully breaks my code and it stops adding the guild ids to prefixes.json how would I fix it

placid skiff
#

by stop using json as a data storage method

vale wing
#

Yes

vale wing
queen linden
potent spear
#

also, just for "clean" purposes
using discord_utils is great for names and other attributes, but when you're getting an object by id, you can simply use get_x
so for your role, it's
guild.get_role(<your_id>)

queen linden
potent spear
queen linden
potent spear
#

also

for activity in after.activities:
        if isinstance(activity, discord.CustomActivity):
            if str(activity).startswith(required_activity):
                userHasActivity = True
            if str(activity).endswith(required_activity):
                userHasActivity = True```
you don't have to keep on looping through the activities once the userHasActivity is set to True, you can break once that's done
potent spear
#

what you actually "forgot" to do in your event is if the ACTUAL update was the vanity url in activities

#

now, since every user has member updates all the time, it'll just keep on saying True because he has that url

#

what you ACTUALLY want to check for is if he DIDN't have that vanity url in activities before, but now does

queen linden
queen linden
potent spear
slate swan
potent spear
slate swan
queen linden
#

i havent heard of that

slate swan
regal cove
#

hi i made this command trying to sort values in my sqlite database but it doesnt work. this is my code: py @client.command(name="lb") async def top10(ctx): db = client.database_connection cursor = await db.cursor() await cursor.execute(f"SELECT user_id, balance from money_data WHERE user_id = {ctx.guild.id} ORDER BY balance DESC LIMIT 3 ") result = await cursor.fetchall() embed = discord.Embed(title="Leaderboards", colour=discord.Colour(0x6790a7)) for i, x in enumerate(result, 1): embed.add_field(name=f"#{i}", value=f"<@{str(x[0])}> on Level {str(x[1])} with {str(x[2])} Total XP", inline=False) await ctx.send(embed=embed) print(result)

#

pls help me thank u

dense coral
#

Anyone know how I make the user with the most coins be the top?

supple thorn
dense coral
#
    with open("users.json", "r") as f:
      users = json.load(f)

    data = []
    index = 1

    for item in users:
        if index > 10:
            break
        
        member_name = f"<@{item}>"
        member_amt = users[item]["coins"]

        if index == 1:
            msg1 = f"**[🥇] {member_name} - `{member_amt}` Coins**"
            data.append(msg1)

        if index == 2:
            msg2 = f"**[🥈] {member_name} - `{member_amt}` Coins**"
            data.append(msg2)

        if index == 3:
            msg3 = f"**[🥉] {member_name} - `{member_amt}` Coins**\n"
            data.append(msg3)

        if index >= 4:
            members = f"**[{index}] {member_name} - `{member_amt}` Coins**"
            data.append(members)
        index += 1

    msg = "\n".join(data)

    em = discord.Embed(
        title=f"Top 10 Coins",
        description=f"{msg}",
        color=discord.Color(0x00ff00),
        timestamp=datetime.datetime.utcnow()
    )
    em.set_footer(text=f"{ctx.guild.name}")
    await ctx.send(embed=em)```
supple thorn
dense coral
placid skiff
#

you have a dict of user, sort them by coins and then send the message

placid skiff
#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
for i in sorted(my_dict.keys()):
  print(i, end="\n")
unkempt canyonBOT
#

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

001 | joe
002 | tim
003 | tom
placid skiff
#

uhm strange

dense coral
gaunt ice
#

whaa

placid skiff
#

no whait

#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
for i in sorted(my_dict.items()):
  print(i, end="\n")
unkempt canyonBOT
#

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

001 | ('joe', 300)
002 | ('tim', 400)
003 | ('tom', 231)
cold oyster
#

How do I get my bot to identify if a user is another bot

sage otter
#

!d discord.User.bot

unkempt canyonBOT
gaunt ice
#

so we have to check every member with this user.bot? for getting total membercount

sage otter
#

?

placid skiff
#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
sorted_dict = sorted(my_dict.items(), key=lambda kv:(kv[1], kv[0]))
print(sorted_dict)
gaunt ice
#

alr gtg

placid skiff
#

Camon

sage otter
#

You're trying really hard for this.

placid skiff
#

Hahaha yeah

cold oyster
#

@candid orbit I read the documentation but IDK what to do

placid skiff
#

why in the hell it doesn't reverse

sage otter
#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
print(sorted(my_dict.items(), key=lambda x: x[1]))
#

Enjoy

placid skiff
#

it needs to be reversed xD

cold oyster
sage otter
cold oyster
unkempt canyonBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

placid skiff
placid skiff
#

hahahaha

cold oyster
cold oyster
placid skiff
#

nope, Italian

cold oyster
cold oyster
#

@sage otter This is stupid... Give me code

placid skiff
#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
sorted_dict = sorted(my_dict.items(), key=lambda kv:(kv[1], kv[0]))
print(reversed(list(sorted_dict.items())))
cold oyster
#

for an hour

#

SOMEONE HELP

unkempt canyonBOT
#

@placid skiff :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | AttributeError: 'list' object has no attribute 'items'
placid skiff
#

in fact is the dict.items stupid interpreter

#

uhm but the sorted is a list

cold oyster
#

How to make my bot identify if a user is bot

placid skiff
#

then why slicing doesn't work lol

placid skiff
unkempt canyonBOT
placid skiff
#

!e

my_dict = {"tom": 231, "joe": 300, "tim": 400}
sorted_dict = sorted(my_dict.items(), key=lambda kv:(kv[1], kv[0]))
print(sorted_dict[::-1])
unkempt canyonBOT
#

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

[('tim', 400), ('joe', 300), ('tom', 231)]
placid skiff
#

Oh there it is

cold oyster
placid skiff
#

it returns True if the user you are checking is a bot else False

placid skiff
#

...

placid skiff
#
@bot.command()
async def am_i_bot(ctx: Context):
  print(ctx.author.bot)
placid skiff
#

.-.

slate swan
cold oyster
cold oyster
placid skiff
#

bruh it's a print

cold oyster
cold oyster
# placid skiff bruh it's a print
@client.command()
@commands.has_permissions(manage_messages=True)
async def warn(ctx, member: discord.Member, *, reason=None):
    if member == member.bot:
        await ctx.reply("You cannot warn a bot")
    else:
        print(f"Warn requested by {ctx.author}.")
        await member.send(f"You have been warned in {ctx.guild.name} for {reason}")
        await ctx.reply(f"{member} has been warned..")
        print("Command successfully executed.")```
slate swan
#

yeah but atleast just set it to NoneAG_Angry

placid skiff
cold oyster
#

ok

slate swan
#

or return a message objsussybara

cold oyster
slate swan
#

ik but no harm in typehinting it yk

placid skiff
gaunt ice
cold oyster
#

Ty...

#

Hmm

#

Ok, Thank you

gaunt ice
#

why gifs..

cold oyster
slate swan
#

yerlikayas way is better hes not comparing bools but hes saying if True or if not True

gaunt ice
#

yooo

#

ur right

slate swan
#

lol

gaunt ice
#

i have to learn python

#

i hate exams....

slate swan
#

samerooFight

gaunt ice
#

i wanna just go full time coding and live in us

slate swan
#

i did full time coding in summer now i dont do it much

gaunt ice
#

how does dank memer support custom cmds for servers

#

like we can disable steal

#

ik its made in javascript but still

maiden fable
gaunt ice
maiden fable
#

!d discord.ext.commands.Command.enabled

unkempt canyonBOT
gaunt ice
#

hm

slate swan
maiden fable
unkempt canyonBOT
slate swan
maiden fable
#

(Let's take this to an OT if u wanna continue)

gaunt ice
#

i would like to debate in this topic

maiden fable
slate swan
#

no i gtg to school AG_Angry

maiden fable
slate swan
#

okrooFight

sage otter
inner epoch
#

Umm I just learned abt embeding so like how can I get that rounded black box in which text is there inside embed?

sage otter
#

That’s just so much work for little to no reason

#

It’s not like you're gonna be calling the coroutine anywhere else

slate swan
inner epoch
#

Something like this

slate swan
vocal plover
maiden fable
vocal plover
#

Also pylance gets mad when I dont

inner epoch
maiden fable
gaunt ice
#

yes try

inner epoch
gaunt ice
#

T-T

honest vessel
#

how to position set_image() to top of embed?

sage otter
gaunt ice
#

like without a title ?

honest vessel
#

[image here]
title text here
fields here

slate swan
sage otter
placid skiff
sage otter
#

That’s a discord limitation

inner epoch
honest vessel
#

oh ok what a bummer

inner epoch
gaunt ice
slate swan
inner epoch
sage otter
#

Either way, annotations is still just for docs and intellisense just like type hints

#

And you won’t be calling the coroutine anywhere else so you don’t need it.

gaunt ice
#

how dles dank memer have image generators

slate swan
#

and its usefull for devs as well

sage otter
#

Ok but you still don’t need it

gaunt ice
#

do they use PIL?

sage otter
slate swan
sage otter
#

Ok

#

But that’s different

slate swan
#

how?

sage otter
#

You use them during development

slate swan
#

its annotations

sage otter
#

You don’t use commands in development because you're not supposed to call them.

slate swan
gaunt ice
#

everyone has nitro.....

slate swan
sage otter
#

that infers something else

gaunt ice
slate swan
gaunt ice
#

yes ot

placid skiff
sage otter
slate swan
sage otter
#

|

gaunt ice
sage otter
#

Are pipes

slate swan
#

yes the built in unions

sage otter
vocal plover
slate swan
#

theyre refered as the new built in union in python lol

sage otter
slate swan
#

¯\_(ツ)_/¯

#

but sure you can call it that

sage otter
#

Omg okimii you're literally giving me a headache.

#

That’s literally what the operator is called

gaunt ice
#

is it realted to 10th grade physics?

vocal plover
#

This has no relation to discord bots

sage otter
#

No one says "You can use that built in union type there". Contrary to that, "You can use a pipe there for multiple types"

slate swan
narrow grail
#

Anyone know why my commands not working?

slate swan
vocal plover
#

The CPython grammar file defines pipe as VBAR which is a little odd lol

#

It makes sense but also why

narrow grail
sage otter
#

It’s not called "straight line" it’s called a pipe

slate swan
#

a pipe can bend😳

slate swan
gaunt ice
#

um wait im sry i have series and parallel connection for electricity im sry

sage otter
#

I’m literally arguing to not annotate commands

#

It’s a waste of time lack you said

slate swan
#

@sage otter whats a pipe used for in other lans?

gaunt ice
#

what is annotate..... command

narrow grail
sage otter
#

The same thing it’s used for in python

slate swan
sage otter
#

Aforementioned OR

slate swan
#

ah yeah a bitwise of or

slate swan
dapper cobalt
gaunt ice
cold kestrel
#

Guys i am new at this server because i wanna learn pythons to code my bot so can anyone tell me from where should i begin

slate swan
gaunt ice
#

dpy docs

dapper cobalt
narrow grail
cold kestrel
dapper cobalt
#

I boosted from here, my mouse stopped working from there.

slate swan
dapper cobalt
#

I'm doing great! Been a long time not checking up on here.

narrow grail
supple thorn
slate swan
slate swan
placid skiff
cold kestrel
#

Guys is pythons accept on visual studio node.js

supple thorn
cold kestrel
#

I have a app on my laptop called visual studio

slate swan
slate swan
# narrow grail No no, I watched some docs and they did this with bot.command

How to do commands with events

import discord
bot = discord.Client()
@bot.event
async def on_message(msg):
  if msg.startswith("!hi"):
    await msg.reply("Lie")

How to make commands with discord.ext.commands

from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command()
async def hi(ctx):
  await ctx.reply("Cry")```
cold kestrel
gaunt ice
cold kestrel
#

But mine is node.js

#

Is still work

placid skiff
slate swan
supple thorn
slate swan
gaunt ice
narrow grail
slate swan
slate swan
slate swan
#

single quotes and double quotes in python doesn't matter

#

^

placid skiff
narrow grail
slate swan
gaunt ice
slate swan
placid skiff
slate swan
#

!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.10)").

Example...
slate swan
dapper cobalt
slate swan
#

i am just showing him because he is familiar with events

gaunt ice
#

lol

slate swan
#

i am just showing him the difference we make in events and commands

#
cursor.execute('INSERT INTO banwords VALUES(%s, %s)', (message.author.id,1))2022-03-17T11:31:55.477270+00:00 app[worker.1]: psycopg2.errors.NumericValueOutOfRange: integer out of range

postgresql

gaunt ice
narrow grail
slate swan
#

but use appropriate channel

slate swan
#

okay

#

ofc if your commands.Bot variable name is not sbot

narrow grail
#

But it doesn‘t matter because I used sbot=commands.Bot

cold kestrel
#

Which file should I download

slate swan
slate swan
slate swan
cold kestrel
#

Okay guys thanks you ❤️❤️

gaunt ice
#

download python first

slate swan
#

vsc needs an ext fyi

gaunt ice
#

after that follw my steps

cold kestrel
#

Okay

maiden fable
#

@slate swan go school

narrow grail
# slate swan kden show full code
import os
import random
from discord import Intents
from discord.ext import commands
from witzliste import randomWitze

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

sbot = commands.Bot(command_prefix='~',intents=intents)

@sbot.event
async def on_ready():
  print('Ich habe mich nun eingeloggt als {0.user} '.format(sbot))
  print('Jetzt geht es ab :D')
  await sbot.change_presence(activity=discord.Game(name="mit Justin's Nerven"))

@sbot.command()
async def jo(ctx):
  await ctx.send('joooo')```
slate swan
maiden fable
slate swan
narrow grail
slate swan
#

and you don't have any errors on the terminal

narrow grail
slate swan
#

then idk

narrow grail
slate swan
#

the code doesn't seem to have an error

#

you better refresh the ide or restart your pc

narrow grail
slate swan
#

replit

#

that always does so

#

i say refresh the page

honest vessel
#

@narrow grailu dont import command you imported commands nvrm

slate swan
#

no

#

command is the deco

narrow grail
heavy folio
#

Why does my bot doesn't respond to commands in v2.0? / Why is message.content not there.
Discord.py v2.0 has migrated to api v10, and with this has come the introduction of Intents.message_content, which is disabled by default.
This means that you will need to __explicitly enable it in code and in the panel, at https://discord.com/developers/applications.__

intents = discord.Intents.default()  # All but the THREE privileged ones
intents.message_content = True  # Subscribe to the Message Content intent
bot = commands.Bot(command_prefix='-', intents=intents)  # Pass the intents into your commands.Bot or discord.Client
``` NOTE: Still not responding to commands? see `?faq on_message` in [#559455534965850142](/guild/267624335836053506/channel/559455534965850142/)
#

try this