#discord-bots

1 messages · Page 493 of 1

slate swan
#

oh category channel

#

Yup

#

thanks

boreal ravine
#

how the hell dubai?

slate swan
boreal ravine
#

I miss changing server regions tbh

#

It was a good feature but It had no use except VCs and such

river walrus
slate swan
#

Don't ask in other channels to get help

#

If someone can help you they will

river walrus
#

Ok

balmy thicket
#

guys, i want to make kinda of an automatic message sender, but in this case is my account that will send the messages, how do i do it? the whole ideia is , every 3 hours a command is sent to a certain channel on my server

slate swan
#

!rule 2

unkempt canyonBOT
slate swan
#

Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.

#

If you want to keep your account, don't do that

#

And we won't help you for that either

balmy thicket
#

its on my private server, can that be a problem?

slate swan
#

It doesn't matter where you send it

#

Automating things on your account is overall not allowed

#

And I'm pretty sure farming currency, pokemons or similar things of bots using this way will get yourself banned from using the bot ever again

balmy thicket
#

sheit okk

#

thanks

river walrus
trail breach
#
    for chan in discord.guild.channels:
        await chan.set_permissions(role,send_messages=False)
    await ctx.channel.send("All channels have been paused pls wait...")```
#

The error ```AttributeError: module 'discord.guild' has no attribute 'channels'

spring flax
#

!d discord.Guild.channels

unkempt canyonBOT
spring flax
#

read this ^

trail breach
#

shows error

spring flax
#

you have to define guild

trail breach
#

i know of this

#

channel = await find_channel(member.guild)

#

?

spring flax
#

is that a command

trail breach
#

idk its on stack

spring flax
#

what

trail breach
#
@bot.command()
@commands.has_permissions(manage_channels=True)
async def unpause_all(ctx, guild : discord.Guild):
    role = discord.utils.get(ctx.guild.roles, name="new role")
    for chan in guild.channels:
        await chan.set_permissions(role,send_messages=True)
    await ctx.channel.send("All channels have been unpaused")```u meant this ri8?
spring flax
#

why are you doing guild : discord.Guild?

trail breach
#

to get list of channels(correct me if im wrong)

spring flax
#

just remove that arg and only keep ctx

#

and get the guild by doing ctx.guild

#

like how you did for the getting the role

trail breach
#

ok

#

it showsdiscord.ext.commands.errors.MissingRequiredArgument: guild is a required argument that is missing.

slate swan
#

did you remove the guild argument?

trail breach
#

yes

#
@bot.command()
@commands.has_permissions(manage_channels=True)
async def unpause_all(ctx):
    role = discord.utils.get(ctx.guild.roles, name="new role")
    channels = discord.utils.get(ctx.guild.roles)
    for chan in channels:
        await chan.set_permissions(role,send_messages=True)
    await ctx.channel.send("All channels have been unpaused")```
slate swan
#
@bot.command()
@commands.has_permissions(manage_channels=True)
async def unpause_all(ctx):
    role = discord.utils.get(ctx.guild.roles, name="new role")
    for chan in ctx.guild.channels:
        await chan.set_permissions(role,send_messages=True)
    await ctx.channel.send("All channels have been unpaused")
spring flax
#

you have not defined channel.

trail breach
sweet merlin
#

it sends me error:

listss = ['a', 'b', 'c']
if listss in message.content.lower():
trail breach
#

str(message.content).lower() maybe

slate swan
#

!e


string = 'apples'
listss = ['a','b','c']
if listss in string:
   print('error')```
#
import discord
from discord.ext import commands
from discord.utils import get

bot = commands.Bot(command_prefix="F!", intents=discord.Intents(messages=False, guilds=False))

@bot.command()
async def addcyberrole(ctx):
    print("1")
    member = ctx.message.author
    if member.id == "550322163190857729":
        print("2")
        role = get(member.server.roles, name=":space_invader:Cyber-General:space_invader:")
        await bot.add_roles(member, role)
        print("3")
    else:
        await ctx.send("nope")


bot.run(token)```
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: 'in <string>' requires string as left operand, not list
slate swan
#

it doesnt respond smh

slate swan
slate swan
slate swan
#

not even 1

#

it has perms to write in the channel btw

slate swan
#

did you copy this from somewhere ?

#

from the Documentation

#

btw my bot is verified and yet not accepted for intents

slate swan
boreal ravine
#

Never knew that was a thing.

slate swan
#
@Cog.listener()
    async def on_message(self, ctx):
        if ctx.content == ("b!setup"):
                        for channel in ctx.guild.channels:
                if channel.name == 'logs':
                                        await ctx.channel.send('Logs have already been set up')
                                        return
            channel = await ctx.guild.create_text_channel('logs')
            for channel in ctx.guild.channels:
                if channel.name == 'logs':
                                        self.log_channel = self.bot.get_channel(channel)
                                        await ctx.channel.send("logs have been set")

so guys i have this problem setting up logs if i type this in two servers then its setting up the id to the other server and the logs are only going to the other servers channel is there any way to store the ids and then check the guild to see if the id matches with the server the logs have been set up

boreal ravine
#

use discord.ext.commands

slate swan
#

ik ik dw

#

but how do i set the ids

#

for differennt srvs

slate swan
lament mesa
#

use a dict

#

or better a db

slate swan
#

what about a json file

boreal ravine
boreal ravine
slate swan
#

hmmm

#

idk how to fix that

lament mesa
#

fix what?

slate swan
#

nothing just my code

#

to make it set the channel ids for different servers

lament mesa
#

use a dict or a database

slate swan
#

hmm

sage otter
#

why would they put it in cache tho? That flushes everytime the bot shuts down or restarts.

