#General Help

1 messages · Page 13 of 1

idle linden
#

nvm

lucid cove
#

yo how can i add cooldown to command

#

so i already have this

@commands.cooldown(1, 15, commands.BucketType.user)
#

and this

@bot.listen()
async def on_command_eror(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        embedvar = discord.Embed(
            description = "That command is on cooldown, try again in " + str(error.retry_after),
            color = discord.Color.red() 
        )
        await ctx.respond(embed=embedvar, ephemeral=True)
#

but i get this error

#
discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 13.50s
#

its not even an error

#

its correct

#

but instead of sending it in the server it sends it in the console

distant stag
#

i am running two programs with same token everything works fine except slash commands
lets say the first program have slash commands and the 2nd one only have text commands(no slash commands)
whenever i use slash command from bot all the commands disappears after that

#

for instance when i define slash commands in second program they don't appear until the first program's any one slash command is called and when we call then all commands from first program disappears and it only shows second program's slash commands

distant stag
#

but its in cog

lucid cove
#

what isi t

distant stag
#
@commands.command()
@commands.cooldown(x,y,z)
async def your_command(self, ctx):
  your stuff 

@commandname.error
async def local_handler(self, ctx, error):
  await ctx.send(str(error))
#

this

half marsh
lucid cove
half marsh
lucid cove
#

?

#

i alreayd have on_cmd_error

#

cuz i have prefixed commands as well

half marsh
#

Ooh

lucid cove
#

or i have bridge command

half marsh
#

I suggest you listen to both commands error and the appplication command error

half marsh
distant stag
lucid cove
#

tf is cog

distant stag
# lucid cove tf is cog

well cogs are type of containers in your code for specific functionalities you can define different cogs

#

they will keep the code well maintained

lucid cove
#

bruh either way

#

why does my code not work

distant stag
#

ok try adding this below your command

@commandname.error
async def local_handler(ctx, error):
  await ctx.send(str(error))
lucid cove
#

AttributeError: 'BridgeCommand' object has no attribute 'error'

#

dont think .error works with bride commands but it works with slash commands?

#

thats weird

distant stag
#

yeah

half marsh
#

b!rtfm pyc on_application_command_error

lucid cove
#

raise CommandOnCooldown(bucket, retry_after, self._buckets.type) # type: ignore
discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 13.03s

half marsh
distant stag
lucid cove
#

"this only fires id toy do not sepcify any listeners for command error"?

distant stag
#

but you did

#

where did you define it ?

lucid cove
distant stag
#

send code

lucid cove
#
@bot.event
async def on_command_eror(ctx, error):
    await print("lol")

@bot.bridge_command(name = 'work')
@commands.cooldown(1, 15, commands.BucketType.user)
async def workcmd(ctx):
    await work.work(ctx)  
#

where work is a coroutine function i defined elsewhere

#

what i think happens is that the bot recongizes that a command has been run on cooldown and therefore throws an exception

#

however for some reason the on_command_error function doesn't recognize that

#

and therefore doesn't respond

#

ok

#

i might just have to resort to putting a if loop in every command

slender lintel
#

b!rtfm pyc permission

slender lintel
#

b!rtfm pyc channel

slender lintel
#

anyone know how to check if user has a certain permission in a channel?

errant verge
#

can I use *args with slash or bridge commands?

#

or do i have to use ext commands

slender lintel
#

b!rtfm pyc channnel permission

open bearBOT
slender lintel
#

b!rtfm pyc channel_permission

inland acorn
#

can bot(verified) go off when it gets overloaded due to any heavy task or traffic

pure lake
slender lintel
#

i cant seem to get the bot to check the users channel permissions

#

reading the docs rn but cant see much on my issue

solemn dragon
#

No module named 'discord'

#

I did ```pip install py-cord==2.0.0b1

frigid lark
#

uninstall the old version and use
pip install py-cord==2.0.0rc1

solemn dragon
#

Did that, still didn't work, am I supposed to do pip install discord.py

pure lake
#

no

#

Can’t have pycord and d.py installed same time iirc

solemn dragon
#

so what now

pure lake
#

But if there’s supposedly no discord module installed just install discord with pip install discord

#

Or uninstall and reinstall it

solemn dragon
#

done, but still didn't work

pure lake
#

@solemn dragon what ide you using?

#

And what version of Python is it using

solemn dragon
#

Microsoft Visual Studio

pure lake
#

Make sure the one being used by ide is same as the one running on your system

solemn dragon
pure lake
solemn dragon
#

windows

pure lake
#

Alright just google how to check Python version console windows

solemn dragon
#

oh it says on top Python3.9

#

in vs

pure lake
#

Yh check what your system is using

solemn dragon
#

k

pure lake
#

I’ve had module errors where it’s bc system and ide use different versions

solemn dragon
#

the python version on the pc is 3.10.4

#

hm

#

any idea how to change the python version in vs

pure lake
#

No but just google it

solemn dragon
#

Here it shows that I have these versions

#

but when i use python --version in the cmd it says version 10

#

how can I change it from 10 to 8

#

or to 9

sharp summit
#

hello

#

How can I make options in my slash command?

#

it should show me a predefined options when invoking slash command

#

like this

#

Can I ping helpers?

solemn dragon
#

Check if this helps

sharp summit
sharp summit
solemn dragon
#

idk then

crimson gale
#

@sharp summit do you mean predefined options as in you can choose from a list of values for an option?

atomic thistle
#

I want to get a message from on_message event and I want to know which message it was replying to. How do I get it?

idle linden
lucid cove
#

how to add cooldown on bridge commands

open bearBOT
#

I couldn't find a documentation with the name commands.cooldown! Maybe you used to command wrong? Correct Usage: <prefix>rtfm <docs> [<term>] (eg. b!rtfm py cool)
List of Documentations you can search:
python
pycord
discord.py
yarsaw
nextcord
disnake

desert dagger
#

b!rtfm pyc commands.cooldown

desert dagger
#

@lucid cove try looking into the above

#

i think for prefix you kinda need to create one manually idk

lucid cove
#

well im using bridge

#

and the normal app / slash command setup doesnt work with bridge

brazen siren
#

How can I reply so that the person who wrote the slash can only see it. In the same message as the error?

worthy basin
#

ohhh,

#

ephemeral=True

brazen siren
#

Yeeah I did not remember bro

#

Ty

worthy basin
#

np

sage birch
#

Hi, I'm trying to find the amount of Scheduled Events that's been created by a specific member. My approach is by iterating through each Scheduled Event in the guild and checking the event creator. However, for some (but not all), the event creator is None when it is not. I have enabled all Intents

vocal crane
#

ah thx

slender lintel
#

?

#

i still need help with it...

sleek grove
#

what does this error mean?

errant verge
#

is it possible to use n args with slash commands?

@bot.slash_command()
async def list(ctx, *args):
  mylist = ', '.join(args)
  await ctx.send(users)

if not possible can i use bridge since it allows for ext.commands capabilities or will i have to use commands

sudden path
#

Why would you use *args. Just use args.

errant verge
sudden path
#

String options aren't 1 word.

errant verge
#

wym

sudden path
#

Slash commands options are not like normal commands.

errant verge
#

ah, ok

sudden path
spring badger
#

Hello I need some help

#

I want to use task.loop but in cog :)

#

how can I do that?

#

cause to start the loop we need to use func.start() right? where should I use it then?

#

@here

slow dome
spring badger
spring badger
#

my func does not run without func.start()

#

and with the func.start() inside init it says func not defined :) \

slow dome
spring badger
slow dome
#

ofc it's not defined. You need to use self.method.start()

frank wadi
#

How can i make that only author can use a button?

slow dome
frank wadi
#

oki

#

okey

robust basin
#

quick question: Is it not possible to have further arguments in a subcommand of a group?
The arguments are not showing up on Discord

frank wadi
#

what is wrong? bot think that I'm offline but i'm online

#

{user.status}

slow dome
robust basin
#

25 per group or per bot?

slow dome
slow dome
robust basin
#

well I'm very far away from that

#

It's not showing any options, I only need one

slow dome
#

Sometimes if you try and use the command, the command will update

robust basin
#

so far it always updated instantaneously, since i have it running only on my guild Think

#
@wrdl.command(name="start", description="Start Wordle")
async def wordle_start(ctx: commands.Context, k: Option(int, name="length", description="Input a word length from 3 to 8. Default is 5", min_value=3, max_value=8, default=4)):...```
#

It's not showing the option length 😩

slow dome
#

well, why is the ctx commands.Context?

robust basin
#

uh idk, I have it always like that and it always works

#

I only added it so that vs code has the auto complete for ctx which it otherwise doesn't have...
but lemme see if removing it helps

#

yea, no change :(

slow dome
#

have you tried using the command

#

what does it say

robust basin
#

the commands works as normal, just that it doesn't show any option to input length

#

so it's always the default value that i have in the Option

slow dome
#

Well, sometimes this works for me, but I unregister and re-register the command

robust basin
#

oh alright, lemme try that

robust basin
slender lintel
#

hi

#
        role = guildx.get_role(982715970890117170)
        user =  interaction.user
        await user.add_roles(role)

how can i fetch a user id like when you press this button in direct messages from the bot you will get the role in guildx server

slow dome
slender lintel
#

uhmm where does i have it

#
    
    @discord.ui.button(label="", style=discord.ButtonStyle.primary, emoji="➡️") # Create a button with the label "😎 Click me!" with color Blurple
    async def button_callback(self, button, interaction):
                        # Figure out who clicked the button.
        # Get the role this button is for (stored in the custom ID).
        guildx = bot.get_guild(869210320856563723)
        role = guildx.get_role(982715970890117170)
        user =  interaction.user

        #role2 = interaction.guild.get_role(tagrole)
        button.disabled = True
        button.label = "Verified"
        await user.add_roles(role)
        embedVar = discord.Embed(description=f'You re verified. Welcome!', color=0x00ff00)
        await interaction.response.edit_message(embed=embedVar, view=self)
        time.sleep(10)
        await interaction.channel.purge(limit=2)
        #View.delete()
gilded widget
slender lintel
#

for some reason slash commands just wont work

#

like

#

it shows as registered

#

but says it didnt respond

#

ususlly i just have to wait 5mins but its been doing it for the past 30mins

#

even with a really basic command it doesnt work

#
@bot.slash_command(guild_ids=[settings().guildid])
async def hello(ctx):
    await ctx.send("Hello!")
#

doesnt work

#

ctx.respond

slender lintel
#

@slender lintel

icy sluice
#

yeah

slender lintel
#

no i mean

#

it litearlly

#

does nothing

#

even when i add a print statement

#

use ctx.respond

#

ok

#

one sec

#

still nothing

#

use it on another channel

#

alright

#

didnt work

#

it quite literally does nothing

#

await ctx.respond("hello!")

#

even if i put a print statement it doesnt print

#

its like this?

#
@bot.slash_command(guild_ids=[settings().guildid])
async def hello(ctx):
    await ctx.respond("Hello!")
#

yes

#

try to reinvite the bot

#

alright

gilded widget
#

did you give it the application.commands scope when inviting

slender lintel
#

yes

#

if i didnt it wouldnt register

#

this is registeriang

#

not showing errors

#

quite literally doing nothing

#

it wont even print when i add a print statment

gilded widget
#

can you send your full code

#

definitely something not right

slender lintel
#

sec

#
intents = discord.Intents.all()
bot = commands.Bot(prefix=">", intents=intents)
class settings():
    token = "token"
    guildid = 1

@bot.slash_command(guild_ids=[settings().guildid])
async def hello(ctx):
    await ctx.respond("Hello!")

bot.run(settings().token)
gilded widget
#

weird

#

what version?

icy sluice
#

how do i fetch the invite of another bot

slender lintel
#

alpha

#

and i quitre literally reinstalled it

slender lintel
#
async def perms(ctx, member: discord.Member):
    if ctx.author.guild_permissions.administrator:
      await member.guild_permissions(ctx)
      await ctx.respond(ctx)
``` What am i doing wrong here? I am trying to see the permissions of the member given in the command
icy sluice
#

how do i escape "get" since my command name will be "get-invite" so I have

…
async def get-invite(self, ctx)
…

and it’s marking "get" as a func?

languid hollow
#

I see these quite a lot, what does the asterisk mean? Do I need to substitute any arguments in it?

pure lake
icy sluice
#

so there isn’t a way of me using get-invite?

pure lake
#

ygm

pure lake
icy sluice
frank wadi
#

b!rtfm pyc guild

frank wadi
#

b!rtfm pyc emoji

crimson coral
#

(aka. word characters by regex standards)

crimson coral
#

oh i thought you meant slash commands, my mistake

#

but yeah for regular commands you can just specify name=... in the decorator

icy sluice
#

I’m using cogs

crimson coral
#

that shouldn't change anything?

icy sluice
#

so I’d have

@commands.command(name=get-invite)

?

crimson coral
#

e.g. if your command right now is like py @commands.command() async def get_invite(self, ctx...) you can do this instead py @commands.command(name="get-invite") async def get_invite(self, ctx...)

icy sluice
#

gotcha ty

crimson coral
#

name= will override the function name

#

all good

icy sluice
#

it works, thankyou very much :)

icy sluice
#

How do I always return the ID of a user?

  • For example, if someone runs !ID @chaze, it will return the mentioned user’s ID. If another person uses !ID chaze (using username), it will return the ID of the username (in the provided guild). And lastly, if someone just uses !ID 831118106876969021 (my ID) it’ll just return that back?
steep verge
#

Referring to this suggestion: #suggestions message

Embeds can have multiple images? Like where you set embed.set_image()?

desert dagger
#

How would i take a Discord.Attachment and treat it like an image stored locally?

#

like lets say i have something like

text = OCR('./image.png')

would there be a way to just use the Discord.Attachment or do i need to download, use it then delete?

fallow fulcrum
#

ImportError: cannot import name 'PartialMessageable' from 'discord.channel

#

i keep getting this even tho the code just worked

#

did somthing change

fallow fulcrum
desert dagger
#

b!rtfm pyc PartialMessageable

fallow fulcrum
desert dagger
#

check to see what version you're using

fallow fulcrum
#

i cant print it cuz it runs error on import discord

#

and before that its not defined

#

using discord.__version__

desert dagger
fallow fulcrum
#

py-cord 2.0.0rc1

fallow fulcrum
#

it in module

desert dagger
#

i see

desert dagger
#

then install py-cord again and see if it fixes the issue

fallow fulcrum
#

somehow it fixed itself

#

idk how i did it

#

but thanks lol

deep grail
#

What does :< mean in F strings?

#

I found it here in discord.ext.commands.DefaultHelpCommand:

entry = f'{self.indent * " "}{name:<{width}} {command.short_doc}'
slow dome
deep grail
desert dagger
deep grail
#

Oh ok thanks

slender lintel
#

how to do embeds?

clever lava
#

how far can we go with modals?

#

it can just have text fields?

gilded widget
#

at the moment yeah, just text fields

#

select menus coming soon once discord officially supports them

slender lintel
#

ok

#

how do i mention a

#

user

#

just

#

{member} ?

#

and how do i ban

#

oh wait nvm

sudden path
#

Read the documentation.

slender lintel
#
    @client.slash_command(name="multi", description="Multiples two numbers!")
    async def ban(self, ctx,member):
        embed=discord.Embed(title="Ban Successful ✅", description="Successfully Banned", color=discord.Color.red())
        await discord.Member.ban()
        await ctx.respond(embed)
        
#

so i have

#

is this ok?

sudden path
#

No

#

you're calling the whole class on Discord.Member.ban

slender lintel
#

hold up

sudden path
#

When responding and sending an embed you need the embed keyword.

slender lintel
#

ok

slender lintel
#

await ctx.respond?

sudden path
#

I said when responding, so yes

clever lava
#

cant wait for it

#
Ignoring exception in on_connect
Traceback (most recent call last):
  File "/home/runner/Embeds/venv/lib/python3.8/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
  File "/home/runner/Embeds/venv/lib/python3.8/site-packages/discord/bot.py", line 1147, in on_connect
    await self.sync_commands()
  File "/home/runner/Embeds/venv/lib/python3.8/site-packages/discord/bot.py", line 770, in sync_commands
    await self._bot.http.bulk_upsert_command_permissions(self._bot.user.id, guild_id, guild_cmd_perms)
  File "/home/runner/Embeds/venv/lib/python3.8/site-packages/discord/http.py", line 359, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 405 Method Not Allowed (error code: 0): 405: Method Not Allowed
gilded widget
#

update

clever lava
#

why everytime i run the bot this show up on console and the commands disapear

gilded widget
#

rc1 pls

clever lava
#

wut

gilded widget
#

update pycord to 2.0.0rc1

clever lava
#

oh

#

ok

#

nice ty

slender lintel
#

i get

slender lintel
#

WHERE

#

im so confussed

#

please help

gilded widget
#

in ctx.respond

slender lintel
#

ohh

#

.embed?

gilded widget
#

ctx.respond(embed=em)

slender lintel
#

omg

#

im so fucking stupid

gilded widget
#

lmao all good

slender lintel
#

im new to pycord

#

so

gilded widget
#

its fine lmao

#

id recommend the guide and docs tho

slender lintel
#

i have been

#

they a little janky for me lmao

gilded widget
#

docs? or guide?

slender lintel
#

i have a hard time reading api docs

gilded widget
#

if you'd prefer examples the repository has a good bit of examples to work off of

slender lintel
#

ok

#

dope link?

slender lintel
#

dope

#

thx

#

dude

gilded widget
#

np

slender lintel
#

dope dude it works thx again

#

and you know how i can check perms?

#

@gilded widget

gilded widget
#

dont ping pls

#

and uh

supple ravineBOT
#
A decorator that limits the usage of a slash command to members with certain
permissions.

The permissions passed in must be exactly like the properties shown under
:class:`.discord.Permissions`.

.. note::
    These permissions can be updated by server administrators per-guild. As such, these are only "defaults", as the
    name suggests. If you want to make sure that a user **always** has the specified permissions regardless, you
    should use an internal check such as :func:`~.ext.commands.has_permissions`.

Parameters
------------
perms
    An argument list of permissions to check for.

Example
---------

.. code-block:: python3

    from discord import default_permissions

    @bot.slash_command()
    @default_permissions(manage_messages=True)
    async def test(ctx):
        await ctx.respond('You can manage messages.')```
gilded widget
#

discord.default_permissions

slender lintel
#

ok

#

thx

clever lava
#
embed=discord.Embed(title=self.children[0].value, description=self.children[1].value, color=2f3136)
embed.set_image(url=self.children[3].value)
embed.set_footer(text=self.children[2].value)
#

bruh

#

how to set custom color for embeds using hex code

#

it does not work

slender lintel
#

DAMN

#

u using images

#

tf

#

how u do dat

#

i wanna try dat bitch

clever lava
#

im testing it out

gilded widget
#

not sure how to do hex but you can do discord.Color.from_rgb(r,g,b)

slender lintel
#

how do see who banned a user

clever lava
#

it worked btw

slender lintel
#

like user banned user

clever lava
#

nice

#

i used to make it with hex code when i was discord.py user

slender lintel
#

@gilded widget

frank wadi
#

how can i make a slash group?

keen root
slender lintel
#

oh damn

#

well mee6 can

frank wadi
#

hmm

#

idk bor

#

bro*

keen root
frank wadi
#

o

#

thanks

keen root
slender lintel
#

fuck somethinghost

#

its so ass

keen root
frank wadi
#

ok

slender lintel
#

to

#

yo

#

I am getting an error

#

Application Command raised an exception: AttributeError: module 'utils' has no attribute 'nitroButtons'

#

utils is a folder

keen root
slender lintel
#

and I have multiple buttons in it

#

so

#

i used

#

import utils

#

and it wont do the command

frank wadi
#
    permission = SlashCommandGroup("permission")

    @permission.command(description="Get the profile picture of a user > Skyler")
    async def admin(self, ctx, role:discord.Role):```
#

what is wrong

frank wadi
#

nope

#

that is wrong i think

#

permission = SlashCommandGroup("permission")

keen root
slender lintel
#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: '>=' not supported between instances of 'str' and 'int'

#
import discord
from discord.ext import commands
from discord.commands import SlashCommand
from discord import default_permissions

client = commands.Bot()

class clear(commands.Cog):
    def __init__(self, client):
        self.client = client

    @client.slash_command(name="clear", description="clears a specified amount of messages")
    @default_permissions(manage_messages=True)
    async def ban(self, ctx, amount = None):
        if amount == None:
            embed=discord.Embed(title="Clear Failed ❌", description="Please specifie how many messages you would like to delete ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)

        else:

            if amount >= 1000:
                embed=discord.Embed(title="Clear Failed ❌", description="Do not go over 1000, /purge for 1000+ messages ❌.", color=discord.Color.dark_gold())
                await ctx.respond(embed=embed)
            return

        if amount <= 0:
            embed=discord.Embed(title="Clear Failed ❌", description="I cannot delete zero messages ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)


        await ctx.guild.clear(amount)
        em = discord.Embed(title="Cleard messages Successfully ✅",  color=discord.Color.dark_gold())
        em.add_field(name="cleard amount", value=f"{amount}")
        await ctx.respond(embed=em)


def setup(client):
    client.add_cog(clear(client))
#

heres source code

frank wadi
#

ban = clear

#

XD

slender lintel
#

?

#

oops

frank wadi
#

hashsh

frank wadi
#
import discord
import sqlite3
from discord.ext import commands
from discord.commands import slash_command, SlashCommandGroup

class perm(commands.Cog):
    def __init__(self, client):
        self.client = client 
    permission = SlashCommandGroup("permission") 

    @permission.command(description="Get the profile picture of a user > Skyler")
    async def admin(self, ctx, role:discord.Role):
        if ctx.message.author.guild_permissions.manage_messages:
            db = sqlite3.connect('main.db')
            cursor = db.cursor()
            cursor.execute(f"SELECT admin_id FROM Permissions WHERE guild_id = {ctx.guild.id}")
            result =  cursor.fetchone()
            if result is None:
                sql = ("INSERT INTO Permissions(guild_id, admin_id) VALUES(?,?)")
                val = (ctx.guild.id, role.id)
                embed = discord.Embed(description=f"![967333765431050250](https://cdn.discordapp.com/emojis/980832161114513458.webp?size=128 "967333765431050250") You successfully set Admin role **{role.name}**", color=0x23d953)
                embed.set_author(name=f"{ctx.author.name}#{ctx.author.discriminator}", icon_url=ctx.author.avatar)
                await ctx.respond(embed=embed, ephemeral = True)
            elif result is not None:
                sql = ("UPDATE Permissions SET admin_id = ? WHERE guild_id = ?")
                val = (role.id, ctx.guild_id)
                embed = discord.Embed(description=f"![967333765431050250](https://cdn.discordapp.com/emojis/980832161114513458.webp?size=128 "967333765431050250") You successfully set Admin role **{role.name}**", color=0x23d953)
                embed.set_author(name=f"{ctx.author.name}#{ctx.author.discriminator}", icon_url=ctx.author.avatar)
                await ctx.respond(embed=embed, ephemeral = True)
            cursor.execute(sql, val)
            db.commit()
            cursor.close()
            db.close()```
slender lintel
#

how do i fix my error

frank wadi
#

hmm

keen root
slender lintel
#

so int(amout) ?

keen root
slender lintel
#

and how can i make this clear command more "appeling"

sage birch
slender lintel
#
   async def clear(self, ctx, amount = None):
#

as in this

#

@frank wadi

#

anyone?

frank wadi
#

error?

slender lintel
#

yes

frank wadi
#

give

#

send

slender lintel
#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: '>=' not supported between instances of 'str' and 'int'

#
import discord
from discord.ext import commands
from discord.commands import SlashCommand
from discord import default_permissions

client = commands.Bot()

class clear(commands.Cog):
    def __init__(self, client):
        self.client = client

    @client.slash_command(name="clear", description="clears a specified amount of messages")
    @default_permissions(manage_messages=True)
    async def clear(self, ctx, amount = None):
        if amount == None:
            embed=discord.Embed(title="Clear Failed ❌", description="Please specifie how many messages you would like to delete ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)

        else:

            if amount >= 1000:
                embed=discord.Embed(title="Clear Failed ❌", description="Do not go over 1000, /purge for 1000+ messages ❌.", color=discord.Color.dark_gold())
                await ctx.respond(embed=embed)
            return

        if amount <= 0:
            embed=discord.Embed(title="Clear Failed ❌", description="I cannot delete zero messages ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)


        await ctx.guild.clear(amount)
        em = discord.Embed(title="Cleard messages Successfully ✅",  color=discord.Color.dark_gold())
        em.add_field(name="cleard amount", value=f"{amount}")
        await ctx.respond(embed=em)


def setup(client):
    client.add_cog(clear(client))

and heres all my code

frank wadi
#

delete this =

#

if amount < 0:
if amount > 1000

slender lintel
#

where

#

?

gilded widget
#

you never turned amount into an int

#

assuming it exists

slender lintel
#

where

#

im loke conffused

#

here

frank wadi
#

yes

gilded widget
#

you have a slash command, typehint amount with int

frank wadi
#

amount: int = None

gilded widget
#

^

slender lintel
#

before

#

it dont work

#

no errors tho

#
    await ctx.guild.clear(amount)
        em = discord.Embed(title="Cleard messages Successfully ✅",  color=discord.Color.dark_gold())
        em.add_field(name="cleard amount", value=f"{amount}")
        await ctx.respond(embed=em)

i belive its this

gilded widget
#

use discord.Option tbh

slender lintel
#

why

gilded widget
#

why do you think its that

#

i dont see any issues

slender lintel
#

cuz its not responding

gilded widget
#

wait what is guild.clear

slender lintel
#

to clear messgaes

#

?

#

i found in docs

#

wow

#

ok

#

buddy

frank wadi
#

no

#

not here

#

sorry

#

wait

frank wadi
slender lintel
#

ya ik

#

i just found it

wraith finch
#

Is there a way to make my bot retrieve the usernames of all users who have a specific role?

slender lintel
#

can i host with

#

something host with pycord?

#

cuz i bought it

#

nah it still aint working

#

im rebuild code to be in options

keen root
wraith finch
#

ty

slender lintel
#

can i get help real quic

#
import discord
from discord.ext import commands
from discord.commands import SlashCommand
from discord import default_permissions

client = commands.Bot()

class clear(commands.Cog):
    def __init__(self, client):
        self.client = client

    @client.slash_command(name="clear", description="clears a specified amount of messages")
    @default_permissions(manage_messages=True)
    async def clear(self, ctx, amount: int = None):
        if amount == None:
            embed=discord.Embed(title="Clear Failed ❌", description="Please specifie how many messages you would like to delete ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)

        else:

            if amount >= 1000:
                embed=discord.Embed(title="Clear Failed ❌", description="Do not go over 1000, /purge for 1000+ messages ❌.", color=discord.Color.dark_gold())
                await ctx.respond(embed=embed)
            return

  
        await ctx.channel.purge(amount)
        em = discord.Embed(title="Cleard messages Successfully ✅",  color=discord.Color.dark_gold())
        em.add_field(name="cleard amount", value=f"{amount}")
        await ctx.respond(embed=em)


def setup(client):
    client.add_cog(clear(client))

it wont respond or delte messages

#

not errors

#

@gilded widget

#

?

gilded widget
#

#help-rules man, please stop pinging me

slender lintel
#

ok

keen root
slender lintel
#

i dont wanna use options

sage birch
#

Hi, I'm getting None for all guild scheduled_events.creator, although scheduled_events.creator_id does work. I have enabled all Intents (super().__init__(intents=discord.Intents().all()))

slender lintel
#

the bot dosent want to respond

#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: _TextChannel.purge() takes 1 positional argument but 2 were given

#

bruh

#

now im getting this

#
import discord
from discord.ext import commands
from discord.commands import SlashCommand
from discord import default_permissions

client = commands.Bot()

class clear(commands.Cog):
    def __init__(self, client):
        self.client = client

    @client.slash_command(name="clear", description="clears a specified amount of messages")
    @default_permissions(manage_messages=True)
    async def clear(self, ctx, amount: int = None):
        if amount == None:
            embed=discord.Embed(title="Clear Failed ❌", description="Please specifie how many messages you would like to delete ❌.", color=discord.Color.dark_gold())
            await ctx.respond(embed=embed)

        else:

            if amount >= 1000:
                embed=discord.Embed(title="Clear Failed ❌", description="Do not go over 1000, /purge for 1000+ messages ❌.", color=discord.Color.dark_gold())
                await ctx.respond(embed=embed)

  
        await ctx.channel.purge(amount)
        em = discord.Embed(title="Cleard messages Successfully ✅",  color=discord.Color.dark_gold())
        em.add_field(name="cleard amount", value=f"{amount}")
        await ctx.respond(embed=em)


def setup(client):
    client.add_cog(clear(client))
#

im so conffused

#

dude

#

this shit makes no sence

keen root
sage birch
#

Speaking of clearing messages, is there any way to clear a specific member's messages other than my current method?
Current method:

# amount is the specified number of messages to clear
# member is the spcified member whose messages should be cleared

total_msg_count = 0
member_msg_count = 0
async for msg in ctx.channel.history(limit=None):
  total_msg_count += 1
  if msg.author == member:
    member_msg_count += 1
    if member_msg_count == amount:
      break
await ctx.channel.purge(limit=total_msg_count, check=lambda message: message.author == member)
slender lintel
#

ok but when i throw a return on my if

#

it fails

#

omg im so fucking stupuid i had my return in the wrong spot

#

lmao

frank moon
#
Traceback (most recent call last):
  File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ui\view.py", line 371, in _scheduled_task
    await item.callback(interaction)
  File "D:\All Codes\testobt\cogs\slash_commands\utilities\normal_cmds.py", line 67, in edit_embed
    await i.response.send_modal(EmbedModal(self.channel, True))
  File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\interactions.py", line 897, in send_modal
    raise InteractionResponded(self._parent)
discord.errors.InteractionResponded: This interaction has already been responded to before
``` 🤔
#

how should i handle this modal?

gilded widget
#

why defer?

#

i dont think you can send a modal after deferring

ancient gazelle
#

how do i install from the latest github repo?

inland acorn
#

it will return user object in any way you pass arg, raw id, name#tag or mention, then , then get id using, user.id

icy sluice
inland acorn
#

?rtfm memberconverter

open bearBOT
#

I couldn't find a documentation with the name memberconverter! Maybe you used to command wrong? Correct Usage: <prefix>rtfm <docs> [<term>] (eg. b!rtfm py cool)
List of Documentations you can search:
python
pycord
discord.py
yarsaw
nextcord
disnake

icy sluice
#

b!rtfm pyc memberconverter

inland acorn
#

yes

icy sluice
#

can you give me a quick example on how to use it?

icy sluice
#

any1?

ornate spade
#

await Converter.convert(ctx, thing_to_convert)

desert dagger
boreal arch
#

how to remove file in message?

i tried to do it like this:
await message.edit_original_message(content=f":white_check_mark: {gdset_sucess[leng]}",file=None,embed=embed_set_img,view=None)
but no working

Error:
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'fp'

worthy basin
sleek grove
boreal arch
worthy basin
worthy basin
boreal arch
worthy basin
#

I think its mad because its trying to do stuff with None

boreal arch
worthy basin
#

await message.edit_original_message(content=f":white_check_mark: {gdset_sucess[leng]}",embed=embed_set_img,view=None)
Sends that image above?

sleek grove
sleek grove
#

fixed.

#

but now i have a other error

boreal arch
sleek grove
#

Traceback (most recent call last):
File "applebuild/main.py", line 25, in <module>
bot.run(token)
File "applebuild/venv/lib/python3.10/site-packages/discord/client.py", line 715, in run
return future.result()
File "applebuild/venv/lib/python3.10/site-packages/discord/client.py", line 694, in runner
await self.start(*args, **kwargs)
File "applebuild/venv/lib/python3.10/site-packages/discord/client.py", line 658, in start
await self.connect(reconnect=reconnect)
File "applebuild/venv/lib/python3.10/site-packages/discord/client.py", line 599, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

worthy basin
#

You need to enable intents from the link in your error

sleek grove
#

works thanks

worthy basin
#

I have a felling that None should work but there is a lib bug

sage birch
#

Hi, I'm getting None for all guild scheduled_events.creator, although scheduled_events.creator_id does work. I have enabled all Intents (super().__init__(intents=discord.Intents().all()))

boreal arch
worthy basin
#

that would work, You could also open an issue on the github to get it fixed so that None would work

boreal arch
worthy basin
#

wait i have one more test

sage birch
boreal arch
worthy basin
#

👀 try it

boreal arch
boreal arch
sage birch
boreal arch
sage birch
#

It was my fault for wording it so vaguely

#

Thanks for your help though, appreciate it

slender lintel
#

uhmm

AttributeError: module 'discord' has no attribute 'default_permissions'```
#
@discord.default_permissions(
    administrator=True
)
async def apply(ctx):
    await ctx.respond(view=MyViewModal())
boreal arch
slender lintel
#

ty

worthy basin
#

Update pycord to 2.0.0rc1

wintry python
#

for this, can I use the role ID?

#

or would I need to get the guild ID then get the role using the Role ID?

slender lintel
wintry python
desert dagger
#

so

#

To add a role to someone best way is this:

role_name = get(ctx.guild.roles, name=role_name) (you can use id=0000000000000 as well)

await ctx.author.add_roles(role_name, reason="reason")

wintry python
desert dagger
#

yeah

#

author can be replaced with user

wintry python
#

great, thanks for the help \o/

desert dagger
#

happy to help

#

b!rtfm pyc add_roles

open bearBOT
wintry python
sudden path
#

It is from discord.utils

#

You either import it or do discord.utils.get

desert dagger
wintry python
#

ah

#

tyty

desert dagger
#

my bad lol

wintry python
#

all good lol, just started this all up yesterday so am still figuring stuff out

desert dagger
#

sometimes in the code here you'll see people import stuff to shorten it or just use long paths like
discord.utils.get()

wintry python
#

ooo

desert dagger
wintry python
#

tyty

desert dagger
#

If you're new the best place to check is the docs

wintry python
#

what I just import the whole thing?

wintry python
wintry python
#

yepp, been using these two \o/

desert dagger
#

get(ctx.guild.roles, name=role_name) vs discord.utils.get(ctx.guild.roles, name=role_name)

wintry python
#

doing first way lol

desert dagger
#

then add the imports at top

#

Something you'll notice (im new too) is theres many ways of doing the same thing

wintry python
#

also do I need to import discord.ext if I only plan to use slash commands?

desert dagger
#

from discord.ext import commands
from discord.commands import slashComamnd

wintry python
#

tyty

desert dagger
#
@bot.slash_command()
async def test(ctx, member: discord.Option(discord.Member)):
    await ctx.respond(member)

simple way of making slash command called /test that takes a member input

wintry python
# desert dagger ```py @bot.slash_command() async def test(ctx, member: discord.Option(discord.Me...

yep yep, I made one that kicks everyone in a role py @bot.command(name = "remove", description = "Kicks all the people in a specified role", default_member_permissions = discord.Permissions(kick_members=True, ban_members=True, moderate_members=True, manage_messages=True,)) async def kick(ctx, reason: discord.Option(str, "Enter the Reason for using this command if you want", required = False)): guildx = bot.get_guild(stuff) role = guildx.get_role(stuff) for member in ctx.guild.members: if role in member.roles: # does member have the specified role? await member.kick(reason=reason) return await ctx.respond("Done")

wintry python
#

Because this is what i'm using rn user: discord.Option(discord.SlashCommandOptionType.user

royal mantle
#

guys do you know how to create a private response?

desert dagger
royal mantle
#

ty

desert dagger
#

await ctx.respond(embed=embed,ephemeral=True) is an example

desert dagger
#

if it works then it works

wintry python
#

true lmao

desert dagger
#

discord.SlashCommandOptionType.user will return discord.Member too

#

the one i use is just less wordy

wintry python
#

woah

desert dagger
desert dagger
#

altho

#

why is guildx = bot.get_guild(stuff) needed?

wintry python
desert dagger
#

ctx.guild will basically get the guild the command was ran

wintry python
#

yep, which is ideal

wintry python
desert dagger
#

you can also add

#

@discord.commands.guild_only() as well

#

cause i assume commands probs visible in dms unless you got debug_guild as a value

wintry python
#

oh, yeah true. Was wondering also how to only specify it to a specific guild

desert dagger
#

in production you probs wont have that there

#

Slash commands takes upto an hour to register unless its a debug_guild

wintry python
#

interesting

wintry python
desert dagger
#

nah

#

@bot.slash_command()
@discord.commands.guild_only()

#

example ^^

wintry python
#

separate line, okay makes sense

desert dagger
#

they're called "decorators"

wintry python
#

can I make it so that command only shows up in that guild using the guild ID?

#

Like it shows up in one guild but not the other

desert dagger
#

yeah

#

@bot.slash_command(name,description,guild_ids=[])

#

name and description isnt needed in the decorator but if you prefer it then go ahead

wintry python
#

Yeah I always add them in lol

desert dagger
#

atm i assume you're just making one big file

#

later on you'd come across cogs which is slightly different. For now just learn how to do stuff then look into cogs as a way to splitting into pieces and stuff

slender lintel
#

Hello! I am switching to Pycord from discord.py and I assume almost everything which is currently in DIscord.py is already there in Pycord?

wintry python
desert dagger
crimson gale
#

there are some breaking changes you need to keep in mind though

wintry python
#

heard a bit about cogs but I feel like it's a little early to get into them

desert dagger
crimson gale
#

no it doesnt

slender lintel
slender lintel
wintry python
desert dagger
#

oh wait nvm that was a replit issue lmao

slender lintel
crimson gale
#

cogs are the exact same

slender lintel
#

ah noice to hear

desert dagger
#

not really

slender lintel
#

could you tell me about the big breaking changes?

desert dagger
#

in cogs you'd use things like @commands.command() and add "bot" becomes self. you'd have to add "self" as the first parameter then other params like ctx etc

crimson gale
#

thats been the thing in dpy

desert dagger
#

ah nvm i shouldnt be answering two ppl at the same time

#

i was explaining to @wintry python how cogs work rather than you raj sorry

slender lintel
#

ah k

#

np

desert dagger
languid hollow
#

for some reason i can't get Modal from discord.ui as well as InputText

desert dagger
desert dagger
desert dagger
languid hollow
wintry python
languid hollow
#

and I'm so confused on what is going on

desert dagger
languid hollow
#

py-cord==2.0.0b1

#

i can't install rc1

desert dagger
#

hm

#

why not?

languid hollow
#

since when I do install it

#

my code doesn't run

desert dagger
#

what errors do you get?

languid hollow
#

no errors

#

just doesn't work

desert dagger
#

can you update and try it?

#

I'd like to see your consoles error etc

languid hollow
#

sure lemme try, I mean is it bc the rc1 supports only slash commands?

crimson gale
#

if it did then that'd be a dumb decision

#

it supports prefixed commands

desert dagger
languid hollow
#

nothing happens, the thing got solved

#

but the code is not executing

desert dagger
#

can you show code?

languid hollow
#
from discord.ext import commands
from discord.ui import View, Modal, InputText
import discord
import information as I


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

class MyForm(Modal):
    def __init__(self):
        super().__init__("Flight Announcement")
        self.add_item(InputText(label="Short Input",PlaceHolder="PlaceHolder"))

class MyView(View):
    def __init__(self,ctx):
        super().__init__(timeout=3)
        self.ctx = ctx

    @discord.ui.button(label="Flight Announcement", style=discord.ButtonStyle.blurple, emoji=":cool~1:") #Work on expanding this to make it universal
    
    async def button_callback(self,button,interaction):
        button.style = discord.ButtonStyle.red
        button.disabled = True
        await interaction.response.edit_message(view=self)

        
    async def on_timeout(self):
        for child in self.children: 
            child.disabled = True
            child.style = discord.ButtonStyle.red

        await self.message.edit(view=self)
    
    async def interaction_check(self,interaction):
        if interaction.user != self.ctx.author:
            await interaction.response.send_message("Invalid",ephemeral=True)
            return False
        
        else: return True

@bot.command()
async def flight(ctx):
    View = MyView(ctx)
    View.message = await ctx.send(I.Announcement,view = View)

@bot.command()
async def Menu(ctx):
    Form = MyForm(ctx)
    Form.message = await ctx.send_modal("Hello",view = Form)
desert dagger
languid hollow
#

yup

#

the flight thing works, i need to finish the menu command

#

but downloading the new versions are making it not work#

desert dagger
#

add debug_guilds=[id] to your bot thing

slender lintel
#

what hosting doe @supple ravine use

desert dagger
#

bot = commands.Bot(command_prefix = "?",intents=discord.Intents.all(),debug_guilds=[server_id])

#

also change def Menu to def menu

desert dagger
desert dagger
languid hollow
#

it has errors now

#

discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access

desert dagger
#

bot = commands.Bot(command_prefix = "?",intents=discord.Intents.default(),debug_guilds=[server_id])

slender lintel
deep grail
#

U need message content intents im pretty sure

slender lintel
#

cuz it got banned by discord

desert dagger
#

lmao i see

desert dagger
#

I prefer using my oracle vps rather than credits lmao

slender lintel
#

I have pycord downloaded and import python

desert dagger
slender lintel
#

is it any good?

slender lintel
desert dagger
#
@bot.slash_command()
async def test(ctx, member: discord.Option(discord.Member)):
    await ctx.respond(member)

example slash command

desert dagger
slender lintel
deep grail
desert dagger
#

you just put
import discord

slender lintel
#

make sure u imported slash commmands

desert dagger
slender lintel
#

from discord.commands import SlashCommand

slender lintel
languid hollow
deep grail
slender lintel
#

it work?

slender lintel
#

nope

#

hmm

crimson gale
#

just import from discord

slender lintel
#
import discord
import os
from discord.ext import commands
from discord.commands import SlashCommand

client = commands.Bot()
#

this is my main

#

setup

#

buti use cogs

#

same i do too

#

show all code

#

i wanna see it

#

uhh its pretty long

#

wait

#

just the slah command

#
import discord, requests, json, sqlite3, os, asyncio
from discord.ext import commands  # Imports required Modules
from mcstatus import MinecraftServer
from dotenv import load_dotenv
from pathlib import Path
from discord.commands import SlashCommand


intents = discord.Intents.all()
intents.members = True
load_dotenv(dotenv_path=Path('data/.env'))


client = commands.Bot(command_prefix=prefix, intents=intents, help_command=None, case_insensitive=True)  # Setting prefix

@client.slash_command(guild_ids=[894902529039687720])
async def test(ctx):
    await ctx.respond("Hello!")

client.run(os.getenv("DISCORD_TOKEN"))
#

@client.slash_command(name="clear", description="clears a specified amount of messages")
@default_permissions(manage_messages=True)

#

ui forgot

#

u have to define the slah command

#

thats mine

#

oh shit-

#

change if for yours

#

it gives a error in the import thoo

#

hmm

#

hold up

#

try

slender lintel
#

i can send pip list too if you want

crimson gale
#

pip install -U py-cord==2.0.0rc1

slender lintel
#

^

#

ah

#

ty

#

wait how do i do that for pycharm

#

it work

#

do what

crimson gale
#

open your terminal in pycharm

#

if you can even do that

slender lintel
#

ah got it

#

imagine using pycharm 🤓

#

😭 it looks clean

#

no it dose not

#

litteraly the uglist ui ive ever seen

#

this is mine it looks so much better

#

i would recomend using vscode

#

i love vscode

#

I use VScode too, but for everything except py lol

#

why

#

its pretty much meant for py

#

and js

#

Hey my bot isnt starting i get this error (or message) in console

DEBUG:discord.client:on_ready has successfully been registered as an event
DEBUG:discord.client:on_application_command_error has successfully been registered as an event```
#

isntall voice

zealous brook
#
async def on_message(message, m=None):
    if '!help' in message.content:
        embed = discord.Embed(title="Hilfe", description="Melde dich bitte bei Juvani#9744!", colour=0xff0000)
        await message.channel.send(embed=embed)
    if message.content.startswith('!userinfo'):
        args = message.content.split(' ')
    if len(args) == 2:
            member: Member = discord.utils.find(lambda: m,args [1] in m.name, message.guild.members)
    if member:
                embed = discord.Embed(title='Userinfo für {}'.format(member.name),
                                      description='Hier siehst du alles Infos über den User {}'.format(member.name),
                                      colour= 0xff0000)
                embed.add_field(name='Server beigetreten', value=member.joined_at.strftime('%d/%m/Y, %H:%M:%S'),
                                inline=True)
                embed.add_field(name='Discord beigetreten', value=member.created_at.strftime('%d/%m/Y, %H:%M:%S'),
                inline = True)

                rollen = ''
                for role in member.roles:
                        rollen += '{} \r\n'.format(role.mention)
                        if rollen:
                            embed.add_field(title='Rollen', value=rollen, inline=True)
                            embed.set_thumbnail(url=member.avatar_url)
                            embed.set_footer(text='Das waren die wichtigsten Infos!')
                        await message.channel.send(embed=embed)```
crimson gale
#

vscode can code in pretty much anything as long as the relevant extensions are available

slender lintel
slender lintel
slender lintel
slender lintel
#

WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported

#

so u dont get this error

zealous brook
#

whats wrong in my code?

slender lintel
#

oh wait

#

hold up

crimson gale
#

None = the member wasnt found

zealous brook
slender lintel
#

key word arguments

zealous brook
#

okay

#

so what can i do?

slender lintel
# slender lintel key word arguments

Hey i still get
DEBUG:discord.client:on_ready has successfully been registered as an event
DEBUG:discord.client:on_application_command_error has successfully been registered as an event
I installed voice, do i need to add any code or?

#

show line 30

slender lintel
#

should have too

#

u getting any errros?

#

Nope

#

try using your command

deep grail
zealous brook
slender lintel
#

yeah but it dosent go online

zealous brook
#

okay

slender lintel
#

is your token correctr

#

yes

#

and u using client.run on the bottom

#

Oh i fixed it, I accdeintly added an indent or 2 on bot.run

ornate spade
earnest rampart
#

ive installed pycord

#

and discord still isnt a module

slender lintel
#

i get it too

#

its nothing to be worried sabout

earnest rampart
#

cause my bot wont run it

slender lintel
#

oh ok then

#

do this

#

pip install -U py-cord==2.0.0rc1

earnest rampart
slender lintel
#

unistall it then

earnest rampart
slender lintel
#

anyone got a help command

#

i can look at

steep verge
#

When using the message history, is there an alternative way to get the message’s content without the message content intent with the REST api? And if I can use the rest api to get the content without the intent, how do I do that with pycord?

crimson gale
steep verge
#

I was told you can use the REST api

surreal nimbus
#

Not Pycord related

crimson gale
#

pycord uses the rest api

#

there are no workarounds

surreal nimbus
#

Oh

crimson gale
#

how else do you think bots work if the api didnt exist?

surreal nimbus
#

It's limited by discord, not Pycord

surreal nimbus
earnest rampart
#

why

#

is thgis not working

#

when its all installed

crimson gale
#

restart ide

earnest rampart
#

@red tendon

crimson gale
#

fyi dont ping people

earnest rampart
#

ok

crimson gale
#

we are not obligated to help

earnest rampart
crimson gale
#

yes ive read it

whole patrol
#

hello, does anyone know why i get this error?
cannot import name 'commands' from 'discord.ext' (unknown location)
i'm trying to migrate my old discord bot from discord.py to pycord but i don't know what module should i use insted of that?

crimson gale
#

did you not uninstall dpy prior to installing pycord?

surreal nimbus
# earnest rampart doesnt work btw

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

whole patrol
earnest rampart
#

thats the error

#

but the discord module isnt working

surreal nimbus
#

Did u install pycord?

earnest rampart
surreal nimbus
#

Which version?

earnest rampart
#

what cmd should i do

surreal nimbus
spring badger
#

Helu?

#

I'm getting this error even If the bot is Connected to the VC

#

@here

slender lintel
#

how do I check if the bot tries to delete 50 messages and t heres less than 50 messgaes say something
how do i check that

#

or really any number

crimson coral
spring badger
crimson coral
sage birch
#

Hi, for on_scheduled_event_update(before, after), I'm getting NoneType for before. Is there any reason why?

crimson coral
sage birch
#

Just before

crimson coral
#

hmmm

#

maybe it just wasn't cached before?

#

does it always return None for before

sage birch
#
@Cog.listener()
    async def on_scheduled_event_update(self, before, after):
        print("update", before, after)
#

Yes I had this problem before as well

#

In older Pycord versions

slender lintel
#

how do i make slash cmds within cogs?

sage birch
# slender lintel how do i make slash cmds within cogs?
from discord.commands.core import slash_command
from discord.ext.commands import Cog

class ACog(Cog):
  def __init__(self, bot):
    self.bot = bot

  @slash_command(guild_ids=[Guild_ID], description="Foobar")
  async def foo(self, ctx, bar):
    await ctx.respond(bar)

def setup(bot):
  bot.add_cog(ACog(bot))
slender lintel
#

what's the diff between respond and reply?

slender lintel
#
async def info(ctx):
    ctx.send('Hello! Here is some useful infomation about me.\n I run through slash commands and i am created by jack. here is my commands \n /ip - Sends our minecraft SMP IP \n  /ping - Stats of the bot \n /nick - Used to change someones nickname \n /say - Sends a message of your choice through the bot \n /bean - Fake bans someone \n /dm - dms anyone your chosen message through the bot \n  ')``` Why isnt my bot sending the message after /info
#

ah k, also how do i make input for slash cmds?

sage birch
#

await ctx.send()

sudden path
#

You're not awaiting the response

slender lintel
#

i did it w respond and it never worked either

crimson coral
sudden path
sudden path
slender lintel
#

okay

slender lintel
slender lintel
sudden path
#

You haven't shared the error

#

Or more context

slender lintel
#

dont have an error

sudden path
slender lintel
#

I just get 'Application did not respond' no errors in console

crimson coral
#

you didn't await it

sudden path
#

Code?

slender lintel
#

oh yeah

#

my bad

#

fixed that, lol thanks nelo

slender lintel
sudden path
#

You sent old code. Which you were told to await and then told to switch send to respond

slender lintel
crimson coral
#

no, send and respond are very different

slender lintel
#

what's the diff?

crimson coral
#

send is a generic function used for any "Messageable" object (users, channels etc.)

#

ctx.respond is a response to an interaction, and is a shortcut for ctx.interaction.response.send_message

#

which is required when working with slash commands

slender lintel
#

ah

sage birch
#

Btw, is there any way to purge a specific member's messages without first iterating through channel messages to get the amount of messages to check?

slender lintel
#
  @commands.slash_command(name="embed", description="Sends a nice looking customisable embed", guild_ids=[guild_id])
    async def sendembed(self, ctx, title: str, content: str):

This doesn't work, any idea?

sage birch
#
total_msg_count = 0
member_msg_count = 0
async for msg in ctx.channel.history(limit=None):
  total_msg_count += 1
  if msg.author == member:
    member_msg_count += 1
    if member_msg_count == amount:
      break
# ie: is there any way to do it without the code above?

await ctx.channel.purge(limit=total_msg_count, check=lambda message: message.author == member)
crimson coral
#

huh

sudden path
#

You can run checks on TextChannel.purge

slender lintel
sage birch
#

How would I make sure it only purges a specific amount of messages for a specific member?

crimson coral
#

ehhh

earnest rampart
#

can someone help me man