#discord-bots

1 messages · Page 716 of 1

drifting arrow
#

tbh i ignore everybody tells me not to ping people. I don't do it excessively and I do it for a reason and within reason

loud junco
#

@.everyone

#

:D

#

im an . away from ban

boreal ravine
#

pinging everyone wont get you banned

patent lark
loud junco
#

LOL

loud junco
#

it turned blue in my typing box

patent lark
#

do you know how discord works?

loud junco
#

u try

slate swan
#

it does . everytime

loud junco
#

:/

patent lark
#

type and send it. it turns blue always. but it doesn’t ping anyone

loud junco
#

i dun wanna press enter

#

i dun wanna die

slate swan
#

nothings gonna happen lol

patent lark
#

exactly

loud junco
#

:D

drifting arrow
#
seccd = round(name.get_cooldown_retry_after(ctx))
    mincd = 0
    hrcd = 0
    rseccd = 0
    rmincd = 0

    if seccd > 59:
        rseccd = seccd % 60
        mincd = (seccd - rseccd) / 60
        if mincd > 59:
            rmincd = mincd % 60
            hrcd = (mincd - rmincd) / 60

    if rseccd == 0 and rmincd == 0 and hrcd == 0:
      res += f':white_check_mark: {name}\n' 
    else:
      res += f':spinning_clock: {name}: **{hrcd}h {rmincd}m {rseccd}s**\n'
loud junco
#

lemme try

#

thanks

#

so its just indent error 🤣

drifting arrow
#

Na. i changed a few things.

#

Your indent might be set to 1 or 2 spaces while mines set to like 4 spaces

patent lark
simple gulch
#

I'm trying to code my discord bot and doing a if statement which should be simple 😕

  if errorcode != '1':
    print("does not equal")
    return
  else:
    print("does equal")
    return```
It always said it didn't equal so I figured I'd try the print the errorcode and it says the same thing (does not equal) whether error code is 0 or 1 😦
#

any help?

loud junco
#

why return

simple gulch
#

oh because I was trying to kill it if it went down that way

loud junco
#

oo ok

drifting arrow
#

return is the same as saying 'ignore everything else, yeet stuff back'

#

Just start yeeting

loud junco
#

:/

#

yeet the code

drifting arrow
#

Yes it's all it does

simple gulch
#

there is other commands that I'll be putting in there, I just made this simple to try to get it right to make sure

drifting arrow
#

yeet whatever you tell it to yeet.

simple gulch
#

any ideas?

slate swan
#

!d return

unkempt canyonBOT
#

7.6. The return statement


return_stmt ::=  "return" [expression_list]
``` [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) may only occur syntactically nested in a function definition, not within a nested class definition.

If an expression list is present, it is evaluated, else `None` is substituted.