#

db is the best choice here 👌

jagged wigeon
#

hey

#

can anyone help me with a join commnd?

#

i want my bot to join the vc

#

not to play music or someting, just to join

slate swan
#

await ctx.author.voice.channel.connect()

jagged wigeon
#

thx

#

why doesnt it works?

jade jolt
#

wdym

#

any error?

jagged wigeon
#

it doesnt join

jagged wigeon
boreal ravine
jade jolt
#

^

#

and if you use 2.0 its pip install .[voice] iirc

jagged wigeon
jagged wigeon
boreal ravine
jade jolt
#

yeah

hushed mural
#

any idea how do you make your command accept multiple arguments with spaces?

jagged wigeon
#

yes

#

wait 2 sec

jagged wigeon
jade jolt
#

no

winter valve
sage otter
#

That’s not what he wants

jagged wigeon
#

not ike that?

sage otter
#

are you asking how to multiple (*, arg)s?

boreal ravine
#

Like (ctx, arg1, arg2)

winter valve
#

I think

boreal ravine
jagged wigeon
boreal ravine
jagged wigeon
#

no

#

it just dont join

boreal ravine
#

Are u in a vc?
Did u install it properly?

jagged wigeon
jade jolt
#

is the command even being invoked

jagged wigeon
jagged wigeon
jade jolt
#

add a print statement to it

jagged wigeon
#

ok

#

before it? or after?

#

oh yea after

jade jolt
#

before

jagged wigeon
#

huh?

jade jolt
#

and after

jagged wigeon
#

ok

boreal ravine
#

after the :

jade jolt
#

ofc

#

could do it as a typehint

boreal ravine
#

lol

hushed mural
jade jolt
#

itll work

boreal ravine
#

then it'll use a2

jagged wigeon
boreal ravine
jagged wigeon
#

but doesnt join

jagged wigeon
jade jolt
#

ooof

boreal ravine
lament mesa
hushed mural
#

like, can we do $command "first argument" "second Argument"

jagged wigeon
boreal ravine
#

uh arg1:str and arg2:str then try to do .test "Arg 1" "Arg 2

boreal ravine
jagged wigeon
#

no

hushed mural
#

lemme try that

jagged wigeon
#

do i need to do smth here?

boreal ravine
#

try it ig

lament mesa
slate swan
#

you can do this there

jagged wigeon
#

so what can i do for the join command to work

boreal ravine
#

o.o

jagged wigeon
#

wattt?

#

now what

boreal ravine
#

is there really no error

lament mesa
# jagged wigeon

you dont need the presence intents for the bot to join voice channels

#

no errors?

jagged wigeon
jagged wigeon
#

look

lament mesa
jagged wigeon
#

a what?

boreal ravine
#

error handling

jagged wigeon
#

idk whats that

boreal ravine
lament mesa
#

on_command_error event

jagged wigeon
#

hmm

#

i think i have

boreal ravine
#
Error Comes => Error Handler Helps With The Error
jagged wigeon
#

this?

boreal ravine
#

yes

jagged wigeon
#

ok

#

i have

boreal ravine
lament mesa
jagged wigeon
#

hmm

#

where do i put it

boreal ravine
jagged wigeon
#

on the top/bottom?

jagged wigeon
boreal ravine
#

!d discord.ext.commands.CheckFailure

jagged wigeon
#

do i delete it?

unkempt canyonBOT
#

exception discord.ext.commands.CheckFailure(message=None, *args)```
Exception raised when the predicates in [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks") have failed.

This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError")
lament mesa
lament mesa
boreal ravine
#

I just have an error handler that sends all the errors

jagged wigeon
#

man man

#

i deleted it, let me send you the error

boreal ravine
jagged wigeon
#

what?

boreal ravine
#

do pip install discord.py[voice]

lament mesa
#

install PyNaCl

jagged wigeon
#

is it easy?

boreal ravine
#

yes

#

brb

jagged wigeon
boreal ravine
jagged wigeon
#

look

boreal ravine
#

what

jagged wigeon
boreal ravine
jagged wigeon
#

i think

boreal ravine
jagged wigeon
#

pip install PyNaCl

#

2 sec i am upgrading it

boreal ravine
#

ok

jagged wigeon
#

so

#

i upgraded

#

i installed pynanci and pip install discord.py[voice]

boreal ravine
#

hm

jagged wigeon
#

omgggg

#

it joined

#

thxxx

#

@boreal ravine

boreal ravine
#

np

jagged wigeon
#

i think i can make it play somethin

#

but i dont need help

slate swan
#

with ytdl?

#

pr

river kindle
#

guys how do i use if command in discord.py?
now I'm trying but the bot doesn't give an answer if I try to use "if"

boreal ravine
#

give more context pls

river kindle
#

eg
i mean if the question that is sent
and a right answer is given, I want to give it the "if" function so if that question gets the right answer the bot sends the message that they are correct

ionic path
ionic path
#

yes

boreal ravine
#

are those allowed

ionic path
boreal ravine
boreal ravine
ionic path
boreal ravine
hasty iron
river kindle
#

tysm now i need to go i try later

hasty iron
#

like no way im trusting links like that

ionic path
ionic path
fading harness
rare saddle
#

What means - Discord Shards ?

hasty iron
boreal ravine
slate swan
jagged wigeon
boreal ravine
rare saddle
jagged wigeon
#

i asked for a suggest command 10 days ago

fading harness
boreal ravine
# rare saddle

Sharding is the method by which a bot's code is "split" into multiple instances of itself. When a bot is sharded, each shard handles only a certain percentage of all the guilds the bot is on. You do not need to worry about sharding until your bot hits around 2,400 guilds. ...

slate swan
boreal ravine
slate swan
hasty iron
#

multi server isnt hard either

boreal ravine
hasty iron
#

yes

boreal ravine
#

it's command_error

ionic path
#

lazy error handler

slate swan
ionic path
boreal ravine
#

Does it work?

ionic path
#

it works for me

boreal ravine
#

o ok

boreal ravine
hasty iron
#

why are you using the async branch

ionic path
#

every event uses on_ in the start on the async branch I think

ionic path
hasty iron
#

so you dont have intents

valid perch
#

Well thats a first, II aint seen async in yoinks. Not likely it doenst support anything new you kinda want / need going forward. Plus its nicer imo, feels better with oop

solemn rock
#

on_

ionic path
#

I made this command that changes the color everytim

    @commands.command()
    async def ping(self, ctx):
        a = "012356789abcdef"
        p = ""
        for i in range(6):
            p += random.choice(a)
        print(p)
        color = turninto(f"0x{p}")
        msg = await ctx.send(
            embed = discord.Embed(
                title=":hourglass: Latency/Ping",
                description=f"Ping\n\n`{int(self.client.latency*1000)}ms`\n`{str(self.client.latency)[:-10]}s`",
                color=color
            )
        )
        for e in range(50):
            color = 0x0
            p = ""
            for i in range(6):
                p += random.choice(a)
            color = turninto(f"0x{p}")
            await msg.edit(
                embed = discord.Embed(
                    title=":hourglass: Latency/Ping",
                    description=f"Ping\n\n`{int(self.client.latency*1000)}ms`\n`{str(self.client.latency)[:-10]}s`",
                    color=color
                )
            )
#

I meant oops for deleting the orhter message lol

#

not this one, I'm just showcasing my rainbot command

#

:P

slate swan
#
role_made_on = role.created_at.timestamp()
role_made_on_1 = int(role_made_on)
--
Created on: f"<t:{role_made_on_1}>"
```Any idea why this actually returns the incorrect time of the role being made for my region? I did the same thing with member.created and it works fine.
ionic path
ionic path
#

