#discord-bots

1 messages · Page 854 of 1

slate swan
#

Там грубые оски будут)

buoyant quail
#

imagine that it is english

final iron
buoyant quail
#

but it is

final iron
#

It's Russian

#

Not english

buoyant quail
#

no

#

it's english

final iron
buoyant quail
#

xd

open spear
#

can someone please help with the git thing

#

i have it installed

slim ibex
sick birch
#
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?

You say you have git installed, by process of elimination, that means you don't have it in your PATH

slate swan
#

what would be the correct code to add an embed image ?

buoyant quail
hoary cargo
#

🗿 yes, i added 14 days on the created_at and i checked if it exceeds the current time, means the account has been made under 2 weeks, that was my goal

slate swan
#

why*

#

show

#
@commands.command()
    async def creator(self, ctx: commands.Context):
        await ctx.send (embed = discord.Embed (title=f"9''' Management Bot Creator", description= "Creator of 9''' Management Bot",
        Embed.set_image "https://tenor.com/view/pooh-shiesty-gif-19804375" ))
buoyant quail
#

lol

rare saddle
#

How to get the number of all channels that are on the servers where the bot is located?

slate swan
#

im new to dis dont judge me yet

buoyant quail
slate swan
#

o shoot

#

so i did the whole thing wrong

#

but it still sent the other things just not the image

sick birch
#
embed = discord.Embed(...)
embed.set_image(...)
await ctx.send(...)
slate swan
#

ohhh

#

thanks both of u

sick birch
rare saddle
sick birch
#

So every channel in every server?

rare saddle
buoyant quail
rare saddle
buoyant quail
#
sum(len(guild.channels) for guild in client.guilds)
``` somethin like that
sick birch
#

yeah that will work

slate swan
#

just running a test; my bot is online I have no idea why this is not working

slate swan
#

and use f strings

#

and you need context

buoyant quail
#

oof

slate swan
#

the thing is. my last project it wouldn't even respond to anything either

#

had f-strings n all that

buoyant quail
#

client.say is ctx.send

#

in ping() you need ctx

slim ibex
#

!d discord.ext.commands.Bot.process_commands

unkempt canyonBOT
#

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

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

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

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

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

prolly should process commands in your message listener

slate swan
#

its better imo

slate swan
buoyant quail
slate swan
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
#

works now

#

thanks

sick birch
#

That's not a feature for bots unfortunately (i might be mistaken)

oblique laurel
#

You could probably implement it, but it would probably take a while

slate swan
#

is their even an endpoint for it?

oblique laurel
#

Looping through the history of every channel

slate swan
#

oh

oblique laurel
slate swan
#

yeah ig🗿

#

yup

oblique laurel
#

True, but isnt that how discord itself does it? Just in a faster lang

small igloo
#

how to reset cooldown of a specific user 🗿

oblique laurel
#

Yeah true, sometimes takes like 10 seconds to load

sick birch
#

Okay let me rephrase what I said, there's no native discord way or endpoint to do it, you can do it by getting the history of a channel and filtering, but that's very slow

#

If you specify None then no

oblique laurel
#

By default

#

I think you can change it tho

small igloo
#

command

oblique laurel
#

Like chat message cd?

slate swan
#

thats slowmode

oblique laurel
#

Yeah, i dont think you can change the length of slowmode per user

small igloo
#

🗿 not slowmode

slate swan
#

hes not talking about that lol

oblique laurel
#

Was gonna say lol

small igloo
#

ok, that one not work

small igloo
#

:v

#

command.reset_cooldown(ctx)

but that's just for me right? i wana be a specified one, like command.reset_cooldown(dat_one_user)

#

🗿 yes

#

ok :v

#

a name of a comand ofc 🗿

#

nope, i dont use class, confusing 🗿

#

what

unkempt canyonBOT
#

@discord.ext.commands.cooldown(rate, per, type=discord.ext.commands.BucketType.default)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") and the local error handler.

A command can only have a single cooldown.
small igloo
#

ik that one 🗿

but how to reset cooldown of a specified user

#

wur

#

wut

#

????? that's what i ask from the begining

small igloo
sick birch
small igloo
#

what

#

GG novel 🗿 👍

plucky lynx
#

heey is someone able to create a bot for us in discord like a price bot we are a crypto company and we want our price chart / buy & sells (idk if we allow to hire someone) anyway dm me 🙂

small igloo
#

🗿 can't reset a specific user cd? (also not slowmode)

unkempt canyonBOT
#

9. Do not offer or ask for paid work of any kind.

plucky lynx
#

than (help)

#

well we have our own crypto coin

small igloo
#

wait, so command_name.reset_cooldown(dat_user[not_me]) is not exist?

plucky lynx
#

we want to create a bot that shows the price chart / sell/buys

#

in Telegram there are so much bots for that

#

even poocoin supports them

#

but for discord there are none so we have to create one from scratch

small igloo
#

LOL

plucky lynx
#

thats the thing

#

u cant get the API from them

small igloo
#

🗿 so that's doesn't exist... ok then :moyai_sad:

plucky lynx
#

the crypto LP is locked in Safemoon / Poocoin/Pancake

#

those API dont belong to us

small igloo
small igloo
small igloo
plucky lynx
#

maybe thats why we are looking for people to help us ?

delicate wedge
#

hey can someone pretend I know nothing about making a discord bot and explain the concept of it?

delicate wedge
#

oop thanks

plucky lynx
#

well thats something i can work with instead of everybody attacking lol

#

thanks will continue on Fiverr than

#

have a nice day

small igloo
#

🗿 what

final iron
#

Constants should be in SCREAMING_SNAKE_CASE

#

🗿

small igloo
#

give dis hooman a novel writer role 🗿

small igloo
#

cute face 🗿

#

:D 🗿

final iron
sick birch
#

Snowflakes contain the creation time of said snowflakes

silent ermine
#

Im trying to get all the guild id's and store them in a variable so i can use slash commands

serverIDS = []
for guild in bot.guilds:
    serverIDS.append(guild.id)```