[`return`](https://docs.python.org/3/reference/simple_stmts.html#return) leaves the current function call with the expression list (or `None`) as return value...
slate swan
#

thats what it does

drifting arrow
#

it's what I said. stops the function and yeets stuff back.

simple gulch
#

okay. return is not my question though? Unless that is breaking it?

drifting arrow
#

It's how I remember it.

#

return is breaking it.

#

using 'return' is the same as saying 'Hey, Can you please stop doing whatever you're doing and return this to whoever called you? kthnxbai'

patent lark
#

good example, but not always

drifting arrow
#

Well im still beginner and thats how I view it at the moment.

simple gulch
#

I've always used it as end this script at this point

drifting arrow
#

I am yet to find a use for the return other than returning values to whatever called the function.

loud junco
drifting arrow
#

Use break instead

loud junco
#

:/

#

then what for

patent lark
#

it can be used for more than throwing a value , it could be used to return to the function call after a certain condition if you

#

break will jump out of loops

simple gulch
#

but it shouldn't see any of that return if it is not equal to 1 right?

#

it should go to the else statement

drifting arrow
#

According to stackoverflow you can just specify return as a way of just stopping stuff 😮 so there is more than 1 use for return

slate swan
drifting arrow
#

I've always just used break /shrug

patent lark
drifting arrow
#

told you. beginner 😎

upbeat otter
#

oof

loud junco
#

eevee is back :/ after longgggg time

upbeat otter
#

How is this related to discord bots tho ;-;

slate swan
unkempt canyonBOT
slate swan
#

smh

simple gulch
#

that is the issue

upbeat otter
loud junco
upbeat otter
upbeat otter
unkempt canyonBOT
drifting arrow
patent lark
#

they clearly did

simple gulch
#

I did. I'm going to try getting rid of the quotes

drifting arrow
#

oh

loud junco
#

why indent

drifting arrow
#

?

loud junco
#

why indent

patent lark
#

don’t ask me . that’s not my code

upbeat otter
# patent lark

you can save 2 lines of code there tho, why use return in another line

simple gulch
#

getting rid of the quotes fixed it clappywappy

patent lark
simple gulch
loud junco
simple gulch
#

lol

slate swan
#

Can someone help me make a discord music bot?

loud junco
patent lark
#

the code would have kept running otherwise.

slate swan
loud junco
#

just ask here
those pro will help u

patent lark
#

i don’t think putting them in both scopes was necessary, but only one could come with purpose.

upbeat otter
patent lark
#

ah, i thought you meant “saving lines” as in completely removing the return statement

quaint epoch
#

huh

patent lark
#

i don’t think the moderate members permission is a thing in discord.py as it isn’t being maintained anymore thus missing updates from discord.

#

assuming that’s new , i haven’t been keeping tabs on that recently

delicate salmon
slate swan
#

this isnt yt smh

#

stop with these ads

patent lark
#

it’s a troll. give it no attention.

slate swan
#

for sure

#

currently uploading my project to pypi this will be fun

patent lark
#

nice , what’s your project?

slate swan
#

you know about discord.Color.blue() right

patent lark
#

mhm

slate swan
#

well my package is an extension of 1k colors no jk

patent lark
#

oh nice

#

lmao

slate swan
#

made a discord instance as well

patent lark
#

hope it goes well

slate swan
#

its called heximals and the discord one returns a int which would be 0xhex so i made another one that returns a str version of a bare hex code pretty nice

manic wing
#

anyone wanna see a sexy help command

slate swan
patent lark
slate swan
#

dm it

manic wing
patent lark
#

i think you’ve dm’d me your help command before

manic wing
#

new and improved

patent lark
#

bro that gif you sent just wasn’t it 😭

manic wing
#

remade it a couple days ago

manic wing
#

kinda misclicked ngl

patent lark
#

lmao

manic wing
#

i looked up sexy

patent lark
#

wasn’t the smartest idea to send it xd

slate swan
# manic wing https://github.com/CaedenPH/JesterBot/tree/main/cogs/helpcommand.py
 async def help(self, ctx: Context, command=None) -> None:
        if not command:
            embed = await self.utils.main_help_embed(ctx)
            return await ctx.send(embed=embed, view=DropdownView(self.data, ctx, self.utils))
     
        cmd = self.bot.get_command(command)
        if cmd:
            embed = await self.utils.specific_command(cmd, ctx)
            return await ctx.send(embed=embed)

        cog = await self.utils.get_cog_from_str(command)
        if cog:
            embed = await self.utils.specific_cog(cog, ctx)
            return await ctx.send(embed=embed)

        embed = await self.utils.no_command(ctx)
        return await ctx.send(embed=embed)

doesnt this return a embed?

manic wing
#

does what return an embed

slate swan
#

the botton

manic wing
#

what

slate swan
#

return await ctx.send(embed=embed)

#

async def help(self, ctx: Context, command=None) -> None:

manic wing
#

what about that

slate swan
#

doesnt the coro return an embed?

visual island
manic wing
slate swan
manic wing
slate swan
#

ik

#

ive read pep 484

#

guys wanna see a old command i made maybe 6months ago?

manic wing
#

ok

patent lark
#

sure

slate swan
#
@bot.command()
async def giveaway(ctx):
    j = input("giveaway reward/title:\n")
    u = input("whats the hosts name:\n")
    r = input("any more info like contacting info:\n")
    h = input("how much seconds for the giveaway to end(options:0s 1m 5m 30m 1h 24h ):\n")
    if h == "1m":
        await asyncio.sleep(60)
        print("1 m delay has been set")
    elif h == "5m":
        await asyncio.sleep(300)
        print("5m delay has been set")
    elif h == "30m":
        await asyncio.sleep(1800)
        print("30m delay has been set")
    elif h == "1h":
        await asyncio.sleep(3600)
        print("1h delay has been set")
    elif h == "24h":
        await asyncio.sleep(86400)
        print("24h delay has been set")
    else:
        print("0s delay has been set")

    embed = disnake.Embed(title=f"🎉{j}🎉",
                          description=f"the winner is:{random.choice(ctx.guild.members).mention}\nhosted by {u}\n {r}",
                          colour=0x3498db)
    g = await bot.get_channel(905616933905387531).send(embed=embed)
    print(f"{j} giveaway has been made")

this hurts my eyes now

#

😂

manic wing
#

input is very asynchronous, i might start recommending it

patent lark
#

LOL

slate swan
#

its horrible

#

ive learned allot ngl

#

makes me wanna cry how much i have😮‍💨🥲

manic wing
patent lark
#

oof

slate swan
#

your killing the moment

manic wing
#

oops

slate swan
#

😭

upbeat otter
patent lark
slate swan
#

only been 9months smh

slate swan
blazing lynx
#

"discord" is not accessedPylance Import "discord" could not be resolvedPylancereportMissingImports

patent lark
#

yes

upbeat otter
slate swan
manic wing
#

what was tha

patent lark
#

i read that

slate swan
#

😳

patent lark
#

kinda weird

manic wing
#

i read it but who sent it

#

my guess is okimi

patent lark
#

idk

manic wing
#

weird fucker

upbeat otter
#

And dont use dpy if you are starting on a new project, I'd recommend some other fork @blazing lynx

slate swan
silent portal
manic wing
#

okok apologies

blazing lynx
slate swan
silent portal
#

hellp

upbeat otter
slate swan
silent portal
#

OH

#

ty

#

<3

slate swan
#

🚶

upbeat otter
#

@slate swan coughs, hey idiot

manic wing
#

i didnt know the tag commands were a bunch of .mds

silent portal
#

I see the same ppl everytime

#

here in the chat

slate swan
manic wing
#

i added them in a secon

slate swan
upbeat otter
boreal ravine
manic wing
#

i went to resources

boreal ravine
#

o

manic wing
#

so technically

#

i cba to read the python bot code because its so fucking long and ott it gives you airborne cancer

slate swan
upbeat otter
#

coughs, your messages completely dont make sense now ;-;

manic wing
#

DISNAKE

upbeat otter
unkempt canyonBOT
slate swan
blazing lynx
slate swan
manic wing
#

im not the one who spends 7 hours coding in a row pithink

upbeat otter
slate swan
manic wing
#

i want my pull request

slate swan
boreal ravine
plain cloud
#

I suppose I will use discord.py until it will stop functioning…. Or one or two specific forks become the prominent one or two

unkempt canyonBOT
slate swan
#

im trying to publish my project in pypi smh

boreal ravine
slate swan
plain cloud
boreal ravine
manic wing
slate swan
boreal ravine
#

sad

slate swan
boreal ravine
#

@slate swan easy ```py

  1. python setup.py sdist
  2. pip install twine
  3. twine upload dist/*
#

🗿

boreal ravine
#

wut

slate swan
plain cloud
#

You did not just use that emoji

boreal ravine
#

thats how u upload to pypi

#

the easy way

slate swan
boreal ravine
plain cloud
pliant gulch
#

I literally package my whole wrapper to pypi via poetry build

hasty raptor
#

I need help with my discord bot I get this error message when I try to run it Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

blazing lynx
#
@bot.slash_command()
async def ping(inter):
    await inter.process.send_message("Pong!")
#

i used the example on docs

slate swan
blazing lynx
manic wing
#

man said python

honest vessel
#

pieton

hasty raptor
#

can someone plz explain

slate swan
blazing lynx
#
Traceback (most recent call last):
  File "/home/fazeexotic224/ZeroOne/bot.py", line 12, in <module>
    import exceptions
ModuleNotFoundError: No module named 'exceptions'
#

i tried using pip to install it and it said

#
fazeexotic224@penguin:~/ZeroOne$ sudo pip3 install exceptions
ERROR: Could not find a version that satisfies the requirement exceptions
ERROR: No matching distribution found for exceptions
#

anyone know?

slate swan
#

Why import exceptions?

slate swan
blazing lynx
# slate swan Why import exceptions?
@bot.event
async def on_slash_command_error(interaction: ApplicationCommandInteraction, error: Exception):
    if isinstance(error, exceptions.UserBlacklisted):
slate swan
#

You don't import it

#

Exception is an internal class

#

Oh you mean the isinstance

blazing lynx
#

issa folder

#

fixed it

#

it was caps error

slate swan
#

Can we not use more than 1 event?

#

my second event just doesnt work

cobalt jacinth
#

how can i add a timer

#

like a countdown timer that shows the countdown as s message.

slate swan
#

is it client.listen()?

#

Idk why but when i changed my client.event to client.listen() every single command and event started happening twice

slate swan
#

It's only for commands

#

edym

#

wdym

unkempt canyonBOT
#
Not in a million years.

No documentation found for the requested symbol.

slate swan
slate swan
#

You probably have process_commands inside the listener

#

That causes your commands to run twice

#

anyone know fix?

#

I'm sorry whats process_commands?

#

theres code

slate swan
#

await channel.send()

#

thanks

slate swan
#

if yes , see there you might have added it there

#

even the commands happening twice

#

🏃‍♀️

slate swan
# slate swan 🏃‍♀️

yep, as soon as I change from .event to .listen() everything in the code, including the commands start happening twice

slate swan
#

kk 1 sec

#

how do i make it so once they join it also sends a welcome card just like mee6?

slate swan
unkempt canyonBOT
slate swan
# slate swan Use pillow

Worked, but my other event still isnt working for some reason.
Here's the code:

@client.listen()
async def on_member_join(member):
  dm = await member.create.dm()
  await dm.send('Hello! Welcome to Jay\'s Server!')
blazing lynx
#

how to make a help command simular to dank memer? like "zo!help <category>"

slate swan
#

how do I connect a postgresql with my discord bot hosted in heroku

#
@client.listen()
async def on_member_join(member):
  dm = await member.create.dm()
  await dm.send('Hello! Welcome to Jay\'s Server!')
#

@slate swan

#

not working for some reason

slate swan
quick gust
slate swan
#

not working either

slate swan
quick gust
#

!intents

unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

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

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

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

blazing lynx
#
   @commands.command()
    async def help(self, ctx):
        if ctx.message.content == "fun":
            embed = disnake.Embed(title="Fun Commands", description="`randomfact`, `coinflip`, `rps`")
            await ctx.send(embed = embed)
            
#

its not sending the message?

slate swan
#

Your if statement can never be true

blazing lynx
#

wym

slate swan
#

why do you think you will send a message !help and it's content will be equal to fun

#

!e print("!help"=="fun") # is what u r doing

unkempt canyonBOT
#

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

False
blazing lynx
#

how

#

may you fix my code for me?

quick gust
#

just do "!help fun" instead of "fun"

pliant gulch
#

How would that fix the issue

#

The command name is help, and thus ctx.message.content has to be <prefix>help

#

It wouldn't pass the first if statement

quick gust
#

right

#

my bad

slate swan
quick gust
#

you click on it

quick gust
unkempt canyonBOT
#

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

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

New in version 2.0.
pliant gulch
#

Bot's cannot press buttons

quick gust
#

I thought they wanted to make buttons but mis-phrased it

blazing lynx
#
if ctx.message.context == "zo!help fun":
  code here
#

?

slate swan
#

it's content not context

blazing lynx
#

ye

slate swan
blazing lynx
#

thanks

slate swan
quick gust
slate swan
blazing lynx
#

how to make it so if someone mentions my bot the bot sends a message?

leaden hollow
#

how to add delay in message

final iron
#

!d asyncio.sleep

unkempt canyonBOT
#

coroutine asyncio.sleep(delay, result=None)```
Block for *delay* seconds.

If *result* is provided, it is returned to the caller when the coroutine completes.

`sleep()` always suspends the current task, allowing other tasks to run.

Setting the delay to 0 provides an optimized path to allow other tasks to run. This can be used by long-running functions to avoid blocking the event loop for the full duration of the function call.

Deprecated since version 3.8, removed in version 3.10: The `loop` parameter. This function has been implicitly getting the current running loop since 3.7. See [What’s New in 3.10’s Removed section](https://docs.python.org/3/whatsnew/3.10.html#whatsnew310-removed) for more information.

Example of coroutine displaying the current date every second for 5 seconds:
leaden hollow
final iron
leaden hollow
#

kk

heavy folio
#

subclass it

blazing lynx
#

how to make it so if someone mentions my bot the bot sends a message?

heavy folio
#

use on_message, check if the content == the bot's ping or not

blazing lynx
#

kk

final iron
#

Search for it in the docs

loud junco
#
@bot.command(name='mine')
@commands.cooldown(1, 60, commands.BucketType.user)
async def mine(ctx):
  num1 = random.randint(0, 100)
  num2 = random.randint(0, 100)
  lootcount = 101
  loottype = None
  await emoji(ctx)

  if area in [1, 2]:
    if num1 <= 40:
      loottype = 'coal'
      emoji = ecoal
    elif num1 <= 100:
      loottype = 'cobble'
      emoji = ecobble
#

UnboundLocalError

prime bloom
#

would anyone know why my

async def hello(ctx, arg1=None, arg2=None):
  await ctx.send(f'Hi! arg1={arg1} arg2={arg2}')```
is not working, the console is saying
bot is not defined
#

I cannot use any @bot commands

loud junco
#

bot = commands.Bot(command_prefix=)

#

do ur code has this

#

:/

leaden hollow
#

he probably used client instead of bot

prime bloom
#

oooh no its does not

loud junco
#

...

loud junco
prime bloom
#

ive got this

#

client = discord.Client()

leaden hollow
#

yes

loud junco
#

remove this

#

and replace it with this
bot = commands.Bot(command_prefix=)

prime bloom
#
import os

bot = commands.Bot(command_prefix=['rpm ', 'Rpm ', 'RPM '])

@client.event
async def on_ready():
  print('JB Bot Is Logged In {0.user}'.format(client))



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

client.event change to bot.event

prime bloom
#

Does that mean I have to change the client.event too

loud junco
#

yes

prime bloom
#

ahhh, so what is the difference there

loud junco
#

change all client.blahblah to bot.blahblah

prime bloom
#

is there any advantage to having client over bot or vise versa

loud junco
#

bot is better

#

100% better

#

at every perspective bot is better

prime bloom
#

the tutorial I used had client - guess im switching to bots then😁

final pumice
#

Any good links to discord.py tutorials bc YouTube tutorials are dogshit?

loud junco
#

i also watched that tutorial

#

freecodecamp?

prime bloom
#

bot = commands.Bot(command_prefix=['rpm ', 'Rpm ', 'RPM '])

prime bloom
#

so how does that work

loud junco
#

whats ur bot prefix

final pumice
loud junco
#

command_prefix = ur prefix

prime bloom
#

like for commands, im using "-"

blazing lynx
#

how to make it so if someone mentions my bot the bot sends a message? simple example

loud junco
#

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

#

ur prefix

#

:/

#

its not practical

loud junco
#

wdym

#

ping ur bot?

slate swan
#

@visual island im done with my project lol

blazing lynx
prime bloom
#
import os

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

@bot.event
async def on_ready():
  print('JB Bot Is Logged In {0.user}'.format(client))



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

  if message.content.startswith('-test'):
    await message.channel.send('**B Economy Is Fully Operational**')

  if message.content.startswith('-where'):
    channel = client.get_channel(925571626609819678)
    await channel.send('Here')

@bot.command()
async def hello(ctx):
  await ctx.send(ctx.author.mention + " hello!")


client.run(os.getenv('TOKEN'))```
so im getting a bit of errors, what else should I change here regarding changing the client -> bot
blazing lynx
loud junco
#
@bot.event
async def on_message(message):
    mention = f'<@!{bot.user.id}>'
    if mention in message.content:
        await message.channel.send("You mentioned me")
```i get this from stackoverflow
#

looks like it should work

#

but maybe there is a better way

#

@blazing lynx

#

try if it works

slate swan
blazing lynx
blazing lynx
loud junco
#

stackoverflow helped u not me

#

🤣

slate swan
#

lmao

blazing lynx
#

lol

slate swan
#

i finally finished my project that i was working on for 7h straight lol

loud junco
#

nice

slate swan
#

kinda happy

prime bloom
#

I have zero clue how prefix's work here..

loud junco
#

u know what is prefix?

prime bloom
#

not really

slate swan
#

now i will go to sleep gn probably wont go to sleep

prime bloom
#

im guessing the symbol to call a command

loud junco
#

yup

prime bloom
#

like !

loud junco
#

it can be letters also

prime bloom
#

can it be

slate swan
#

strs as well

leaden hollow
#

anything literally

loud junco
#

sure

#

anything

slate swan
#

anything to start a command

loud junco
#

but try not to make it to hard to type

prime bloom
#

so does this work
bot = commands.Bot(command_prefix= -)

loud junco
#

like !@#$#@

slate swan
#

should be in a str

loud junco
#
bot = commands.Bot(command_prefix= '-')
slate swan
#

correct

loud junco
#

like this

#

remember the ' '

prime bloom
slate swan
prime bloom
#

ahh, but then it becomes an area

loud junco
#

i prefer ' '

#

but most of the human out there prefer " "

slate swan
prime bloom
#

THERE WE GO

slate swan
#

your using the bot framework so you need to import it

loud junco
#

its not here

#

idk why

slate swan
#

!d discord.ext.commands.Bot

unkempt canyonBOT
#

class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.

This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.

This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
slate swan
#

close enough

#

as your using the bot framework

prime bloom
#

Traceback (most recent call last):
File "main.py", line 30, in <module>
bot.run(os.getenv('TOKEN'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 216, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.

KeyboardInterrupt

KeyboardInterrupt

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.

loud junco
#

:/

prime bloom
#

I just got that error now 🔪

loud junco
#

LOL

#

rate limited

#

replit being replit

prime bloom
#

wooow

loud junco
#

ya

slate swan
#

you got ratelimited

loud junco
#

u spammed the start stop button too much
are u using the 247 thing?

prime bloom
#

247 thing? whats that

slate swan
#

happens when you do to many request in this case as your using replit someone with the ip your sharing is requesting to much and everyone on it got ratelimited

shadow wraith
#

i only got ratelimited when on replit

#

so ig your kinda right :|

slate swan
#

@shadow wraith wanna see my new projectpithink

shadow wraith
#

sure

#

what is it about

#

discord bot?

slate swan
#

!pypi discordheximals

unkempt canyonBOT
slate swan
blazing lynx
#

im using config.json for my prefix. how can i make a changeable prefix?

shadow wraith
#

💀

shadow wraith
#

keref

slate swan
#

ah

#

lol

prime bloom
#

should I use Visual Studio Code instead then

blazing lynx
#

using disnake

shadow wraith
#

why tf are you using a config.json, you can just add a prefix in commands.Bot(command_prefix=...)

maiden fable
blazing lynx
#

ik.

final pumice
#

If I say "!search Whiteflame362", how can I separate the "!search" from "Whiteflame362" so I can use it in my code

slate swan
#

when i do (prefix) then ban @amber beacon it doesnt ban them

cobalt jacinth
#

await channel.history(limit = 10).flatten()
does this give last 10 messages ? how to get first 10 messages

slate swan
#

and they are lower than my role and i have perms (im owner)

slate swan
maiden fable
maiden fable
prime bloom
#

sorry guys... how do I run the code on Visual Studio Code, like what do I type in the terminal

slate swan
slate swan
#

bet

#

let me fire up my pc real quick

final pumice
#

If I say "!search Whiteflame362", how can I separate the "!search" from "Whiteflame362" so I can use it in my code

maiden fable
#

!d discord.ext.commands.command

unkempt canyonBOT
#

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

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

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

is it possible to make a marry command system simular to ZeroTwo's MArry Command in python?

slate swan
#

@maiden fable donepithink

final pumice
#

Thanks

blazing lynx
maiden fable
slate swan
shadow wraith
#

ware is the github 🚎

slate swan
#

in the pypi

shadow wraith
#

nah where is the github for discordheximals

maiden fable
#

@slate swan btw another thing

shadow wraith
#

nvmnvm

slate swan
maiden fable
#

Don't title it as discordheximals. Since it can also be used as a general color code module. That title makes it look like u can only use it with discord modules

shadow wraith
#

woah oh fuck wtf is this

maiden fable
#

Why?

slate swan
#

it returns
0xhexcode as a intpithink

slate swan
#

i did made a instance for a general one which i will publish tomorrow that returns a str

visual island
#

also @slate swan, make a class which has a method to convert to hex, binary, rgb, etc. Then return that class in every static method

maiden fable
#

Many modules use that sorta codes too

shadow wraith
#

ok thanks i will install discordheximals now :]

slate swan
maiden fable
slate swan
maiden fable
#

Class converter?

slate swan
#

no sorry i ment

shadow wraith
visual island
#

pip install it when

shadow wraith
#

i pip3 installed it

slate swan
#

a class that converts hex code to rgb?

shadow wraith
#

since pip is always undefined according to my terminal :[

shadow wraith
#

its just a import couldn't be resolvd

slate swan
#

and you just need to do

import discordheximals
maiden fable
#

O

shadow wraith
maiden fable
#

!e

class A:
    @staticmethod
    def b():
        return 1
print(getattr(A, "b")()) 
unkempt canyonBOT
#

@maiden fable :white_check_mark: Your eval job has completed with return code 0.

1
maiden fable
#

Oh, hmm

slate swan
shadow wraith
#

how

#

did you resolve it

slate swan
#

im thinking cause i forgot

shadow wraith
#

🔪

maiden fable
#

Did u pip install it? @shadow wraith

shadow wraith
#

i did pip3 install discordheximals

#

:[

visual island
# slate swan a class that converts hex code to rgb?

no like

class ColorType:
    def __init__(self, value):
        self.value = value

    def to_rgb(self): ...

    def to_binary(self): ... 
    
    def __repr__(self): return self.value

class Color:
    @staticmethod 
    def color() -> ColorType:
         return ColorType(0xSomething)
slate swan
#

because my error wasnt really like that

slate swan
shadow wraith
#

bro im gonna kms rn

slate swan
#
color=discordheximals.Color.colorname()

thats how it should be

maiden fable
shadow wraith
#

oh another error, discordheximals not accessed

#

ima kms 💀

#

jk

slate swan
#

your making a bad impression of my module🚶

visual island
slate swan
#

should state that

visual island
slate swan
#

have to update its example as well since its wrong

shadow wraith
#

im dying rn

maiden fable
#

Imagine making a module specially for embed colors even when people don't know half the color names in your module 😐

slate swan
#

it has over 1k colors just learn them all smhpithink

maiden fable
#

Me who doesn't use embeds: zypoggers

slate swan
#

@shadow wraith i had the same error but it was because the file name was the same as the directories so pycharm had a stroke

shadow wraith
slate swan
maiden fable
slate swan
#

still allotpithink

maiden fable
#

actually I'll just go rn and do some work, so, uhhh

visual island
#

nahh, cntrl + f to the rescue

maiden fable
slate swan
#
import discordheximals

@bot.command()
async def example(ctx):
    embed = discord.Embed(title="title",color=discordheximals.Color.colorname())
    await ctx.send(embed=embed)

thays how it should look like

slate swan
upbeat otter
slate swan
unkempt canyonBOT
slate swan
#

smh

upbeat otter
#

that's seriously not required and you should stop spamming ot ot ot ot ot ot for the questions you cant answer

slate swan
#

why use color hex codes if you can search it by the name?

maiden fable
upbeat otter
slate swan
upbeat otter
maiden fable
#

ahem ahem can we stop here

upbeat otter
#

lol

#

alright, delete your essay @slate swan

slate swan
#

742colorspithink

maiden fable
shadow wraith
#

be honest, did u copy it?

visual island
#

did the command got triggered?

slate swan
#

There can be many reasons

  • your error handler avoids the error
  • you have an on_message event which doesn't let the command process
#

add a print statment to check if the command gets triggered

maiden fable
#

Understand the power of debug prints :D

visual island
#

do you have on_message event?

slate swan
#

Check if you have one....

#

?faq on_message

#

Brb

boreal ravine
#

why the snakeCasing lol

slate swan
#
    msg = await bot.wait_for("message")
    if msg == "open":

there is no interaction. why?

#

says it

slate swan
boreal ravine
slate swan
#

msg is a discord.Message object ,can't be compared with string

#

yeah i get it

boreal ravine
#

thisIsSnakeCasing first letter is lowercase, then every new word after the first word is capitalized

leaden hollow
#

error
RuntimeWarning: coroutine 'send_override' was never awaited ctx.send(file=discord.File('assets/abe.png')) RuntimeWarning: Enable tracemalloc to get the object allocation traceback

slate swan
#

snakeCasing

boreal ravine
#

!d discord.abc.Messageable.send

unkempt canyonBOT
#

await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
slate swan
#

channel = await ctx.guild.create_text_channel(f'')

how do i assign this to a specific category?

boreal ravine
unkempt canyonBOT
#

await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

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

Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to create the channel.

The `overwrites` parameter can be used to create a ‘secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.

Note

Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
boreal ravine
#

👍

slate swan
#

You awaited it?

#

Then ik

#

It is cuz it doesn't know in ctx.channel

#

There is something like send

#

If u do channel: discord.TextChannel = ctx.channel

#

It will come

quick gust
#

what's the need? if u are passing Context can u not just do ctx.send()

slate swan
#

@slate swan

quick gust
#

also I didn't understand what that meant

slate swan
#

Lul

quick gust
#

"why is this not colored in"

slate swan
#

He wants that in colored

quick gust
#

colored in what

slate swan
#

In the code formatting

#

It doesn't matter

quick gust
#

does the code work though?

#

why do u want to use colours

slate swan
quick gust
#

use ms word if u want colours

#

lol

slate swan
#

Just use ctx.channel.send

#

Colour doesn't matter

upbeat otter
#

because ctx is just a parameter passed in the function and all the work takes place when the code is run

slate swan
#

Exactly

boreal ravine
#

it's just color

slate swan
#

If u typehint

#

It will come

#

how can i check if a channel is in a specfifc category?

slate swan
#

Like ctx: commands.Context

upbeat otter
unkempt canyonBOT
#

class discord.CategoryChannel```
Represents a Discord channel category.

These are useful to group channels to logical compartments.

x == y Checks if two channels are equal.

x != y Checks if two channels are not equal.

hash(x) Returns the category’s hash.

str(x) Returns the category’s name.
slate swan
#

i said room because in my country its the same thing like channel and room

#

and i totally forgot

#

😆

boreal ravine
slate swan
#

or , channel in category.channels 📚

boreal ravine
visual island
slate swan
#

yeah idk

slate swan
#

I'll guess okimii just did dir(file)

slate swan
slate swan
#

i need to update the pypi file tho

#

ill do it tomorrow

slate swan
shadow wraith
quick gust
slate swan
#

why y'all hating the read me smh pithink

quick gust
#

it's giving me eye damage

#

jk

maiden fable
maiden fable
slate swan
#

You could have done something like ```py
print(f"{' , '.join(dir(Color))}")

maiden fable
#

Lmfao

slate swan
maiden fable
slate swan
#

jk

#

I forgor how to make a pull req

slate swan
slate swan
maiden fable
slate swan
boreal ravine
#

give me command ideas

shadow wraith
#

@slate swan i fixed the issue by copying all the discordheximals.py code into a file in my bot's directory to locally import x]

slate swan
shadow wraith
boreal ravine
boreal ravine
shadow wraith
#

oh fuck you do 💀

slate swan
#

i should make an img with all the names with sorts as a blue zone with all the blues and stuff but ill do thag another time

#

it the meanwhile watch the read me

blazing lynx
#
import json
import disnake
from disnake.ext import commands


class Cookies(commands.Cog, name="cookies"):
    def __init__(self, bot):
        self.bot = bot

        async def get_bank_data():
         with open("bank.json", "r") as f:
            users = json.load(f)
         return users  

        async def open_account(user, message: disnake.Message):
         users = await get_bank_data()

        if str(message.author.id) in users:
            return False
        with open("bank.json","r") as f:
            users = json.load(f)
    
        if str(user.id) in users:
            return False
        else:
            users[str(user.id)]["cookies"] = 0
        
        with open("bank.json", "w") as f:
            json.dump(users,f)
        return true


    @commands.command()
    async def cookies(self, ctx):
        await open_account(ctx.author)
        user = ctx.author
        users = await get_bank_data()

        cookies_amt = users[str(user.id)]["cookies"]
         #this will get the data from the .json file
        em = discord.Embed(title = f"{ctx.author.name}'s balance", color =random.randint(0, 16777215) )
        em.add_field(name = "Cookies ",value = cookies_amt + "🍪")
        await ctx.send(embed = em)


    @commands.command()
    async def beg(self, ctx):
        await open_account(ctx.author)

        users = await get_bank_data()
        #fetches the data for the author
        user = ctx.author

        earnings = random.randrange(101)

        await ctx.send(f"Someone gave you {earnings} coins!!")
        #randomizes the earnings and tells you
        users[str(user.id)]["cookies"] += earnings

        with open("bank.json", "w") as f:
            json.dump(users, f)


def setup(bot):
    bot.add_cog(Cookies(bot))
#

ExtensionFailed: Extension 'cogs.cookies' raised an error: NameError: name 'message' is not defined

slate swan
#

can i set the channel description using d.py?

maiden fable
#

!d discord.TextChannel.edit

unkempt canyonBOT
#

await edit(*, reason=None, **options)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the channel.

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

Changed in version 1.3: The `overwrites` keyword-only parameter was added.

Changed in version 1.4: The `type` keyword-only parameter was added.

Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead.
blazing lynx
#

where

shadow wraith
#

!indent

unkempt canyonBOT
#

Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

slate swan
#

@slate swan mind if i create a pull req? ( just a better readme and code format )

tough lance
shadow wraith
#

ive seen that before

blazing lynx
shadow wraith
#

oh 😭

blazing lynx
#

tutorial on yt

shadow wraith
#

do you even know what the code does?

sacred torrent
#

i am new in discord.py
from where i can get the best tutorial? 🥺

blazing lynx
slate swan
shadow wraith
shadow wraith
sacred torrent
#

Umm. Ok

blazing lynx
tough lance
sacred torrent
slate swan
tough lance
sacred torrent
#

Ok. Thnx

buoyant wagon
#

Hi everyone! Recently I started writing a small Python bot for Discord. I found Permissions.voice() in the documentation, which in theory should automatically enable all voice permissions, but I ran into the problem of how to pass it to set_permissions method. Can someone explain?

buoyant wagon
#

If you pass Permissions.voice as overwrite, then an error will occur

buoyant wagon
leaden hollow
#

any way to set a file on my PC in
embed.set_image

slender pollen
#

Hello, I need member to enter a number e.g. "!test 100" how I can get that number?

leaden hollow
buoyant wagon
buoyant wagon
slate swan
#

thats not how it works

#

it takes an Overwrite object

boreal ravine
#

ot but flex 😎

tiny ibex
#

!d discord.File

unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
tiny ibex
#

@leaden hollow

leaden hollow
#

ty

slate swan
boreal ravine
buoyant wagon
slate swan
slate swan
visual island
visual island
#

👍

blazing lynx
#

how to send random gifs inside a embed?

visual island
#

!d random.choice

unkempt canyonBOT
#

random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError "IndexError").
visual island
#

give a list of urls

blazing lynx
#

disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.image.url: Scheme "e" is not supported. Scheme must be one of ('http', 'https').

#

it was a "https"

visual island
#

it was a "e"

blazing lynx
visual island
#

!e

import random
a = ["one", "two", "three"]
print(random.choice(a))
unkempt canyonBOT
#

@visual island :white_check_mark: Your eval job has completed with return code 0.

one
blazing lynx
#

disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: choice() takes 2 positional arguments but 4 were given

visual island
shadow wraith
#

anyone have a stupid command idea where the bot posts 2 sentences which rhyme

#

without a list, tuple or something. just randomness

tiny ibex
#

Anyone knows any good button paginators?

boreal ravine
#

How do i disable a select menu

boreal ravine
visual island
unkempt canyonBOT
boreal ravine
#

thanks

boreal ravine
#

like on_timeout

small igloo
#

what is the name for TypeError: 'NoneType' object is not subscriptable?

i mean if command not found error's name is CommandNotFound, then what is the name of TypeError: 'NoneType' object is not subscriptable

tawdry perch
#

name?

small igloo
small igloo
boreal ravine
unkempt canyonBOT
#

@boreal ravine :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: yep just that
small igloo
boreal ravine
#

who is mark?

small igloo
small igloo
boreal ravine
#

it's just TypeError, nothing else

small igloo
tawdry perch
#

It's part of error message afaik

small igloo
tawdry perch
#

CommandNotFound is a custom error

#

Or traceback

small igloo
boreal ravine
tawdry perch
#

this.

small igloo
boreal ravine
small igloo
boreal ravine
#

yes

small igloo
#

yay thanks

shadow wraith
#

i came here for cool command ideas people are attempting to do

boreal ravine
boreal ravine
unkempt canyonBOT
#

examples/views/disable_view.py lines 7 to 18

class MyView(disnake.ui.View):
    message: disnake.Message

    def __init__(self):
        super().__init__(timeout=30.0)

    async def on_timeout(self):
        # Once the view times out we disable the first button and remove the second button
        self.children[0].disabled = True  # type: ignore
        self.remove_item(self.children[1])
        # make sure to update the message with the new buttons
        await self.message.edit(view=self)```
boreal ravine
#

will that work for a select menu class?

slate swan
boreal ravine
slate swan
#

How can I get a role's ID by pinging it? discord.Role does not seem to work

unkempt canyonBOT
slate swan
#

:0

slate swan
#

tysm

boreal ravine
slate swan
boreal ravine
#
class View(discord.ui.Select):
  ...

class MyView(discord.ui.View):
  def __init__(self):
    super().__init__(timeout=10)
    self.add_item(View())

  async def on_timeout(self):
    ... # what index is it gonna be?
slate swan
#

idk what to do

slate swan
boreal ravine
#

thanks

slate swan
#
@client.command()
async def modrole(ctx, ping = discord.Role.id): #the error happens here
    guild_id = ctx.guild.id
    role_id = ping

    if ctx.author.id == ctx.guild.owner_id:
        dbc.execute('update guild set modrole_id = ? where guild_id = ?', (role_id, guild_id))
        db.commit
        print(f'<@&{role_id} is now the `modrole` on this server!')

    else:
        await ctx.send("Only server owner can do this!")```
upbeat otter
#

Or setting it as the default ;-;

slate swan
#

thats not how typehinting works

#

it should be class , not a property 😐

upbeat otter
#

Ikr

slate swan
#

and the = :meh:

upbeat otter
#

That's what i meant

velvet tinsel
#

Where’s the PEP8

slate swan
#

what do you guys prefer for formatting your code? pithink

boreal ravine
#

give command ideas

minor comet
#

does anyone know how to code a discord bot to send teext

slate swan
#

mhm i started using black now , makes the code look better

slate swan
#

or you just want to start with it

minor comet
#

i just ahve a bot

minor comet
ionic basin
#

i just watched some python tutorials, and now want to learn to make discord bot, how to start that

slate swan
boreal ravine
#

o-o

velvet tinsel
unkempt canyonBOT
#
NEGATORY.

No documentation found for the requested symbol.

minor comet
#

but i only know competitive python

velvet tinsel
#

Shoot. Well it’s ctx.send()

boreal ravine
#

!d discord.ext.commands.Context.send

unkempt canyonBOT
#

await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
slate swan
boreal ravine
minor comet
velvet tinsel
#

I hate you kayle

slate swan
velvet tinsel
#

I also like you

#

yert doesn’t make sense

slate swan
#

why does kayle's fish appear to big in his pfp

#

atleast for me

boreal ravine
#

🐟

velvet tinsel
#

Me too

#

You’re not alone lol

#

It’s just how it is

slate swan
slate swan
#

and like add =None or whatever?

slate swan
# slate swan wdym
def function(value : int):``` is typehinting
```py
def function(value = 1) :``` is giving a default value
```py
def function( value = str(int)):``` is what u r doing
velvet tinsel
#

iirc it should be :

slate swan
#

I understand

velvet tinsel
#

Good 👍

fervent shard
#

i added an on_message code and after adding that code to my file, my commands dont work

slate swan
#

ty

velvet tinsel
#

Oh it says there

slate swan
#

imagine them using .listen() and adding process_commands too

velvet tinsel
#

Also I think the docs are misleading

slate swan
#

🤯

slate swan
velvet tinsel
#

You don’t really need a listen(“on_message”) if you are using an on_message

#

You can just leave it blank and use on_message()

#

Works for me

#

And my bot

slate swan
#

yea , but what if you want to have multiple on_message events

#

only one of them would work then

velvet tinsel
slate swan
#

"what if"

velvet tinsel
#

Ok I guess

#

Fair enough

#

But I think they only have one on_message?

slate swan
#

why not just ```py
@listener("on_message")
async def event_1(self , msg):

@listener("on_message")
async def event_2(self , msg):

slate swan
velvet tinsel
#

But you can…I can’t write code

fervent shard
# velvet tinsel Also I think the docs are misleading

i did what the docs said but they told me to put message in the brackets, that came in an error so i changed it to msg the code i have that includes on_message is

@bot.event
async def on_message(msg):
  for word in filtered_words:
    if word in msg.content:
      await msg.delete()
  await bot.process_commands(msg)```
velvet tinsel
#

Try bot.listen()

#

Instead of event

#

If you’re using one on_message

fervent shard
velvet tinsel
#

Then do what @slate swan said

fervent shard
velvet tinsel
fervent shard
velvet tinsel
#

If you only have one on_message

#

I guess

haughty quartz
#

is there any way to have multiple inputs possible for one command? ex: !help and !commands

slate swan
#

why not

#
async def command(ctx , argument):```
haughty quartz
#

where can i declare the arguments *

slate swan
#

you add it as a parameter for your command

#
@bot.command()
async def say(ctx,word):
   await ctx.send(word)```
example
oblique adder
#

what could be the cause of this problem ? when I tested on my server i dont c any error. on_raw_reaction_add

haughty quartz
#

do you know how i can have multiple args tho?

slate swan
haughty quartz
#

okay

maiden fable
#

@oblique adder seems like u can't access the channel