Its kinda fun using it

slate swan
#

!voiceverify

hasty iron
#

so you admit to spamming the api

#

nice

ionic path
#

it just looks cool I think

#

I don't do programming for illegal things I just use it to enjoy my crappy life :P

slate swan
#

it's not a good or smart or thing to do

ionic path
slate swan
#

i don't know why it "looks cool"

#

wow

ionic path
slate swan
#

blanket you have any idea on how to help?

hasty iron
#

idea for what

slate swan
#

doesn't discord format adjust to your region?

hasty iron
#

thats just a standard

ionic path
hasty iron
#

wait

#

oh you're talking about the discord timetsmap

slate swan
#

yeah

hasty iron
#

well idk, havent used them

ionic path
#

I use datetime module

ionic path
bitter depot
unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied warning to @ionic path.

ionic path
#

sorry

ionic path
#

@slate swan I found this on the discord developer portal documentations

#

I think you can use this

slate swan
#

wow not there

#

.timestamp() returns what you showed

ionic path
#

hm

drifting arrow
#

Hey, how can I check if a message sent contains an image?

ionic path
drifting arrow
# ionic path I found this https://stackoverflow.com/questions/66858220/how-do-you-get-the-ima...
    @commands.Cog.listener()
    async def on_message(self, ctx):
        isbot = ctx.author.bot
        if isbot == False:
            messagecontent = ctx.content
            messageattachments = ctx.attachments
            if not messagecontent:
                await ctx.channel.send("Please attach some text.")
            else:
                await ctx.channel.send(f"Message content: {messagecontent}")
            if not messageattachments:
                await ctx.channel.send("Please attach an image.")
            else:
                await ctx.channel.send(f"Message content: {messageattachments}")
``` This is what I ended up with
slate swan
#

yes

boreal ravine
slate swan
#

yes that

boreal ravine
#

created_at.timestamp returns a unix code which you can convert to a timestamp

slate swan
#

yes..

#

didn't i do that

boreal ravine
#

yes, you did

slate swan
#

the time it gives isn't correct though

boreal ravine
high pollen
#

Hi

#

I need help. My Bot is not working

slate swan
#

state your issue.

high pollen
#

I dont know what is wrong

boreal ravine
#

hm

high pollen
#

My code got deleted

#

Bruh

hasty iron
#

deleted?

high pollen
#

ye

#

twice

high pollen
slate swan
#

Read rule 6 then, if it's false, contact the staff

high pollen
#

it is false

#

which channel?

slate swan
#

@novel apex

high pollen
#

ok

hasty iron
unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

boreal ravine
high pollen
#

not it

#

my code has a role name

#

so it deleted it

#

This is my code

from discord import client
from discord.ext import commands

client = discord.Client()

@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.do_not_disturb)
    print("BOT IS READY")

@client.event
async def on_raw_reaction_add(payload):
    message_id = payload.message_id
    # print(message_id)
    if message_id == 890452739048497222:
        guild_id = payload.guild_id
        guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds)
        # print(guild_id)
        # print(guild)
        # print(payload.emoji.name)

        if payload.emoji.name == ":white_check_mark:":
            role = discord.utils.get(guild.roles, name = role_name) # role_name is defined just that i can not paste it here as deletes it
            # print(role)

            if role is not None:
                member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
                print(member)
                if member is not None:
                    await member.add_roles(role)
                    print("Verified")
                else:
                    print("Member not found")
            else:
                print("Role not found")

client.run(tocken)```
leaden anvil
#

whats the problem ?

high pollen
#

it returns member as None

#

always

leaden anvil
high pollen
#