^ My code

The error is the image
sick birch
pliant gulch
#
(snowflake >> 22) + 1420070400000)
``` epoch
final iron
sick birch
#

Shift every bit to the right X times

final iron
#

I have no idea what that means

silent ermine
sick birch
#

!e

for i in range(8):
  print(1 << i)
unkempt canyonBOT
#

@sick birch :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
003 | 4
004 | 8
005 | 16
006 | 32
007 | 64
008 | 128
final iron
#

wat

#

Maybe theres some resource you can link?

sick birch
#

sort of

#

00000001 is 1 in binary
00000001 << 1 = 00000010
00000001 << 2 = 00000100
00000001 << 3 = 00001000
etc...

#

Yeah conversion between bin and dec

pliant gulch
#

discord API really likes their bitshifts 😔

silent ermine
#

yep

delicate wedge
#

hahahahahahahahaaaa

#

help

brittle axle
#

429 errors means too many requests that the user sent and the API cannot handle. For discord.py the rate limit is 50. Since you are hosting on replit i will tell you something. Replit uses a shared ip to host. So if someone is a spammer who is hosting their bot in one of their ips the API wil temp ban everyone on that ip. Tbh i dont think there is a way to put rate limits on our project in replit. The only way that i can give you is whenever you are being rate limited just go to the replit shell and type kill 1 and then run again

oblique laurel
brittle axle
slate swan
brittle axle
#

oh ok

vast gale
#

yay dynamicness 😔

slate swan
#

fun

#

yes

#

!ot 🗿

unkempt canyonBOT
slate swan
#

i did🗿

#

how do i make it so i can do @bot.event(or command) instead of client i see ppl using bot.(event, command)

sage otter
#

By renaming your variable smilebutcryinside

#

That you assigned your commands.Bot instance to.

slate swan
#

yeah

slim ibex
#

changing the variable name doesn't do anything if you still instantiate discord.Client

sage otter
#

He hinted to the fact he’s using commands.Bot because he said he was using bot.event and bot.command() those aren’t possible on discord.Client

slate swan
#

no

#

im using @client.command and @client.event

final iron
#

🗿

final iron
slim ibex
#

💀

final iron
#

Which is incorrect

vague grove
#

how can i detect when a nickname was changed + the user who did it?

final iron
#

It should be named bot

final iron
#

As discord.Client exists

slate swan
#

oh alr

final iron
#

!d discord.on_member_update

unkempt canyonBOT
#

discord.on_member_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") updates their profile.

This is called when one or more of the following things change:

• nickname

• roles

• pending...
final iron
#

I'm not sure how you could tell who did it

vague grove
jade tartan
#
  File "c:\Users\thoma\Desktop\New folder\bot.py", line 26, in <module>
    client = commands.Bot(command_prefix = '!', intents = intents)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\ext\commands\bot.py", line 126, in __init__     
    super().__init__(**options)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 1183, in __init__   
    super().__init__(*args, **kwargs)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 287, in __init__
    self._connection: ConnectionState = self._get_state(**options)
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 312, in _get_state
    return ConnectionState(dispatch=self.dispatch, handlers=self._handlers,
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\state.py", line 205, in __init__
    raise TypeError(f'intents parameter must be Intent not {type(intents)!r}')
TypeError: intents parameter must be Intent not <class 'discord.flags.Intents'>``` Any one know what this means?
slim ibex
#

show code

jade tartan
#
import nextcord
import datetime
import json
import asyncio
import os
from discord import FFmpegPCMAudio
from discord.ext import commands
from discord_components import DiscordComponents
from nextcord.ext import commands


intents = discord.Intents.default()


intents.members = True

queues = {}

def check_queue(ctx, id):
    if queues[id] != []:
        voice = ctx.guild.voice_client
        source = queues[id].pop(0)
        player = voice.play(source)

client = commands.Bot(command_prefix = '!', intents = intents)
client.remove_command("help")
final iron
#

🗿

slim ibex
#

what looks good?

final iron
#

What is this

slim ibex
#

but the code is shit

#

!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.

jade tartan
#

ohh maybe import Intents

slim ibex
#

^

#

bros using discord and nextcord

final iron
#

pain

jade tartan
#

Yeah because i am making my help command using nextcord

slim ibex
#

bro what

final iron
#

what

slim ibex
#

LMFAO

final iron
slim ibex
#

use one fucking lib for it all

final iron
#

🗿

slate swan
full lily
#

I'm not sure they would

#

there's temporary ones, as is obvious

jade tartan
#

@slim ibex remember when i talked about the embed that i wanted to do for my server?

#

Is this the right structure of the code @client.command() async def start(ctx): embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00) embed.add_field(name= f"User: {ctx.author.mention}", value="✅Verified 18+✅", inline=False) try: await ctx.send('what is favorite color') except discord.HTTPException: msg = await client.wait_for('message') await ctx.send(embed=embed)

slim ibex
#

why would you put wait_for in an except

jade tartan
#

ohh wait i got it sorry

left crater
#

how do i run git commands

#

i am trying to update to version 2.0

sage otter
#

pip install git+https://github.com/Rapptz/discord.py

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

jade tartan
#
async def start(ctx):
    embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00)
    embed.add_field(name= f"User: {ctx.author.mention}", value="✅Verified 18+✅", inline=False)
    try: 
        await ctx.send('what is favorite color')
        msg = await client.wait_for('message')
    except discord.HTTPException:
        await ctx.send(embed=embed)```
#

How do i get the await in an embed?

lost lichen
#

copied from the official dpy docs, what am i doing wrong? the bot sends multiple messages so which message is it looking for the reaction?

hoary cargo
left crater
lost lichen
torn sail
lost lichen
lost lichen
#

whats an alternative

#

what i mean is

#

whats the docs referring to when it mentions client

jade tartan
#
async def start(ctx):
    embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00)
    embed.add_field(name= f"User: {ctx.author.mention}", value="✅Verified 18+✅", inline=False)
    try: 
        await ctx.send('what is favorite color')
        msg = await client.wait_for('message')
    except discord.HTTPException:
        await ctx.send(embed=embed)``` Well i am trying have the ctx.send in an embed. So?
torn sail
unkempt canyonBOT
#

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

Add a reaction to the message.

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

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

im sending an embed, so would msg = await ctx.send(embed=embed) work?

sage otter
#

in a check.

#

wait_for() can take a callback to a function that you can use to check if the message that’s being reacted to is a specific message, if the reactor is a bot, if the reactor is the command author, etc. it’s really up to you.

#

If you look at the wait_for() documentation there’s two different examples that implement wait_for(). One being for a message and another being reactions.

sage otter
# jade tartan Anyone?

Do you mind rephrasing your question. The way it’s asked now doesn’t make too much sense.

#

Are you asking how to send an embed?

jade tartan
#

await ctx.send('what is favorite color') When the bot sends this message. i want it to send in an embed. like this

sage otter
#

Oh

#

That method has a embed kwarg that you pass discord.Embed objects into

jade tartan
#

And also see if the user has his dms turned on or not

sage otter
#

So build yourself an embed with that content in it and pass it in.

jade tartan
#

Can i see the doc for that code?

#

example

sage otter
#

await ctx.send(embed=discord.Embed(description="Example"))

#

Sends an embed with the description as Example

supple crescent
#

i genuently have no idea how to phrase this: i want to make it so if the person says !order, it will paste a tesmplate, then wait for their next message. paste it back. then it will say "are you sure you want to do this, if yes, say !yes, to redo do !redo"(then make branches for !yes and !redo). can anyone help me?

sage otter
#

!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**...
lost lichen
sage otter
#

See the example in the documentation. It should help you to a significant extent.

supple crescent
sage otter
lost lichen
slate swan
#

status of the server?

#

cool

lost lichen
#

i already did that part with an http API request

slate swan
#

what the heck is the status of a server

sage otter
#

By status of the server do you mean just, information about it.

slate swan
#

lmao

sage otter
#

Like member count, owner, how many channels, etc?

lost lichen
#

essentially yes

#

uhh

maiden fable
slate swan
lost lichen
#

not talking about discord server, im talking about a private computer running game servers/bots/etc (hosting)

slate swan
#

!d discord.ext.commands.Bot.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**...
slate swan
#

and good morning

lost lichen
#

i know.. i just dont understand how that works / how to do it

slate swan
#

rip

maiden fable
#

Won't say that rn. Going in and out and in and out of sleep lol

lost lichen
sage otter
maiden fable
#

If I sleep, my parents gonna kill me but I am sleepy still ;-;

vivid marsh
#

What’s the best data base for a eco bot?

sage otter
#

If it’s small sqlite, if it’s meant to be a bigger bot use postgres

scarlet rune
#

does anyone know why this code doesn't execute anything?

@commands.command(aliases=["mute"])
    async def freeze(self, ctx, target: disnake.Member, dur, reason="No reason."):
        if "m" in dur:
            duration = dur[:-1] * 60
        elif "h" in dur:
            duration = dur[:-1] * 3600
        elif "d" in dur:
            duration = dur[:-1] * 86400
        reason = reason
        MUTEROLE = disnake.utils.get(ctx.guild.roles, id=882121435437490247)
        await target.add_roles(MUTEROLE)
        # mute embed
        muted = disnake.Embed(color=ecolor, description=f"**Frozen** | *{dur}* | <@{target.id}> has been frozen for {reason}.")
        muted.set_footer(text=f"by {ctx.author.name}")
        muted.timestamp = dt
        await bot.channel.send(embed=muted)
        await asyncio.sleep(duration)
        await target.remove_roles(MUTEROLE)
        unmuted = disnake.Embed(color=ecolor, description=f"**Unfrozen** | <@{target.id}>.")
        await bot.channel.send(embed=unmuted)```
vivid marsh
#

Alright figured I’d ask cuz all these vids are using json and all the comments say json sucks

lost lichen
scarlet rune
lost lichen
#

right now im trying to make the docs example work

slate swan
vivid marsh
#

Would mongo be better? Just another popular one I’m seeing

scarlet rune
#

aight wait

maiden fable
vivid marsh
slate swan
slim ibex
sage otter
jade tartan
#
  File "c:\Users\thoma\Desktop\New folder\bot.py", line 6, in <module>
    from discord.ext import commands
ImportError: cannot import name 'commands' from 'discord.ext' (unknown location)```
#