end of the code

high pollen
#

member is always None

#

everything else works

slate swan
#

I was trying to create a hosting script to host multiple bots online and i have the script done its running nicely but it just logs 1 bot & stops loggin anyone help ?

leaden anvil
slate swan
little ether
hasty iron
#

client.run is a blocking call

#

you need to use loop.create_task and client.start

hasty iron
#

and then at the end loop.run_forever so it runs the tasks

high pollen
leaden anvil
slate swan
#

Umm

hasty iron
slate swan
#

Ok

leaden anvil
high pollen
leaden anvil
#

n/y

high pollen
#

trying

leaden anvil
#

just copy past the code at the beginning

high pollen
#

ye

#

again error

leaden anvil
high pollen
#

I will reset tocken later

#

cuz error has tocken

upbeat otter
#

Guys, is there a way to get the hexcode of the top-most role of the message author

upbeat otter
high pollen
little ether
hasty iron
#

oh you mean color?

boreal ravine
upbeat otter
boreal ravine
upbeat otter
leaden anvil
high pollen
upbeat otter
high pollen
upbeat otter
leaden anvil
# high pollen what do you mean?

It tells you in the error.
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.

Go to the developer's portal and enable intents.

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.

boreal ravine
upbeat otter
upbeat otter
boreal ravine
leaden anvil
hasty iron
leaden anvil
hasty iron
#

it returns the hex code

boreal ravine
upbeat otter
hasty iron
#

ctx.author.top_role.color returns Color

high pollen
hasty iron
#

casting str on it returns the hex

#
    def __str__(self) -> str:
        return f'#{self.value:0>6x}'
        .. describe:: str(x)
             Returns the hex format for the colour.
leaden anvil
boreal ravine
upbeat otter
#

@boreal ravine im really sorry 😭

upbeat otter
high pollen
boreal ravine
leaden anvil
high pollen
#

same error

slate swan
high pollen
leaden anvil
#

How to disable button after clicking it ? btw using discord_buttons_plugin and I know that discord has a build in button event handler but, well its just my preference

leaden anvil
high pollen
#

testing

leaden anvil
#

ok

high pollen
#

gg

#

ty

#

works

high pollen
#

is there a way to vouch or anything?

slate swan
#

nope

#

it works now, i just rewrote it in another project

leaden anvil
leaden anvil
# maiden fable button.disabled = True

here is the code: ```py
@Buttons.click
async def y (ctx):
send=discord.Embed(color=0x51ed87)
send.add_field(name="Action Confirmed", value="Report successfully sent.")
await ctx.message.edit(embed=send)

@Buttons.click
async def n (ctx):
discard=discord.Embed(color=0xed4245)
discard.add_field(name="Action Failed", value="Report discarded")
await ctx.message.edit(embed=discard)```

slate swan
hasty iron
#

oh its a selfbot

#

!rule 5

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

maiden fable
slate swan
#

@hasty iron i aint doing anything wrong dont worry

#

I know rules very we)l

hasty iron
#

its a selfbot

slate swan
#

Ik it is

hasty iron
#

self-bots are against ToS no matter what you do

slate swan
#

Cuz i was curious to try something new

hasty iron
#

ok then try it but you're getting no help here

leaden anvil
slate swan
leaden anvil
hasty iron
#

you asked about a self-bot and now you switched your same question to normal bots

maiden fable
leaden anvil
ocean leaf
#

is json good for making levelling bot?

drifting arrow
ocean leaf
#

i am using replit

drifting arrow
#

im using aiosqlite

ocean leaf
#

is it possible to use aiosqlite with replit?

drifting arrow
#

dunno

ocean leaf
#

any other db

#

btw

#

i have an idea to make levelling bot without db

full lily
#

why do people use replit? Like just use an ide on your own machine

full lily
vestal owl
#

create_role() takes 1 positional argument but 2 were given

vestal owl
#

I only have 1 argument though?

ocean leaf
# full lily why on earth would you want this

i will send the current level and exp in a channel of discord. the message will be edited every time the user level up. there will be a seperate message for every user. when the user will type >level, it will find the message for the user from the channel and get his/her level? how about this/

hasty iron
hasty iron
#

!d discord.Guild.create_role

unkempt canyonBOT
#