Its saying this

maiden fable
#

Reinstall

sage otter
#

Dont you use nextcord

lost lichen
#

the red is what im trying to get to work

jade tartan
#

Not any more

sage otter
#

isnt it nextcord.ext.commands

jade tartan
#

I uninstalled nextcord

sage otter
#

Uh huh.

slim ibex
sage otter
#

Don't listen to this guy btw ^^. Nextcord is one of the less favored forks.

maiden fable
slate swan
#

just use carl

maiden fable
#

Idk never used it much

slate swan
#

Carl uses pycord 💀

#

same

#

cool

final iron
slim ibex
final iron
#

God pycord is shit

#

Why would serious bot devs actually use it

maiden fable
slate swan
# final iron 🗿

For real
The old dev was rewriting it in rust and stopped with it
The new cool ones are doing it with pycord

#

imagine

slate swan
#

The new team isn't

maiden fable
supple crescent
maiden fable
slate swan
#

Time to stop using Carl bot ig

maiden fable
sage otter
lost lichen
slate swan
slim ibex
lost lichen
slate swan
#

god of s-
wtf

supple crescent
maiden fable
#

Ikr

lost lichen
slim ibex
#

in the check kwarg, you can use a lambda iirc

slate swan
#

will be back when the chat is normal.

maiden fable
#

<@&831776746206265384> someone's got an offensive Nick

#

👀

supple crescent
slim ibex
maiden fable
#

More of NSFW nick

#

Mhm

hollow quarry
#

we'll handle it

maiden fable
#

Thanks

lost lichen
supple crescent
#

shoulda been ceo, thats the common one

slate swan
#

I changed it

lost lichen
#

the check is from the docs

slim ibex
supple crescent
maiden fable
#

No thanks

supple crescent
#

can i get an autograph?

lost lichen
bitter depot
#

Let's keep things respectful please

slate swan
slim ibex
supple crescent
#

mf USername typing a whole ass thesus

slate swan
#

calm down?

bitter depot
#

There's no need for that

slate swan
lost lichen
#

server members intent?

maiden fable
supple crescent
slate swan
lost lichen
supple crescent
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.

bitter depot
#

People have a right to report users they believe aren't following our rules (including for nicknames)

sage otter
#

he also need you know

#

intents.reactions

slate swan
slate swan
maiden fable
#

Just use Intents.default()

slate swan
#

I get it

sage otter
#

Not sure tbh.

maiden fable
#

It is a default intent, yes

lost lichen
maiden fable
#

Only members and presence intent isn't

slate swan
#

It is, only member , presence and message are privelaged intents so far

sage otter
#

I just use Intents.all() and call it over with.

slate swan
#

same

slate swan
slate swan
sage otter
#

Theres not really a better.

slate swan
#

pycord is not the import, that shit uses the discord namespace.

#

hikari.Intents.ALL go brrrr

slate swan
maiden fable
slate swan
sage otter
#

Yes, for posting a light mode image.

slim ibex
#

^

maiden fable
slate swan
unkempt canyonBOT
#
The Zen of Python (line 1):

Explicit is better than implicit.

maiden fable
sage otter
#

Thats nasty

slate swan
#

imagine

maiden fable
lost lichen
slate swan
maiden fable
#

It's gonna be one from April iirc

sage otter
#

got 1-2 more months

slate swan
slate swan
maiden fable
#

Hmm

#

Meh, I got it anyways so idc

#

The v10 API already implements it

slate swan
#

rip

lost lichen
sage otter
#

When discord becomes more of a corporation rather than its original plan to be just a passion project, it releases shit like message intent

maiden fable
#

Cool

slate swan
#

1.7.3

slate swan
slate swan
#

It's included in the .default

maiden fable
#

But meh, we don't talk bout that

sage otter
#

Honestly just set your intents to all and get it over with. Lot of hassle over just enabling intents.

#

commands.Bot(intents=discord.Intents.all())

lost lichen
#

still wont work, im getting really confused now with the whole intents thing...

maiden fable
#

Lmao for some reason I enabled Intents.members but I disabled chunking to prevent huge memory uses

#

Rn, my bot only takes like 60 MB RAM

slate swan
jade tartan
sage otter
lost lichen
slate swan
#

embed.add_field

jade tartan
#

Yeah i did that but when i try to start the command it wont send me the embed

slate swan
torn sail
unkempt canyonBOT
#

add_field(*, name, value, inline=True)```
Adds a field to the embed object.

This function returns the class instance to allow for fluent-style chaining.
lost lichen
#

after the timeout it sends the thumbs down

#

which happens when there is a timeout error...

#

as per the example in the docs

sage otter
#

Remove the check and try again

#

So completely get rid of the check=check part and try again.

#

if it works that means the conditions of your check wasnt being met.

lost lichen
#

isnt it waiting still?

#

waiting until the timeout

jade tartan
#
async def start(ctx):
    embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00)
    embed.add_field(name= f"User: {ctx.author.mention}", value="✅Verified 18+✅", inline=False)
    msg = await client.wait_for('message')
    await ctx.send(embed=embed)
    print("The embed has been send")

    ```
sage otter
#

It waits for a reaction until the timeout is hit yea

jade tartan
#

Aint working

#

still

lost lichen
sage otter
#

Are you sure you completely enabled intents

lost lichen
#

yes, i enabled everything, even presence intent since discord bugged me about it: 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.

sage otter
#

Enable all three intent sliders on the panel

lost lichen
#

3?

#

i only see 2

sage otter
#

Members
Presence
Message Content

vivid marsh
#

Enable all execpt bot oath

slate swan
#

scroll down, you will see a message intents too

lost lichen
#

ah damn, didnt see it

jade tartan
#

Yeah the command doesnt get triggered

lost lichen
#

nope still wont

#

enabled all 3 and restarted bot

sage otter
#

did you restart the bot?

jade tartan
#

Me yes

sage otter
#

really.

jade tartan
#

ohh nvm

lost lichen
#

once again another restart

sage otter
#

Idk then. If its hitting the timeout and you're reacting and theres no check for the wait_for() the bot isnt getting the reaction for some reason.
Reasons:
Intents - You arent receiving the event through the gateway
Cache Limiting - The message thats being reacted to isnt in the bots message cache.

lost lichen
#

yes its timing out

jade tartan
#

Hello someone

lost lichen
slate swan
lost lichen
#

its latency to my API

#

not discord message latency

slate swan
#

in sending and receiving response yes

slate swan
#

i thot it was your discord gateway heartbeat

lost lichen
#

no, just for this test, how can i send that

#

i dont think its an issue though

autumn trench
#

how do i call one discord command from another? I'm able to get a dropdown menu working in a regular chat command, but i want it to run in a slash command. this is my code:

@bot.command()
async def test_menu(ctx):
    msg = await ctx.send(
        "This message has a select menu!",
        components=[
            SelectMenu(
                custom_id="test",
                placeholder="Choose up to 2 options",
                max_values=2,
                options=[
                    SelectOption("Option 1", "value 1"),
                    SelectOption("Option 2", "value 2"),
                    SelectOption("Option 3", "value 3")
                ]
            )
        ]
    )
    # Wait for someone to click on it
    inter = await msg.wait_for_dropdown()
    # Send what you received
    labels = [option.label for option in inter.select_menu.selected_options]
    await inter.reply(f"Options: {', '.join(labels)}")

@slash.slash(name='test',description='temp',guild_ids=[917640265475440681])
async def TEST(ctx):
    await asyncio.run(test_menu(ctx))
sage otter
#

Oh i see. now, wait by server status earlier

#

did you mean the status of a mc server?

lost lichen
#

in this specific example, yes,

sage otter
#

Because me and Ashley thought you were talking about discord servers

lost lichen
#

not discord servers, i said that before

#

im checking the status of a hosted server through my api

sage otter
#

Guess I didnt catch that

#

So why are you waiting for a reaction for again

#

what are you doing after the wait_for

lost lichen
#

waiting for a reaction

maiden fable
#

I guessed that correct in the first place then

sage otter
#

and then?

lost lichen
#

to then run more code based on that reaction

#

AKA

#

an http request

#

to then start, stop or restart that specific hosted server

sage otter
#

Either way you still the face the problem of your bot not recieving the reaction even though you're reacting

lost lichen
#

my quesiton is

sage otter
#

In your case it was likely an intents problem.

lost lichen
#

is bot correct here?? in the docs it uses client, since cogs (which is where im running this in) dont have client, im using bot, which is bot = commands.Bot(command_prefix='$', intents=discord.Intents.all())

maiden fable
#

Yes it is

lost lichen
#

ok, and the fact its running inside a cog doesnt matter?

lost lichen
#

let me copy and paste the whole example from the docs and test if it works in another command

slate swan
#

dont

lost lichen
#

??

maiden fable
#

Ah nvm

slate swan
maiden fable
#

Took it the opposite way

slate swan
#

sad

lost lichen
#

this is the command

maiden fable
#

Yea then just do ctx.bot.wait_for

lost lichen
#

the top starting

maiden fable
lost lichen
#

the example does not use cogs

#

i am using a cog

maiden fable
#

Use ctx.bot

sage otter
#

and you thought copy and pasting would work?

slate swan
maiden fable
slate swan
maiden fable
lost lichen
#

outside of a cogs

#

using default values, to make sure it even works and see if it running in a cog would be an issue

lost lichen
slate swan
#

I guess you have the amount of brain to interpret what is being done in those and incorporate them yourself

maiden fable
#

That's why just lay down for a few min lol

sage otter
#

How tho. Your timeout was getting triggered so in reality that method was working.

#

I’m so confused right now.

lost lichen
#

yeah but i think it didnt know what message to look for??

#

now i can add back the check, right?

sage otter
#

Yea

lost lichen
#

you mentioned i should not have a check inside of an elif, why?

sage otter
#

Maoi said that or whatever his name was

#

It doesn’t really matter

lost lichen
#

ok

sage otter
#

Nested functions aren’t bad.

#

I honestly had no idea what he meant

slate swan
lost lichen
#

i dont really have another option either, so

sage otter
#

AMshrug I mean do whatever works.

maiden fable
sage otter
#

Worry if it’s good or bad practice later.