await create_role(*, name=..., permissions=..., color=..., colour=..., hoist=..., mentionable=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") for the guild.

All fields are optional.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to do this.

Changed in version 1.6: Can now pass `int` to `colour` keyword-only parameter.
ocean leaf
hasty iron
#

self gets implicitly passed in, thats why it says 2

ocean leaf
#

any db to use in replit?

full lily
#

practically, I mean

vestal owl
ocean leaf
#

what is the best db to use in replit?

hasty iron
#

so name=name

ocean leaf
#

also i don't want it to charge me money after going link 2 mb

hasty iron
#

your best solution rn is to not use replit

ocean leaf
#

and where?

hasty iron
#

self host it, buy a vps or a raspberry

ocean leaf
#

so i have to "buy"?

kindred epoch
#

yes

ocean leaf
#

hmmmm

boreal ravine
ocean leaf
boreal ravine
#

if I buy hacker plan can I use replit..?

hasty iron
#

replit is not for bot hosting

ocean leaf
#

ik

#

but i thought it is the only free host

hasty iron
#

its not a host

ocean leaf
#

using uptime robot

hasty iron
#

thats not a host either

kindred epoch
#

uptime robot is not a host

ocean leaf
#

and the replit web viewer

kindred epoch
#

its a thing that pings a website every some minutes

hasty iron
#

that isnt a host either

ocean leaf
boreal ravine
hasty iron
#

still not a host

ocean leaf
#

it is really a glitch

kindred epoch
#

im using vultr and it works perfectly fine

boreal ravine
boreal ravine
kindred epoch
#

vps

boreal ravine
#

hm

broken igloo
#

Hello! How to localize discord bot using gettext?

slate swan
#

pls tell

ocean leaf
#

any free wps?

kindred epoch
ocean leaf
#

ok i'll will buy raspberry

kindred epoch
#

unless you get the aws vps which is only 1 year free

hasty iron
#

imo dont

#

raspberry costs more overall

boreal ravine
unkempt canyonBOT
#
Not in a million years.

No documentation found for the requested symbol.

boreal ravine
#

doesnt exist

ocean leaf
hasty iron
#

internet + electricity + initial price

#
  • more stuff more for it
hasty iron
#

will cost more than a vps

kindred epoch
#

^

ocean leaf
boreal ravine
#

stop pls @slate swan

ocean leaf
#

stop it

slate swan
#

@ocean leaf will u help

boreal ravine
#

hm

slate swan
boreal ravine
ocean leaf
slate swan
#

@boreal ravine anti nuke bot

boreal ravine
slate swan
#

@boreal ravine i need on emoji create for anti raid bot

ocean leaf
boreal ravine
hasty iron
#

!d discord.on_guild_emojis_update

unkempt canyonBOT
#

discord.on_guild_emojis_update(guild, before, after)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") adds or removes [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

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

there is this

boreal ravine
pliant gulch
hasty iron
slate swan
#

@boreal ravine hm

boreal ravine
#

well RTFM

pliant gulch
ocean leaf
slate swan
pliant gulch
#

Very smart

slate swan
#

lmao yes

vestal owl
# hasty iron will cost more than a vps
@bot.event
            async def on_raw_reaction_add(payload, *, name):
                message_id = rct_msg.id
                if message_id == payload.message_id:
                    member = payload.member
                    guild = member.guild
                    emoji = payload.emoji.name
                    if emoji == '👍':
                        member_id = member.id
                        member_id = str(member_id)
                        registered = reg_user.append(member_id)
                        user = ctx.message.author
                        role = await ctx.guild.create_role(name=name)
                        await user.add_roles(role)
                        print('Role created')```
pliant gulch
#

I meant to reply to your message but no it isn't smart I was joking

slate swan
#

how do i make an alt detector command :o?

hasty iron
vestal owl
slate swan
pliant gulch
#

Your best bet is to check for young accounts

slate swan
#

ban

hasty iron
#

check Member.created_at

ocean leaf
hasty iron
#

returns a datetime.datetime obj

kindred epoch
pliant gulch
#

Wps???

ocean leaf
hasty iron
#

LOL

ocean leaf
#

yes i need a wps

pliant gulch
#

It's VPS

slate swan
#

i would need a code

ocean leaf
#

no

kindred epoch
#

😂

pliant gulch
#

:loading:

hasty iron
#

andy can you try making slash commands over http and see if it works for you

slate swan
#

f

ocean leaf
hasty iron
#

discord just refuses to send the message

pliant gulch
hasty iron
#

ok

ocean leaf
#

any wps u know?

pliant gulch
#

I already have an idea of what to do though

ocean leaf
#

pls gimme link

kindred epoch
#

@ocean leaf you do realize we are trying to help you but you're just not listening?

hasty iron
#

ive read that global commands take 1 hour

#

so i tried guild commands

pliant gulch
#

Could take up to

hasty iron
#

and still ddidnt work

slate swan
pliant gulch
#

I'm guessing it's due to cache

#

Blanket what is not working for you exactly?

hasty iron
#

discord

ocean leaf
#

gcp is still cloud

hasty iron
#

the 200 actually gets sent

#

discord doesnt want to send the message

slate swan
pliant gulch
#

Ahh I see

#

I will try later

hasty iron
#

if i do it through the endpoint it works ok

pliant gulch
#

Do you need to give it an interaction token or smthg??

ocean leaf
hasty iron
#

no

#

you just return a json

pliant gulch
#

Nvm that won't be the problwm

broken igloo
pliant gulch
#

Its a 200 status

slate swan
hasty iron
#

so i can fix it but its cheesy

#

i can have a respond function

#

i tried it earlier

#

but somehow the response doesnt get sent

#

if i do it

tiny ibex
#

I don't have any coding problem but something else related to discord bots can I ask?

pliant gulch
hasty iron
#

the cheesy way is calling the reply endpoint

#

the docs said use it if you're using the gateway

#

but eh

#

i can setup a quick commands system

pliant gulch
tiny ibex
# kindred epoch go ahead

Actually my bot uses the name and pfp from some anime and I am afraid it it's some copyright violation. So can you tell me if it is?

hasty iron
tiny ibex
kindred epoch
pliant gulch
tiny ibex
#

Ty

broken igloo
#

How to localize discord bot using gettext? Help please

lucid stream
#

bros is replit down?

#

?

hasty iron
#

doesnt seem like it

brazen seal
#

How i can do - if player add emoji to this message bot editing message for example Test

hasty iron
#

!d discord.Client.wait_for

unkempt canyonBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
hasty iron
#

there is an example for reactions

brazen seal
#

hm

stone palm
#

okay so dpy2 is rly difficult

#

how do i create a menu that is made after using a command?

broken igloo
stone palm
#

it adds options based on the args the author provides

hasty iron
#

!d discord.ui.View.add_item

unkempt canyonBOT
hasty iron
#

subclass a select

#

and make it take args

#

and add it to a view

stone palm
#

i need to learn subclasses then pithink

#

any examples anywhere?

upbeat otter
#

guys, I don't want to put the value field in an embed, what do i do?

info.add_field(name=f"NAME: {name}", inline=False)
hasty iron
stone palm
#

wasnt that a nested class

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1632499096:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

upbeat otter
stone palm
#

that was my first time using a menu lol

hasty iron
stone palm
#

oh

hasty iron
stone palm
#

i see, lemme refer to it then

upbeat otter
upbeat otter
hasty iron
#

yes

stone palm
#

so Select was the discord.ui.select class
SeectView was the discord.view class which added the menu into the view
is that what youre talking about? the second class which added the menu to the view

upbeat otter
#

thankuu

#

so much

slate swan
#

Hey, Python bot aka @unkempt canyon seems interesting.
Is it possible to get this bot in my server??
So that My friends can use it

stone palm
bitter depot
bitter depot
#

!source

unkempt canyonBOT
stone palm
#

I mean, yes

maiden fable
#

pithink slowmode

bitter depot
#

You can host it yourself with the correct config etc., but there isn't an actual invite link if that's what you're after @slate swan

upbeat otter
#

this displays the value too

info.add_field(name=f"NAME: {name}", value="U+200B", inline=False)
stone palm
#

Do any of the bots here use ui.select yet?

maiden fable
stone palm
#

hmm

maiden fable
#

If u r talking about PyDis bots ^^^

stone palm
#

yes

upbeat otter
#

how do i set the value of value field in an embed to None 🥲

stone palm
#

how do i add options into a menu based on the args a user provides? i thought the class has to be outside the cog class... so how is it possible to access the users args in that case?

hasty iron
#

i told you

#

subclass and overload the init to take arguments

#

pass those arguments in and use them

stone palm
#

oh

#

hmmmmmm

upbeat otter
simple umbra
#

Can I apply a condition to an entire cog?

#

Like the required roles or is-owner ones

slate swan
#

for a command? yea override cog_check in your cog class

simple umbra
#

or if you could tell where I would find it in the docs I can read that

slate swan
#

!d discord.ext.commands.Cog.cog_check

unkempt canyonBOT
#

cog_check(ctx)```
A special method that registers as a [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") for every command and subcommand in this cog.

This function **can** be a coroutine and must take a sole parameter, `ctx`, to represent the [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context").
slate swan
#

just override this method in your cog class and return True/False like a regular check

simple umbra
#

Ok thanks 👍

warped bronze
#

How would I make a bot recognize when a message has a certain keyword and then have it react to that message (with a custom emoji but I have the part figured out)?

#

I tried

@bot.event
async def on_message(message):
     if 'key' in message.content:
          emoji = '<:emojiname:1234'>
          await message.add_reaction(emoji)
slate swan
#

must be emoji = ':emojiname:1234'

warped bronze
#

Except message isnt working and when I put intents.messages = true it stopped everything from working

slate swan
#

ooof discord markdown

warped bronze
#

Wait hold on

#

I just deleted everything and hit ctrl z, it works now

slate swan
#
# so its something like this 
emoji = "<:emojiname:emojiid>"```
#

you had your > outside the string which may have caused an error

warped bronze
#

Oh yeah

#

Thanks

#

Now it stops recognizing commands after reacting to the keyword and doesnt give any error but I'll come back later, I'm gonna stop working on this for a few hours

slate swan
#

use this coroutine at the last of your on_message event

warped bronze
#

I will try that when I get back to it. The ('message') is exactly that? Or i replace it with the keyword?

slate swan
#

nah , just add py await bot.process_command(message) at the end of your on_message event

slate swan
#

oh ye

#
@bot.command()
async def config_muterole(ctx):
    try:
        guild = ctx.guild
        permissions = discord.Permissions()

        await guild.create_role(name='muted')
        role = discord.utils.get(guild.roles,name="muted")

        for guild in bot.guilds:
            for channel in guild.channels:
                if str(channel.type) == 'text':
                    await channel.set_permissions(role, send_messages = False)

    except Exception as e:
        embedVar = discord.Embed(title="Error;", color=0x2C5ED1)
        embedVar.add_field(name="** **", value=str(traceback.format_exc()), inline=False)
        embed = await ctx.send(embed=embedVar)

The error I'm getting here is:
404 Not Found: unknown overwrite

#

Can't figure out what's wrong, can anyone help?

spring flax
#

wth

spring flax
slate swan
#
@bot.event
async def on_raw_reaction_remove(payload):
  message_id = payload.message_id
  if message_id == 891002171397636137:
    guild_id = payload.guild_id
    guild = discord.utils.find(lambda g : g.id == guild_id , bot.guilds)

    if payload.emoji.name == 'white_check_mark':
      print("yay")
    else:
      role = discord.utils.get(guild.roles,name = 'Verified')

    if role is not None:
      member = discord.utils.find(lambda m : m.id == payload.member.id , guild.members)
      
      if member is not None:
        await member.remove_roles(role)
        print("done")
      else:
        print("member not found")
    else:
      print("role not found")```
stone palm
#

I have this class outside of my cog
how do I use it with variables provided on command inside the cog?```py
class CustomMenu(discord.ui.Select):
def init(self):
super().init(
custom_id="CustomMenu",
placeholder="Select options"
)

slate swan
stone palm
slate swan
# slate swan ```py @bot.event async def on_raw_reaction_remove(payload): message_id = paylo...

i use this for remove reaction role but

Ignoring exception in on_raw_reaction_remove
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 84, in on_raw_reaction_remove
    member = discord.utils.find(lambda m : m.id == payload.member.id , guild.members)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/utils.py", line 225, in find
    if predicate(element):
  File "main.py", line 84, in <lambda>
    member = discord.utils.find(lambda m : m.id == payload.member.id , guild.members)
AttributeError: 'NoneType' object has no attribute 'id'```
slate swan
#

help....

spring flax
#

what i was saying is that your bot will be ratelimited

slate swan
slate swan
#

ok

spring flax
#

no

slate swan
#

oh nvm there is

stone palm
#

I have this class outside of my cog
how do I use it with variables provided on command inside the cog?```py
class CustomMenu(discord.ui.Select):
def init(self):
super().init(
custom_id="CustomMenu",
placeholder="Select options"
)

I'm gonna determine the max and min values and also the placeholder based on the data i get from the command
slate swan
#

I'm not too worried about ratelimits, I just wanna know what my error is about lol

primal mist
#

Im trying to make a bot for a game I put called madfut 21. I want people to be able to type .buy (player name) and then it sends it to a channel only I can see. How do I do this?

hasty iron
#

use get_channel

#

!d discord.Client.get_channel

unkempt canyonBOT
hasty iron
#

and then channel.send

spring flax
#

not worried about that...?

slate swan
spring flax
#

setting channel permissions has high ratelimits, and you want to change all text channels for all guilds the bot is in

slate swan
#

and in your CustomMenu you should have some func that fills in the options

#

as well as set the placeholder and everything else

stone palm
hasty iron
#

as i said, just add the arguments into the init

slate swan
#

e.g:

class MyMenu(discord.ui.Select):
  def __init__(self, placeholder, min_vals, max_vals, options):
    super().__init__(placeholder=placeholder, min_values=min_vals, max_values=max_val)
    self.options = options
    self.fill_options()

  def fill_options(self):
    for option in options: # Make sure that ``options`` is a list
      self.add_option(label='...')

class View(discord.ui.View):
  def __init__(self, placeholder, min_vals, max_vals, options):
    super().__init__()
    self.add_item(MyMenu(placeholder, min_vals, max_vals, options))

# From here you do however you like
stone palm
#

oh

#

thank you

stone palm
#

SelectOption.label?

ionic wadi
#

discord.errors.ClientException: Callback for beg command is missing "ctx" parameter.

I get this error In one of my cogs,
Online I see I have to use self, ctx. But I never had to do that to make my commands work. Why do I get this error?

#

What does this error mean*

slate swan
hasty iron
#

your command is missing the ctx argument

ionic wadi
#

But like, I have the ctx argument...

hasty iron
#

then you dont have self

ionic wadi
#

But I never have to use self anywhere In a cog for my commands to work. And while using self I dont get error or output

hasty iron
#

what...

#

self is required inside classes

#

there is now it didnt require it

slate swan
#

a cog is a class, self is a required param

ionic wadi
#

But why Is It required as without It most commands work too. And my vscode doesnt output error or output when using self

slate swan
#

for every method inside your class (cog)

hasty iron
#

imagine we have async def command(ctx, arg)

ionic wadi
hasty iron
#

self would be ctx and arg would be ctx

slate swan
#

^

vagrant galleon
#

how do i make a discord bot embed something in a channel

stone palm
#

hmmmm

slate swan
unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

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

And It doesnt give me an error

rain bolt
#

Hello, I found an option selection command from YouTube and the intreaction gives an error. What should I do?

vagrant galleon
hasty iron
stone palm
#

🤔 whats the part that comes under the command

ionic wadi
hasty iron
#

send the cog where you supposedly dont have self

slate swan
vagrant galleon
ionic wadi
vagrant galleon
#

ctx.channel.send?

slate swan
unkempt canyonBOT
#

Hey @rain bolt!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

ionic wadi
#

Yeah Its template code, but Im helping someone else with it

stone palm
stone palm
#

hmmmm

vagrant galleon
#

dude why is it sending that

slate swan
#

it's really just so it looks nicer in my opinion

vagrant galleon
#

that is literally not in my code

stone palm
#

super().__init__(placeholder=placeholder, min_values=min_vals, max_values=max_val) and are these the variables for it?

vagrant galleon
#
            embed.set_author(name="Point")
            embed.timestamp = datetime.datetime.utcnow()
            await ctx.send(embed == embed)```
slate swan
# vagrant galleon

then you defo have your bot sending True or maybe you are checking for an equivalent between 2 things which returns True idk

slate swan
vagrant galleon
#

oh whoops

hasty iron
#

= is for assignment

stone palm
#

ah, i see

rain bolt
#

Hello, I found an option selection command from YouTube and the intreaction gives an error. What should I do?

hasty iron
#

import it

vagrant galleon
#

i deleted all my webhooks, yet its still sending one?

rain bolt
hasty iron
#

if you're on windows check task manager for python instances

vagrant galleon
#

ty ty ty

rain bolt
#

?

ionic wadi
#

Why If I use self, ctx in an cog. The hole command loses his function?

hasty iron
vagrant galleon
#

is there a way where i can say "click here" and it will open up the dms with the bot

#

so i dont have to right click to dm the bot

stone palm
slate swan
hasty iron
stone palm
#

yes, so options=[discord.SelectOption(label="Hello"), discord.SelectOption(label="Bye")]
isnt it?

hasty iron
slate swan
slate swan
#

how do i add a custom emoji if i wanna react to a message?

hasty iron
#

read the For emojis.. part

rain bolt
slate swan
#

@bot.event
async def on_message(message):
if bot.user.mentioned_in(message):
emoji = ''"
await message.add_reaction(emoji) its not working if i put the emoji thingy

hasty iron
#

emoji = ''" doesnt look like a valid emoji to me, looks like a syntax error

slate swan
#

so what should i do :3?

#

it works when i use a nirmal emoji

hasty iron
hasty iron
vagrant galleon
#

but how i do that

hasty iron
#

hyperlink it

vagrant galleon
#

ik whats the URL

slate swan
brazen seal
#

I did when player add emoji message edit to test and i don't know why embed there is it not is only test

hasty iron
hasty iron
slate swan
#

but idk how

hasty iron
#

''" doesnt seem like an emoji

#

did you even read what i linked

slate swan
#

yes

#

i had an emoji in it

vagrant galleon
slate swan
#

@bot.event
async def on_message(message):
if bot.user.mentioned_in(message):
emoji = ':W_:'
await message.add_reaction(emoji)

#

but it sends this

slate swan
hasty iron
#

is it animated

slate swan
#

no sir

hasty iron
#

ok so its not adding it to the message right?

slate swan
#

nope

hasty iron
#

does the bot have access to it?

slate swan
#

yes

hasty iron
#

try bot.get_emoji(<id>)

#

and print what it returns

slate swan
hasty iron
#

thats an error not a return value

#

send full traceback

brazen seal
#

I have another problem - how i can do 2 emoji and if player add one of two get another answer

#

because now it work for 🥳 emoji

#

only for this one

kindred epoch
#

do the same thing for other emoji

brazen seal
#

just a new function?

flat solstice
#

Is it possible to timestamp my bots creation date in it's status, like <t:1625014920:R> <t:{int(self.bot.created_at.timestamp())}:R>

hasty iron
#

bot.user.created_at

#

should work idk

flat solstice
#

okay thanks

brazen seal
kindred epoch
slate swan
flat solstice
#

okay thanks all

boreal ravine
stone palm
# slate swan perhaps, never used it that way

okay
so in the command its simply gonna be ```py
async def selecct(self, ctx):
placeholder="something"
max_val=0
min_val=2
options=[discord.SelectOption(label="something")]
MyMenu().fill_options(placeholder=placeholder, max_values=max_val, min_values=min_val)
view=View()
await ctx.send(".", view=View)

boreal ravine
#

@slate swan wow your the stella on the help command? O-o

slate swan
#

"stella on the help command" 😂

slate swan
boreal ravine
#

gg getting a tag on rdanny I guess

boreal ravine
boreal ravine
slate swan
slate swan
stone palm
stone palm
slate swan
#

if you're using the fill_options i gave you then that wouldn't work

#
async def selecct(self, ctx):
    placeholder="something"
    max_val=2
    min_val=0
    options=[discord.SelectOption(label="something")]
    view=View(placeholder, min_vals, max_vals, options)
    await ctx.send(".", view=View)
#

that will work

stone palm
#

ohh, i see

#

thank you very much

slate swan
#

yw

#
@bot.event
async def on_raw_reaction_add(payload):
  msg_id = payload.message_id

  with open("rr.json","r") as f:
    self_roles = json.load(f)

  if payload.member.bot:
    return

  if str(msg_id) in self_roles:
    emojis = []
    roles = []

    for emoji in self_roles[str(msg_id)]["emojis"]:
      emojis.append(emoji)

    for role in self_roles[str(msg_id)]["roles"]:
      roles.append(role)

    guild = bot.get_guild(payload.guild_id)

    for i in range(len(emojis)):
      choosed_emoji = str(payload.emoji)
      if choosed_emoji == emojis[i]:
        selected_role = roles[i]

        role = discord.utils.get(guild.roles,name=selected_role)

        await payload.member.add_roles(role)
        await payload.member.send(f"You got {selected_role} Role")```
#
Ignoring exception in on_raw_reaction_add
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 100, in on_raw_reaction_add
    await payload.member.add_roles(role)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/member.py", line 777, in add_roles
    await req(guild_id, user_id, role.id, reason=reason)
AttributeError: 'NoneType' object has no attribute 'id'```
#

why?

slate swan
#

your get() didn't find anything

#

hmm

normal jasper
#
@client.event
async def on_message(message):
    username = str(message.author).split('#')[0]
    user_message = str(message.content)
    channel = str(message.channel.name)
    print(f'{username} : {user_message} ({channel})')
    await client.process_commands(message)


@client.command()
async def help(ctx):
    embedVar = discord.Embed(title=f"✦Peachy Bot✦\n Help requested by {username}", description="This is a few commands you can use :", color=0x00ff00)
#
Ignoring exception in command help:
Traceback (most recent call last):
  File "C:\Users\Modarresan\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\Modarresan\Desktop\Peachy Bot\Peachy.py", line 45, in help
    embedVar = discord.Embed(title=f"✦Peachy Bot✦\n Help requested by {username}", description="This is a few commands you can use :", color=0x00ff00)
NameError: name 'message' is not defined

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

Traceback (most recent call last):
  File "C:\Users\Modarresan\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Modarresan\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Modarresan\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'message' is not defined
slate swan
#

nvm

normal jasper
slate swan
#

add py await ctx.send(embed=embed)

manic wing
normal jasper
manic wing
#

oh im blind

slate swan
normal jasper
manic wing
normal jasper
slate swan
#

that obviously will error

normal jasper
#

oh

slate swan
#

why are u doing it inside an event when ur doing a command

#

ur supposed to do it inside the command

normal jasper
#

oh im so stupid

#

why i didn't get it

slate swan
#

¯_(ツ)_/¯

normal jasper
#

before

normal jasper
slate swan
#

np

slate swan
#

how do I know

hasty iron
#

why not

normal jasper
# slate swan np
Traceback (most recent call last):
  File "C:\Users\Modarresan\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\Modarresan\Desktop\Peachy Bot\Peachy.py", line 45, in help
    username = str(message.author).split('#')[0]
NameError: name 'message' is not defined

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

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

now it gives this error