slate swan
lost lichen
#

ok, yes, it works correctly now

maiden fable
#

Cool

lost lichen
#

how can i make it filter multiple different reactions?

#

if that makes any sense...

sage otter
#

Add it in the check

slate swan
#

it doesnt

lost lichen
#

ij ust copy paste everything and change the check emoji?

maiden fable
#

!d discord.Message.reactions

unkempt canyonBOT
slate swan
#

^^

maiden fable
#

Yes

sage otter
#

Nevermind then. I guess I didn’t understand the question

slate swan
maiden fable
#

Calm down

slate swan
#

am I being too rude/aggressive?

lost lichen
#

how can 1 wait_for check for multiple emojis though...

sage otter
#

Ok yes the.

#

I was right

slate swan
sage otter
#

Add it in the check

#

if reaction.emoji in [list of emojis]

slate swan
lost lichen
#

so put the check in an if condition??

sage otter
#

no

maiden fable
slate swan
sage otter
#

it gives off the same vibe who think this channel is a peanut gallery and just shits on new people for no reason.

maiden fable
maiden fable
slate swan
#

relatable pithink

slate swan
#

okimii relates, see?

sage otter
#

It’s kinda sad really how people act in this channel. Their attitude can be rather discouraging to newer developers.

maiden fable
#

Lolol

slate swan
lost lichen
#

still confused on how to make the check for multiple different emojis

sage otter
#

I gave you small example earlier tho

slate swan
sage otter
#

Sorry?

slate swan
#

:)

jade tartan
#
async def start(ctx):
    embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00)
    embed.add_field(name= f"User: {ctx.author.mention}", value="✅Verified 18+✅", inline=False)
    msg = await client.wait_for('message')
    await ctx.send(embed=embed)
    print(f"The embed has been send")

    ``` someone help me please
maiden fable
jade tartan
#

this is not getting triggered

maiden fable
sage otter
slate swan
sage otter
#

I call out the myself and the way I used to be a while ago as wells

maiden fable
maiden fable
sage otter
slate swan
sage otter
#

People who believe they are superior in short

slate swan
slate swan
maiden fable
#

I don't really think you got one tbh. U just acting like this rn cz of, uhhh, u know menstrual problems lol

maiden fable
#

Anyways

sage otter
#

The sad part is

#

The mods let a small extent of it pass

slate swan
#

lol

maiden fable
#

Haha let's just leave it Tylerr. The mods can't be everywhere

slate swan
#

hunter, enough weed for today lol

#

lmao

maiden fable
maiden fable
slate swan
sage otter
#

Never said they didn’t AMshrug

slate swan
maiden fable
sage otter
#

It is tho

slate swan
sage otter
#

That’s 100 esoteric

slate swan
#
Traceback (most recent call last):
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\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: ClientException: ffmpeg was not found.
#

rip

#

anyone know why?

#

install ffmpeg

slate swan
#

🗿

maiden fable
#

How is it related to the topic of this channel?

slim ibex
#

(lambda s,d=0:''.join([chr(sum(map(ord,c)))for c in[s[i:i+2]for i in range(0,len(s),2)]]if d else[(lambda x:chr(x)+chr(ord(c)-x))(__import__('random').randrange(0,ord(c))if ord(c)else 0)for c in s]))

quick gust
#

!ot

unkempt canyonBOT
slim ibex
#

ik 🗿

slate swan
sage otter
#

Okimii you didn’t just send a lambda you sent a low level piece of python code. Low level python is considered esoteric

slim ibex
#

anyways

maiden fable
slate swan
maiden fable
#

Lmao

maiden fable
#

Anyways

jade tartan
#

nvm it worked

maiden fable
#

@lost lichen yr issue fixed?

sage otter
#

Okimii if you bro me one more time I think I might quite literally go into a seizure.

slate swan
#

lolooooll

lost lichen
maiden fable
#

Ikrrr, feels weird when he says bro

maiden fable
slate swan
#

bro

maiden fable
#

why u do this to me

final iron
#

The whole gang is here

maiden fable
#

And I can sense us getting warned by mods again

slate swan
unkempt canyonBOT
#

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

final iron
#

I sent 1 message

slate swan
maiden fable
slate swan
#

also, did some-random-api stop receiving requests or something?

sage otter
#

This whole entire conversation is off topic. And you decide to rule 7 water when he sent one message 😭

jade tartan
#

Can i please ask a question please?

maiden fable
#

Sure

slate swan
jade tartan
maiden fable
#

Smh ash

#

Stop joking around

slate swan
# quick gust No

idk, whenever I run it with a bot command it doesnt work and when I simply use the link and open it, it works

maiden fable
#

@jade tartan what's the question

slate swan
lost lichen
#

TypeError: check() takes 1 positional argument but 2 were given

#

only one?

jade tartan
#

Well if i want the user to add his name. How do i make it do that?

quick gust
slate swan
#

because you need to check the user too

#

what if somebody else reacts other than the user who invoked the command

jade tartan
# maiden fable str(user)
async def start(ctx):
    embed=discord.Embed(title="Profile", description="Desc", color=0x00ff00)
    embed.add_field(name= f"User: {ctx.author.mention}", value=":white_check_mark:Verified 18+:white_check_mark:", inline=False)
    embed.add_field(name="Name", value="value")
    
    await ctx.send(embed=embed)
    print(f"The embed has been send")```
unkempt canyonBOT
#

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

maiden fable
#

Bro

final iron
#

🗿

lost lichen
maiden fable
#

It was used in a discord bot tho, and @quick gust already answered

lost lichen
#

didnt work tested all

slate swan
jade tartan
lost lichen
final iron
maiden fable
#

value=str(ctx.author)

jade tartan
#

embed.add_field(name="Name", value="str(ctx.author)", inline=False) Right?

lost lichen
#

no, value=str(ctx.author)

jade tartan
#

Does it have to be in a string?

red sundial
#

Its automatically a string

#

Why you putting double quotes around it

red sundial
slate swan
#

ctx.author is not a string, the value passed for add_field is converted into a string

lost lichen
red sundial
slate swan
quick gust
#

lol

vast gale
#

@slate swan did you ever sleep? glare

jade tartan
#

Like str("")

unkempt canyonBOT
#

discord/embeds.py lines 572 to 577

field = {
    'inline': inline,
    'name': str(name),
    'value': str(value),
}```
slate swan
#

but yea, true.

vast gale
lost lichen
slate swan
slate swan
#

wait, how tf did I use a list comp smh

vast gale
#

using a list comp isn't a bad thing

maiden fable
vast gale
#

^

#

i'm pretty sure its faster in most cases lol

slate swan
vast gale
maiden fable
#

Lmao u r just sleepy and don't have control on yr fingers

slate swan
maiden fable
vast gale
#

that's a juice box smh

slate swan
slate swan
slate swan
#

lmao

maiden fable
#

BTW, how r u here arl? Yesterday sadru was here, now arl... Who's next? EQ?

vast gale
#

does this seem like a bug to y'all, I don't think utils.get should be erroring if something in that iterable doesn't have an attribute

vast gale
#

then learned y'all advocate for disnake like crazy

slate swan
slate swan
#

lmao

vast gale
#

took these screenshots yesterday

lost lichen
maiden fable
#

I don't really use any fork anyways

slate swan
#

what do you use hunter?

maiden fable
slate swan
maiden fable
slate swan
vast gale
#

shit, my bots exist now to provide support and help with python code

#

i'm in a catch 22

lost lichen
#

im really lost right now

vast gale
maiden fable
#

ctx.message.reactions

lost lichen
#

i might just work on this tomorrow, its quite late and im not understanding 90% of what everyone is telling me

slate swan
maiden fable
#

Lol it's fine

slate swan
#

!d discord.Message.reactions

unkempt canyonBOT
slate swan
maiden fable
#

Ok

vast gale
#

i'll be honest I don't think that we have every feature first, but they're well tested when they're added mmlol

#

one of the big reasons we don't have our api v10 support pull request merged right now is because i found api bugs with discord when testing it

#

discord:

  • makes api v10 enforce message content
  • does not enforce message content intent on v10
slate swan
#

pithink because some people sit downstairs, and some upstairs

vast gale
#

what do you mean lol

slate swan
vast gale
#

oh lol

vast gale
#

one of the maintainers of one of them, yes

final iron
#

Which?

vast gale
#

yes, that one mmlol

#

disnake

final iron
#

Oh nice

#

Bet y'all are happy the python bot is going to start using your fork

vast gale
#

yeah lemon_pleased

final iron
#

Don't know what to say except continue the great work

grim coral
#

import discord

class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))

async def on_message(self, message):
    print('Message from {0.author}: {0.content}'.format(message))

client = MyClient()
client.run('TOKEN')

Is this good so far

slim ibex
#

use commands.Bot

#

not discord.Client

#

and f strings instead of .format()

grim coral
#

import discord

class MyClient(commands.Bot):
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))

async def on_message(self, message):
    print('Message from {0.author}: {0.content}'.format(message))

client = MyClient()
client.run('TOKEN')

Would it look like that?

slim ibex
#

if its subclassing commands.Bot you should probably name the class Bot

#

and there is no initializer

grim coral
#

import discord

Bot MyClient(commands.Bot):
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))

async def on_message(self, message):
    print('Message from {0.author}: {0.content}'.format(message))

client = MyClient()
client.run('TOKEN')

Would it look like that?

slim ibex
#

oh no

#

class Bot

grim coral
#

Oh

slim ibex
#

if you don't know OOP, learn it before making a discord bot

grim coral
#

Ok

native wedge
#

Just understand Attributes and Methods

grim coral
native wedge
#

From there you can learn to read the docs

grim coral
#

Ok I appreciate it

slate swan
#

anyone know why?

maiden fable
#

Show the whole traceback

#

@slate swan

slate swan
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\Andrew\Desktop\a\main.py", line 567, in on_message
    users = json.load(f)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
maiden fable
#

Add {} in the JSON file

slate swan
#

just this?

slate swan
#

got it

cosmic agate
#

Hi

#

Im trying to make a timer command so how to take the name of the command which has been ended

#

lemme put this into a context

#

I am trying to make a timer command that whenever the timer message is reacted on, it should ping the users who reacted when the timer is over.

#

so i cant make a new command like on_reaction_add

#

because it will take every message which has a reaction on it

#

i dont know if i added the on_reaction_add command in my timer command that if it will work

#

will api reference work?

cosmic agate
#

i tried it, but syntax error

slate swan
#

Pycord

slate swan
#

Are you using any synchronous stuffs?

slate swan
cosmic agate
#

You're here to help

#

idc about your behaviour

slate swan
#

I deeply apologise for that

slate swan
#

Do you have any while true loop or show me your external imports too

#

Ah, do you have anything like- requests, cv2 or anything

cosmic agate
#

hmm

slate swan
#

Good

#

Well i cant really tell you whats happened, goodluck

cosmic agate
#

idk

#

so i cant make a new command like on_reaction_add
because it will take every message which has a reaction on it

slate swan
cosmic agate
#

hmm

#

its async def

slate swan
#

plus its awaiting two times

cosmic agate
#

yes so ig there is a delay

slate swan
#

how do we turn a code into a bot

cosmic agate
slate swan
#

nvm

cosmic agate
#

ok

#

§u§§y baka code

slate swan
cosmic agate
#

nvm

slate swan
#

Ypu can actually use message reactions, I could just spoonfeed code instead of wasting time ngl

cosmic agate
#

nah

#

dont

slate swan
#

lol

oblique adder
#

How do I make a error handler for when a bot doesnt have a permission to do something ? Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions ?

slate swan
oblique adder
#

i cant remember

slate swan
#

!d discord.ext.commands.BotMissingPermissions

unkempt canyonBOT
#

exception discord.ext.commands.BotMissingPermissions(missing_permissions, *args)```
Exception raised when the bot’s member lacks permissions to run a command.

This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
slate swan
# cosmic agate dont
async def on_reaction_add(reaction, user):
            await 
        await ctx.send(content=f"{ctx.author.mention}",embed=discord.Embed(title="Timer", description=f"Your countdown Has ended!",colour=discord.Colour.random()))
    except ValueError:
        await ctx.reply(embed=discord.Embed(title="Timer", description="Must be a number!",colour=discord.Colour.random()))
```instead of this, do this-
```py
message = await ctx.send(embed=whateverembed)
#when loop breaks
reaction_users = await message.reactions.users.flatten() #converts the message reactors into a list
mentions = [user.mention for user in reaction_users] #user mentions in a list
mentions_to_send = ", ".join(mentions) #makes a string of all mentions which you can include in the content of the send method later
cosmic agate
#

Sh-

#

i mean thanks a lot

#

i mean thanks

green veldt
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Expected discord.Colour, int, or Embed.Empty but received str instead.

torn sail
maiden fable
maiden fable
green veldt
#

ok thanks

#

but i used code

cosmic agate
maiden fable
#

?

maiden fable
maiden fable
#

0xcode

green veldt
#

i did color = 'code'

maiden fable
#

Yea

#

Remove the quotes and do 0xcode

green veldt
#

ok thanks

#

@maiden fable

maiden fable
#

Hi

green veldt
#

i turned #03fcb1 to 0x03fcb1

maiden fable
#

Mhm

green veldt
#

okay?

maiden fable
#

Yea

green veldt
#

ok thx

maiden fable
#

Rip, your About Me has something against ToS

green veldt
#

ik

#

😂😂

maiden fable
#

Remove it then lol

green veldt
#

about me doesnt ban

#

i do not have my selfbot enabled

#

i dont enable it anytime

#

ik its against tos

#

i just had to create for experience

maiden fable
#

We don't talk bout it here

green veldt
#

ok

slate swan
#

how do we code a bot

maiden fable
#

!d discord

unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

maiden fable
#

Use this module

slate swan
#

oko

#

ok*

green veldt
#

i wanna mention a role with my bot, how to do it with role id?

maiden fable
#

!d discord.Guild.get_role

unkempt canyonBOT
maiden fable
#

!d discord.Role.mention

unkempt canyonBOT
green veldt
maiden fable
#
role = guild.get_role(...) 
role.mention
#

Pseudocode ^^^

green veldt
#

ok thanks

#

@maiden fable role = guild.get_role(role_id, /939794298633871371)

#

this okay?

maiden fable
#

No

green veldt
maiden fable
#

role = guild.get_role(id)

green veldt
#

oh ok thanks

#

i can use role.mention like this right
f'{role.mention} giveaway!'

maiden fable
#

Sure

#

But the f

#

F for the f pithink

#

!f-strings

unkempt canyonBOT
#

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

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

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

robust ridge
#

im tryna make everyone surprised
in my server
but i need help with my code

maiden fable
#

Fixed the issue?

#

the issue is...

#

U need to do edit(nick=...)

robust ridge
#
@client.command()
async def testpoo1(ctx):
    guild = ctx.guild 
    members = ctx.guild.members
    for member in members:
        await member.edit("clan member")

my error is raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: edit() takes 1 positional argument but 2 were given

robust ridge
maiden fable
#

edit(nick="clan member")

robust ridge
#

OH LOL

maiden fable
#

Also rate limit goes brrrrrrr

robust ridge
#

ok ty ill try

green veldt
maiden fable
#

okay

robust ridge
#

i tried doing in a test server but it only changed 2 ppls nickanme

#

me and my alts nickname didnt get changed

maiden fable
#

Yea

#

cz ratelimits

green veldt
maiden fable
#

That too

leaden plaza
#

hey guys I making a command to pick a winner for me like if i say !wonder it should say you won or better luck next time but the chances should be very low of winning what should i write in if statement or is there an another way to do that?

maiden fable
#

!d random.random use this

unkempt canyonBOT
#

random.random()```
Return the next random floating point number in the range [0.0, 1.0).
leaden plaza