#discord-bots

1 messages · Page 1112 of 1

tame nymph
#

no because

#

when the user registers

#

it gives them an inv attribute with all the items and amount set to 0

#

and it would madly error if I add a new item to the shop and their inventory does not have such an item

slate swan
#

Pass in guild?

tame nymph
#

or if I remove an item, my bot wouldn't recognize the item id

#

so I need a solution to update the user's inventory

#

the issue is when and how

shrewd apex
#

ic

tame nymph
#

I prefer it to be optimized

#

because I dont want to spam requests to database

shrewd apex
#

i don't see any other alternative than syncing the adding/removing item command and users inv attribute

slate swan
#

slash = app_commands.command(client, sync_commands=True)

#

This is correct?

shrewd apex
#

another way could be to let the item remain on removing but items use is deprecated and will no longer have any function

slate swan
#

@shrewd apex what is pass the guild?

shrewd apex
#

in slash commands there is a kwarg for guilds

#

@app_commands(guilds=[pass here])

slate swan
#

Global command?

sick birch
#

This seems like more of an issue with the actual database provider/database engine than your codebase

shrewd apex
#

and for limited guild_id = [guild Ids]

tame nymph
#

after they execute a command?

slate swan
#

yeah you can do that

#

there's an on_command event which gets triggered everytime someone uses a command

#

you can utilise that.

brave flint
#

essex

shrewd apex
tame nymph
#

I'll need to build a really optimized function to do this

#

I don't want to send request to db every command

#

hmm

slate swan
#

in that case you messed up as soon as chose to use a database that doesn't sync itself automatically

#

anyways, cache is your deal

cache all the stuff you want, and then push it to the database at regular intervals using tasks.loop, and then clear the task again

tame nymph
#

memory be like 5 gb

slate swan
#

tf, what are you even storing

dusky pine
#

man uses redis to store all users and data, instantly regrets it

slate swan
#
@client.command(aliases = ["lb"])
async def leaderboard(ctx,x = 1):
    users = await get_bank_data()
    leader_board = {}
    total = []
    for user in users:
        name = int(user)
        total_amount = users[user]["wallet"] + users[user]["bank"]
        leader_board[total_amount] = name
        total.append(total_amount)

    total = sorted(total,reverse=True)    

    em = discord.Embed(title = f"Top {x} Richest People" , description = "This is decided on the basis of raw money in the bank and wallet",color = discord.Color(0xfa43ee))
    index = 1
    for amt in total:
        id_ = leader_board[amt]
        member = client.get_user(id_)
        name = member.name
        em.add_field(name = f"{index}. {name}" , value = f"{amt}",  inline = False)
        if index == x:
            break
        else:
            index += 1

    await ctx.send(embed = em)
``` this only sends 1 user who is the richest in the guild, i want this to send every users balance above 15k
#

Guys how can we make a running status in dpy in bot status like it's on screen lines run from left to right

dusky pine
#

a marquee?

#

have you tried to implement anything yet?

slate swan
#

Hmm I searched fir it but not got

dusky pine
#

don't google it, make it yourself

tacit aspen
#

guys i have question its not specifically related to discord bots but well
is doing something like this against discord tos or smth? i wanted to confirm before i do it lol i saw it on a yt video

dusky pine
#

it's just grabbing all messages in channel

slate swan
alpine cove
dusky pine
#

but if the token is a user not a bot, then that's against ToS

slate swan
#

seems like bad code but you do you

shrewd apex
#

requests is sync...

alpine cove
shrewd apex
#

💀

slate swan
shrewd apex
#

ikr

alpine cove
#

u got it

tacit aspen
tacit aspen
#

idk what that is lol but is it legal

shrewd apex
#

no

tacit aspen
dusky pine
#

where's pokethree

alpine cove
slate swan
#

oh wait i just saw the auth header so yes it is against tos

#

😭

tacit aspen
#

f is there some other way to retrieve the messages

slate swan
#

a bot

alpine cove
dusky pine
alpine cove
#

ohh loool

#

nvm then

shrewd apex
#

keep notifications on ig 💀

slate swan
shrewd apex
slate swan
#

why

slate swan
cerulean folio
#
asyncio/events.py:80: RuntimeWarning: coroutine 'select_subject' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

guys I'm getting this error I don't even know why 😭
(I made sure I write await select_subect())

slate swan
#

why recommend that lib

#

!rule 5

unkempt canyonBOT
#

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

shrewd apex
tacit aspen
#

no one's helping me i was just confirming if its legal or not , i deleted the script 😭

alpine cove
shrewd apex
#

no way to help mate self botting is illegal

slate swan
#

@app_commands.command(
  name = "lol",
  description = "hey",
  guild_id=None
)
async def hello(ctx):
  await ctx.send(f'Bot speed -{round(client.latency * 1000)}ms')
slate swan
dusky pine
#

it is not legal, negatory, not, nuh-uh, null, undefined, None

slate swan
#

Correct?

cerulean folio
shrewd apex
dusky pine
slate swan
slate swan
#

Disnake and some other forks use that

slate swan
#

@alpine cove so?

dusky pine
slate swan
shrewd apex
#

ic

#

never used slash so 🤷

#

my bad piyush

slate swan
slate swan
#

No problem

dusky pine
#

just use disnake or pycord or whatever

slate swan
#

anything but not pycord

slate swan
dusky pine
dusky pine
slate swan
#

Just give me a hint

slate swan
slate swan
#

iirc changing the bots presence is 2/120s

shrewd apex
#

it has to be atleast 16fps👀

slate swan
#

bro

slate swan
slate swan
#

apparently its working for me

alpine cove
slate swan
#

im confused on what the person wants if its a huge status or changing a status many times like a neon sign that rotates

slate swan
#

seen it and its something else

unkempt canyonBOT
#

@alpine cove :white_check_mark: Your eval job has completed with return code 0.

001 | Hello world
002 | dello worlH
003 | Hello world
004 | dello worlH
005 | Hello world
006 | dello worlH
007 | Hello world
008 | dello worlH
009 | Hello world
010 | dello worlH
011 | Hello world
slate swan
#

"pycord bad" essay time?

#

ill write one, wait

alpine cove
slate swan
#

pls no

cerulean folio
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

shrewd apex
#

!e

string = 'Hello World'
lst = [string[i:] +string[:i] for i in range(len(string))]
for i in lst: print(i)
unkempt canyonBOT
#

@shrewd apex :white_check_mark: Your eval job has completed with return code 0.

001 | Hello World
002 | ello WorldH
003 | llo WorldHe
004 | lo WorldHel
005 | o WorldHell
006 |  WorldHello
007 | WorldHello 
008 | orldHello W
009 | rldHello Wo
010 | ldHello Wor
011 | dHello Worl
slate swan
#
  1. overriding discord namespace? who tf asked for it?
  2. messing with paths:
    • discord.Bot ( why tf does that exist) is a subclass of discord.Client
    • and then they re-subclass commands.Bot from discord.Bot, ew.
  3. Bad typing, literally worse than discord.py
  4. the pip command installs 1.7.3 by default ( why? )
  5. bad code, the only part that is considerable is either from Danny, or swas.py and some code which was stealed from discord.py pull requests ( yes, im talking about the voice recieve feature)
cerulean folio
#

https://paste.pythondiscord.com/lucisoyumo

  add_rep = [
      rq.get_alts(subject),
      rq.get_reason(subject),
      rq.get_proofs(subject)
  ]

I replaced this part, with this one:

  add_rep = [
      rq.get_alts,
      rq.get_reason,
      rq.get_proofs
  ]
#

these have nothing to do with async lmao

#

The error that should have show up didn't, and those that didn't have to show up did

#

I don't even get who this happened XD

cerulean folio
#
string = 'Hello World'
lst = [string[i:] +string[:i] for i in range(len(string))]
while True:
  for i in lst:
    sys.stdout.write(f'\r{i}')
    time.sleep(.1)
dusky pine
#

it would be cool if you added \r

cerulean folio
cerulean folio
#

I'll make a little super mario infinite walk XD

quiet badge
slate swan
#

just learn nodejs/python and code ur bot lol

dusky pine
#

use whatever you want

#

whoever insists you use whatever language they like, most likely skid

slate swan
#

if you're insisting someone to use a language, be ready to guide them lol

#

"just use Google" is really invalid, especially with discord bots

slate swan
#

and use rust

#

🚀

slate swan
quiet badge
#

openai is pretty funny sometimes

slate swan
slate swan
unkempt canyonBOT
slate swan
# slate swan !ot

Im deeply sorry about this situation. i hope you find a place in your heart to forgive me and my ignorance.

#

ah crap, not this again

#

💀

grim oar
#

Okami

slate swan
#

nova

slate swan
tough lance
cerulean folio
#
def clear_alts():
  con = sqlite3.connect(os.path.join(BASE_DIR, "salus.sqlite"))
  cur = con.cursor()
  update ='UPDATE scammers SET alts = NULL'
  cur.execute(update)
  con.commit()
  cur.close()
  con.close()
  return True

In this code, is cur.execute(update) correct?

slate swan
cerulean folio
#

oh okie

#

thank you @slate swan ZhongHeart

slate swan
#

prettythumbsup use aiosqlite man, just need to await at some points

placid skiff
#

or work with the same istance of the connection D_D lmao

slate swan
#

yeah that too

slate swan
warm tulip
winter gull
#

which verson of discord.py support threads making via bots?

slate swan
winter gull
#

and which python version is required?

slate swan
winter gull
#

alr tysmm

cerulean folio
warm tulip
slate swan
slate swan
tough lance
#

By block meaning slow down

cerulean folio
cerulean folio
cerulean folio
#

yes ! :D

slate swan
#

ah

#

then use the setup hook to do that

#

are you subclassing the Bot class?

cerulean folio
#

no i don't know this fancy stuff yet

#

it's my first bot

tough lance
#

You don't know python? 🙃

cerulean folio
tough lance
#

Oh ok

#

Understandable

cerulean folio
#

yeah not everybody has a brain ^^

slate swan
#

wha-

cerulean folio
tough lance
#

Well

#

I gave a random answer also 🙃

cerulean folio
#
bot = commands.Bot(command_prefix = '!', intents = discord.Intents.mock())
tough lance
#

So yh you're not subclassing

cerulean folio
#

yeah there are no classes in Pascal language

tough lance
#

So if you use sqlite3, its not asynchronous and your bot will have to wait if two commands related to dB are used simultaneously. So the bot will complete one command then second command

cerulean folio
#

oh aight thanks

tough lance
#

Using aiosqlite this won't be a problem

cerulean folio
#

yeah I knew about that but I drowned into coding other functionnalities and forgot to transfer to aiosqlite. but i'll do thanks for the explaination :D

slate swan
slate swan
#

centimetre?

paper sluice
#

contextmanager

slate swan
#

no

#

it's just an example so...

cerulean folio
#

I don't do these fancy class things, can't I just do

import discord
import aiosqlite

con = sqlite3.connect(os.path.join(BASE_DIR, "db.sqlite"))
cur = con.cursor()

and that's it?

paper sluice
#

there is nothing fancy about it, writing a command is harder than that

cerulean folio
#

oh yeah um... ok i assume i should read some documentation and come back

#

apologies

slate swan
#

I just gave an example.....
😭

slate swan
cerulean folio
#

but i don't use code that i don't understand

#

my bot is working fine right now so, i'll just recode the sql functions into aiosqlite and that's it

#

after the bot is online and people use it, i'll reshape it into a better version using classes and opitmization

slate swan
placid skiff
cerulean folio
cerulean folio
placid skiff
#

OOP is fundamental for d.py, since there are a lot of classes

cerulean folio
#

yeah i assume it is

#

for now i just need the bot to be online asap, and then i'll improve it and learn through that

slate swan
#

well, your wish

cerulean folio
#

yeah, there's thousands of people waiting for it, + putting it online would give me a break from 10 days of 24/7 coding, and a taste of achievement

#

because I feel that if I keep struggling a few more days, i'll just give up, like I always did when I try to be perfectionnist

#

which is why I ended up not knowing python classes... 😊

#

sometimes you gotta aim a bit lower and reward yourself with some achievement

paper sluice
#

damn, deep

slate swan
#

half the things are unnecessary for any normal user

slate swan
#

just overwrite the method

#

how...?

#

oh wait nvm

#

:))

#

bot.setup_hook = func?

#

yes

#

no

#

why not? ._.

#

sub-classing looks better tbh meh

#

and you can get type hints

#

i cant argue with that but it wasnt really my point

slate swan
slate swan
dusky pine
slate swan
#

lmao

#

download not_a_virus.exe

unkempt canyonBOT
#

lib/cogs/test.py line 1

from disnake.ext.commands import *```
slate swan
#

nice

slate swan
#

dont call me that either

#

call me oki or okimii :))

dusky pine
#

can I call you mine

slate swan
#

yes

#

lmao, what do people in the dpy server and this server have with songs smh

#

the repo has ClassNaming/UpperWord and in a folder its names __init__.py and it doesnt even initate the folder😔

#

fr

dusky pine
#

it is called PascalCase

slate swan
#

in pep8 its referenced as UpperWord and CamelCase

dusky pine
#

wtf

slate swan
#

!pep 8

unkempt canyonBOT
#
**PEP 8 - Style Guide for Python Code**
Status

Active

Created

05-Jul-2001

Type

Process

dusky pine
#

UpperCamelCase

#

It's called pascal case damn it

slate swan
#

camelCase is this one

#

PascalCase is this one

#

¯_(ツ)_/¯

#

nope

#

CamelCase != camelCase

#

wtf

#

people just call them differently

#

but in pep8 its referenced as so, i dont make the rules

#

¯\_(ツ)_/¯

#

what's this then wtf

#

check function or class naming

#

I'm confused now

#

¯\_(ツ)_/¯

dusky pine
#

let's get this straight

pascal case - MyObject
camel case - myObject
snake case - my_object

slate swan
#

camel case has 2 instances 1 hump aka camelCase and 2 hump aka CamelCase

#

sad kebab case 😔

slate swan
vocal snow
slate swan
#

i know the truth is hard to accept but pep8 said so😔

#

so thats why i changed to rust

slate swan
#

😳

dusky pine
#

my🥙object🥙in🥙kebab🥙case

slate swan
#

smh

#

okimmi-is-a-cute-kiddo

#

¯_(ツ)_/¯

dusky pine
#

sounds like what a man with a white van would say

slate swan
slate swan
#

smh everyone out here misspelling my name😔

slate swan
#

but maybe ¯_(ツ)_/¯

slate swan
#

oh

dusky pine
#

wow, hello then _ _ , interesting name

slate swan
#

btw let's keep it on topic

#

i dont even exist

#

nobody asked

dusky pine
#

🗿

slate swan
#

since you don't exist

slate swan
dusky pine
#

yeah yeah

slate swan
#

.topic

lament depotBOT
#
**What's one feature you wish more developers had in their bots?**

Suggest more topics here!

dusky pine
slate swan
dusky pine
slate swan
#

someone submit more questions 😩

slate swan
slate swan
#

well yeah since every single reaction takes an api request

#

thats the ratelimit idk i forgot

#

plus buttons can have emojis😔

slate swan
#

that wasnt my point but ok🗿

#

lmao

#

.topic

lament depotBOT
#
**What feature would you be the most interested in making?**

Suggest more topics here!

slate swan
#

modals

dusky pine
#

and a full featured API with ratelimiting

slate swan
#

with React?

dusky pine
#

react

#

yes you heard that right

#

i'm predicting you're gonna mention Svelte or something similar

slate swan
#

👀

#

web dashboard? for what?

#

for your bot

#

e.g mee6

#

create a REST API instead of a dashboard with UI

dusky pine
#

i mean, you can't make dashboard without API

slate swan
#

i wanna try making a restful api with rust

slate swan
#

and then wrap it in py

#

ew

#

js better

dusky pine
slate swan
slate swan
#

🗿

#

Rust is statically typed, fast, is compiled, memory safe and its syntax is lovely

dusky pine
#

its syntax is lovely
sure

slate swan
modern fiber
#

How do I remove this space? (eaither title or field name)

slate swan
modern fiber
#

Like how do I make it like this

slate swan
#

why have a bold description and not use a title

#

^

slate swan
unkempt canyonBOT
#

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

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

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

New in version 2.0.

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

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

the title kwarg

modern fiber
#

It's not, it's just name

slate swan
#

and why a field it looks like a description😭

#
fn main() {
    println!("Hello World!");
}

imagine not using cpp at this point meh

modern fiber
slate swan
modern fiber
#

just lemme know what to do please

#

should I remove a name and put invisible symbol and put it as title then

slate swan
dusky pine
#

okay why the fuck is there an exclamation mark in that println

modern fiber
slate swan
modern fiber
#

So like this?

slate swan
dusky pine
#

what is a macro.

slate swan
modern fiber
#

mmm

slate swan
#

better use the title and description as okimmi said

#

okimii*

slate swan
#
embed = discord.Embed(title='How do i become a staff Member?', description='You can apply.....',).set_thumbnail(url='https://media.discordapp.net/........................')
#

😔

slate swan
#

its easier to read documentation over hard coding something

modern fiber
#

tysm

modern fiber
#

čć

slate swan
#

!d discord

unkempt canyonBOT
#
slate swan
unkempt canyonBOT
#

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

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

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

New in version 2.0.

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

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

ty

slate swan
#

you just need to know oop really

#

and have common sense-

#

thats hard

cloud dawn
#

I don't have both and turned out okish

loud junco
#

im back after centuries

slate swan
slate swan
slate swan
cloud dawn
slate swan
#

oh

loud junco
loud junco
slate swan
#

😭

loud junco
#

that's what u ask for 😂😂😂

slate swan
#

python discord question: why does it keep responding to messages that isnt in message.content.lower? it doesnt respond to bots, just normal users?

async def on_member_join(member):
   await client.get_channel(971319830064017458).send(f"Welcome {member.mention}, this is our proofs channel!", delete_after=30)


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

    if 'hello' in message.content.lower():
        await message.channel.send(random.choice(greetings))
        time.sleep(1)
        await message.channel.send(random.choice(cq))```
cloud dawn
#

"why does it keep responding to messages that isnt in message.content" what do you mean?

slate swan
#

i have e defined as e = client.get_channel(. . .)

cloud dawn
#

This responds when there is a character combination of that with "hello"

cloud dawn
slate swan
#
@client.command()
async def suggest(ctx,*,suggestion):
  await set_sug(ctx.guild,ctx)

  guilds = await get_sug()

  chn = guilds[str(ctx.guild.id)]["channel"]

  e = client.get_channel(chn)

  e1 = discord.Embed(title=f"Suggestion from {ctx.author.name}", description=suggestion, color=discord.Colour.og_blurple())
  e1.set_author(name=ctx.guild.name)

  async with ctx.typing():
    r = await e.send(embed=e1)
    r.add_reaction(":arrow_up:")
    r.add_reaction(":arrow_down:")
cloud dawn
#

I recommend defining e as ```py
e = client.get_channel(...) or await client.fetch_channel(...)

#

What is chn?

slate swan
quaint epoch
slate swan
cloud dawn
slate swan
#

Yah

cloud dawn
#

!d not

unkempt canyonBOT
#
not

6.11. Boolean operations¶


or_test  ::=  and_test | or_test "or" and_test
and_test ::=  not_test | and_test "and" not_test
not_test ::=  comparison | "not" not_test
``` In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: `False`, `None`, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true. User-defined objects can customize their truth value by providing a `__bool__()` method.

The operator [`not`](https://docs.python.org/3/reference/expressions.html#not) yields `True` if its argument is false, `False` otherwise.
quaint epoch
# slate swan ?

That line makes the code under it unreachable if the user that sent the message is a bot

quaint epoch
# slate swan ?

That line makes the code under it unreachable if the user that sent the message is a bot

slate swan
slate swan
cloud dawn
cloud dawn
quaint epoch
slate swan
#

Is it not possible to do something like that?

slate swan
cloud dawn
cloud dawn
slate swan
#

I did

cloud dawn
#

Have you tried it?

slate swan
#

yea

#

That’s the only reason I came here

cloud dawn
#

That's not what I suggested.

#

I suggested to use this ```py
e = client.get_channel(...) or await client.fetch_channel(...)

slate swan
#

mhm

slate swan
cloud dawn
unkempt canyonBOT
#
not

6.11. Boolean operations¶


or_test  ::=  and_test | or_test "or" and_test
and_test ::=  not_test | and_test "and" not_test
not_test ::=  comparison | "not" not_test
``` In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: `False`, `None`, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true. User-defined objects can customize their truth value by providing a `__bool__()` method.

The operator [`not`](https://docs.python.org/3/reference/expressions.html#not) yields `True` if its argument is false, `False` otherwise.
placid skiff
slate swan
#
    @discord.ui.button( emoji = f"{e_checkMark}", style=discord.ButtonStyle.green, row=1)
    async def iron_yes(self, interaction: discord.Interaction, button: discord.ui.Button):
        embed = discord.Embed(
            description= "Проверяем вас на судимость наличие должности в другой компании..", 
            color= 0x00b300
        )
        img = Image.open("./ImageO/Экономика/Work/Договор_Железо.png")

        url = str(interaction.user.display_avatar)
        url1 = requests.get(url, stream = True) 
        url1 = Image.open(io.BytesIO(url1.content))
        url1 = url1.convert('RGBA') 
        url1 = url1.resize((154, 147), Image.ANTIALIAS)
                  
        img.paste(url1, (165, 155))
        img.save("./ImageS/Договор.png")

        file4 = discord.File("C:/bot py/ImageS/Договор.png", filename="D.png")
        embed.set_image(url= 'attachment://D.png')
        embed_dict = embed.to_dict()

        embed= discord.Embed.from_dict(embed_dict)
        await interaction.edit_original_message(attachments = [file4], embed= None)
        os.remove("./ImageS/Договор.png")

Dear tell me why he does not delete the picture?

slate swan
cloud dawn
unkempt canyonBOT
#

@cloud dawn :white_check_mark: Your eval job has completed with return code 0.

My time to shine
cerulean folio
#

guys my bot has to get images from links and attachments and save their links in database. however since it's linked to a ticket system the channel get delete after command use and images disappear. what do u guys suggest?

dusky pine
cloud dawn
cerulean folio
#

for the amount of images I will have to store

cloud dawn
slate swan
#

(((

slate swan
#

try: C:/bot py/ImageS/Договор.png

slate swan
dry kelp
#

How can i use this?

slate swan
slate swan
dry kelp
#

pycord

#

or how can i pull application commands id by HTTP

slate swan
#

use brain

dry kelp
#

is not a coroutine so i can't use await 🤔

dusky pine
slate swan
#

¯_(ツ)_/¯

dry kelp
#

i tried printing it and it prints as none lol 😂

slate swan
#

also, guild_ids should have integers, not strings

#

that's why it aint working most probably

dry kelp
#

yeah but it's guild_ids... you have to use it as a list

#

well im trying to get the command in the guild where it's registered

slate swan
dry kelp
#

i can assure u that without guild ids is still going to be none

#

lemme try actually

#

yep still none

slate swan
#

try doing it without guild_ids

#

else, hard luck

#

ask in the pycord server then

dry kelp
#

i did. still none

#

already tried

slate swan
dry kelp
#

🙍

#

i did already like 8 hours ago

slate swan
#

hard luck

dry kelp
#

it worked

#

idk how to cuz i didn't do anything

#

💀

#

it's not there anymore lol

slate swan
#

...

cloud dawn
# slate swan cursed-

Me when you where typing that ```py
@property
def latency(self) -> float:
return round(super().latency * 1000, 2)

slate swan
#

¯_(ツ)_/¯

slate swan
#

lmao what

cloud dawn
#

I thought I was doing something illegal

slate swan
#

lmao

warm tulip
#

hey guys i was using a website for coding discord bot but rn im coding with pycharm and i cant import discord

#

help

slate swan
cloud dawn
warm tulip
#

hey guys i was using a website for coding discord bot but rn im coding with pycharm and i cant import discord
help

cloud dawn
cloud dawn
warm tulip
#

no i just type import discord and it says discord not found......

cloud dawn
#

Have you installed it?

warm tulip
#

i innstalled discord on my pc

#

ya

slate swan
slate swan
warm tulip
#

offfffffffffff

cloud dawn
warm tulip
#

wym where

slate swan
paper sluice
slate swan
#

lmao

cloud dawn
# slate swan it isnt?

Any method is good ig, when using run you get thrown inside a context anyways but run is a bit more ugly in the library I think danny want to deprecate it.

slate swan
slate swan
cloud dawn
warm tulip
#

pandabweer i have it on the : LOCAL DISK C

#

ig

#

ahhhhhhhhhh helpppppppppppp

cloud dawn
warm tulip
#

umm

#

what is dpy

#

no i just maked a project

#

how i can download it

cloud dawn
#

In pycharm go to python packages and then search for discord.py

slate swan
#

smh

warm tulip
#

ok

#

where is pakeges???????????

#

oh i found it

#

installing......

slate swan
unkempt canyonBOT
warm tulip
#

its still 0

#

its noot downloading

cloud dawn
slate swan
#

0 is False 😔

warm tulip
cloud dawn
#

exit with 0

#

gut

warm tulip
#

wym

slate swan
#

lmao

shell wing
#

So i want to make a slash command in which a user can send an image/gif through it instead of a message.....any idea hows that possible ?

warm tulip
#

updating indexses ig......

#

lagggggggggggg

warm tulip
#

thanks its ok now

shell wing
warm tulip
#

can i set 2 prefixes for a bot?

shell wing
cloud dawn
placid ore
#

hi all, if possible how can i get previous messages on a channel via discord.py?

warm tulip
#

how?

slate swan
slate swan
unkempt canyonBOT
#

async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the destination’s message history.

You must have [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.

Examples

Usage...
placid ore
#

oh

warm tulip
#

bot = commands.Bot(command_prefix="+", "~") ??

slate swan
#
bot = commands.Bot(command_prefix=("!", ".", "uwu"))
placid ore
#

thanks <3

slate swan
cloud dawn
shell wing
slate swan
#

^

shell wing
slate swan
#

it's discord with some other crappy library

#

nope

paper sluice
slate swan
#

😔

shell wing
#

for slash ^

paper sluice
#

@shell wing type show discord.py in ur terminal and show result

slate swan
#

ew

paper sluice
shell wing
slate swan
#

😔

cloud dawn
#

Never had any issues.

paper sluice
slate swan
#

it's easy, I can say that after using hikari-lightbulb

shell wing
cloud dawn
#

Ahsley tryna lure people to hikari

slate swan
paper sluice
cloud dawn
#

Me who just syncs in setup hook

#

No clue what you are talking about.

slate swan
#

^

shell wing
slate swan
#

yes

shell wing
#

alr ? ig

slate swan
# shell wing ehhhh

just run pip uninstall lib1 lib2 lib3 lib4 lib5 replace the name of the libraries with lib#

cloud dawn
#

I'm still only syncing guild-only, I'm planning on making a custom sync solution, I've already got a custom solutions for Group "cogs".

dusky pine
#

ashley

slate swan
#

skill

dusky pine
#

why u keep using uwu as examples

slate swan
#

because im too uwu

dusky pine
#

😳

cloud dawn
#

discord.Client

#

What's you solution regarding extensions?

slate swan
#

panda comes with his high end crap (crap for me cz I dont understand a thing) for loading extensions

shell wing
#

removing libs is soo much work 🥱

dusky pine
#

pip uninstall

shell wing
#

wasnt working lmaoo

#

Ok now it does XD

merry cliff
#

why does a function work when i call it in the code but if it is called through a command it no work???

merry cliff
#

it seems to stop when i try to os.listdir()

dusky pine
#

os.listdir() returns a value, it does not print it

merry cliff
#

like if I use function() in the code it works

#

but if I run function() as part of a command for the bot

#

it doenst work

#
def delete_old_data():
    print('requested old data delete')
    files = list(os.listdir('../cogs/hystats-data/'))
    print(files)
    print('created list of files')
    for file in files:
        x = os.stat('../cogs/hystats-data/'+file)
        age = (time.time() - x.st_mtime)
        print('found age of all files')
        if int(age) >= 1:
            os.remove('../cogs/hystats-data/'+file)
            print(f'deleted {file}')
        else:
            print(f'kept {file}')
            pass
    print('deleted data')
    return True``` works when I just run this code but not when the bot tries to run it
slate swan
warm tulip
#

HEY guys how i can run bot with token

merry cliff
#

which ver of dpy?

slate swan
warm tulip
#

:::?//

merry cliff
#

bot.run('TOKEN')

slate swan
#

^

warm tulip
#

thanks

merry cliff
#

what about me

slate swan
warm tulip
#

heyyy

#

when i start the code in pycharm

#

it dosent on the bot

merry cliff
#

no

#

it just doesnt responf

warm tulip
#

it says : Process finished with exit code 0

warm tulip
#

what i have to dooooo

merry cliff
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

merry cliff
#

full code

shell wing
warm tulip
#

wymm

#

i have to paste those codes in main.py ?????????????

merry cliff
#

no

slate swan
merry cliff
#

thats a cog

slate swan
warm tulip
#

uh lol

slate swan
#

show code

warm tulip
#

so ig no one helps me

merry cliff
#

its in the pastebin link

slate swan
shell wing
#

i deleted all of them !!!!!

merry cliff
#

must be satisfying

warm tulip
#
import asyncio
import random
from discord.ext import commands

bot = commands.Bot(command_prefix=("+", "~", "!"))

bot.remove_command("help")

@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.online, activity=discord.Game(name=" +help, ~help, !help "))

    bot.run("amogus")```
merry cliff
#

no

#

dont run it inside a function

warm tulip
#

oh

slate swan
merry cliff
#

also yo can just do help_command=None while definig bot

#

I think they dont want to leak their token lol

slate swan
shell wing
#

the required ones

slate swan
#

oh okay cool

warm tulip
#
import asyncio
import random
from discord.ext import commands

bot = commands.Bot(command_prefix=("+", "~", "!"))

bot.remove_command("help")

@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.online, activity=discord.Game(name=" +help, ~help, !help "))

    bot.run('idk')```
??????
slate swan
merry cliff
#

OUTSIDE of the function

shell wing
slate swan
#

nice

shell wing
#

alrr

merry cliff
#
import discord
import asyncio
import random
from discord.ext import commands

bot = commands.Bot(command_prefix=("+", "~", "!"))

bot.remove_command("help")

@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.online,activity=discord.Game(name="+help,~help,!help "))

bot.run('idk')```
slate swan
merry cliff
#

outside of the function

#

I did

warm tulip
slate swan
#

why remove help command 😭

merry cliff
#

it stops just before os.listdir

dusky pine
merry cliff
#

yes

dusky pine
#

"removing the spaces" called un-indenting

slate swan
slate swan
dusky pine
#

default help cmd ugly ugly

warm tulip
#

it workeddddddddddd

slate swan
#

no

#

to subclass HelpCommand

#

its ugly

#

subclass it

warm tulip
#

thanks guys

merry cliff
#

also a valid option

slate swan
#

dont tell me you guys hardcode your help commands...

dusky pine
#

we totally don't iterate over the commands property

merry cliff
#

YESIDOANIMSODUMB

slate swan
cloud dawn
#

All the time it allows for fine tuning.

cloud dawn
slate swan
merry cliff
dusky pine
dim tapir
slate swan
#

no

slate swan
dim tapir
cloud dawn
slate swan
dim tapir
dusky pine
#

and also rename ur commits to just an underscore

slate swan
slate swan
cloud dawn
dusky pine
#

i see

cloud dawn
slate swan
dim tapir
#

interesting

cloud dawn
#

I feel like I'm being judged.

dusky pine
#

whenever I subclass HelpCommand my code is filled with list comprehensions

#

and now it's too idiomatic it looks like absolute shit

#

it isn't even idiomatic it's idiotic

dawn shard
dim tapir
#

what if u wanted to redesign the help command

#

u would have to take down the bot

#

and then upload ur new work

slate swan
dawn shard
#

oh i see

slate swan
#

me 3 months ago

#

lmao

dim tapir
#

oh my

slate swan
#

I know it looks ugly but who cares, I rewrote the bot so uhh

dim tapir
#

did u do it on purpose

slate swan
dim tapir
#

3 months

slate swan
#

yeah...

dim tapir
#

good improvement i approve

slate swan
#

I uhh

#

discord bots ain't hard, just learn to read the docs and stop writing crappy code ¯_(ツ)_/¯

dim tapir
#

not about discord bots about the quality of ur code

warm tulip
#

guys why its not working ?

    async def help(self, ctx: commands.Context):
        embed = discord.Embed(title="Help Menu:", description="** **", color=0x79ff00)
        embed.add_field(name="Meme", value="Bot Will Send A Funny Meme.\nUsage: !meme, +meme, ~meme", inline=false)
        await ctx.reply(embed=embed)```
dim tapir
#

whats the error? or no error?

slate swan
#

but for loops.....ew ew

warm tulip
#

Traceback (most recent call last):
File "D:\Rolex project\venv\lib\site-packages\discord\ext\commands\bot.py", line 606, in _load_from_module_spec
spec.loader.exec_module(lib)
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1017, in get_code
File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\Rolex project\venv\commands.py", line 49
def setup(bot: commands.Bot):
^
IndentationError: unindent does not match any outer indentation level

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

Traceback (most recent call last):
File "D:\Rolex project\main.py", line 14, in <module>
bot.load_extension("commands")
File "D:\Rolex project\venv\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "D:\Rolex project\venv\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'commands' raised an error: IndentationError: unindent does not match any outer indentation level (commands.py, line 49)

Process finished with exit code 1

slate swan
#

!indents

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
#

😔

cloud dawn
#

😐

slate swan
#

sorry Panda

warm tulip
#

helppp

cloud dawn
cloud dawn
dim tapir
#

github copilot do be doing everything for me right now

slate swan
#

~~ bot sends a funny meme omg~~

slate swan
warm tulip
slate swan
#

how do i change my bot's status from online to idle or something?

slate swan
unkempt canyonBOT
slate swan
#

to the status kwarg

#

!d discord.Client.change_presence if you're doing it later

unkempt canyonBOT
#

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

Changes the client’s presence.

Example

```py
game = discord.Game("with the API")
await client.change_presence(status=discord.Status.idle, activity=game)
```   Changed in version 2.0: Removed the `afk` keyword-only parameter...
slate swan
#

ty

left vector
#
            await message.channel.send('leaving..')
            await message.channel.send('left')
            await message.channel.send('rejoin? type yes or no')
            if message.content == 'no':
                await message.channel.send('you picked no')
            elif message.content == 'yes':
                await message.channel.send('you picked yes')
            else:
                await message.channel.send('you didnt pick anything')```
how do i make this: wait for the users response instead instantly going to else and saying that it didnt pick anything
slate swan
# slate swan to the `status` kwarg
bot = commands.Bot(..., status=discord.Status.idle) #discord.Status.online, discord.Status.dnd, discord.Status.offline #or just use what uwu sarthak said
left vector
#

basicaly how do i make this wait for the user to response

slate swan
#

discord games?

slate swan
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.10)"). 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.10)") 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.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
left vector
#

like this thing

dusky pine
#

against ToS

#

selfbotting

grim oar
#

^

dim tapir
#

banned moment

left vector
#

IT IS?

dim tapir
left vector
#

.. oh crap

slate swan
#

yeah

left vector
#

i did not know that....

#

...mega bruh

#

i should prob use a discord bot then....

dim tapir
#

dw just dont do it

cloud dawn
#

!d aiohttp.ClientWebSocketResponse.send_str

unkempt canyonBOT
#

coroutine send_str(data, compress=None)```
Send *data* to peer as [`TEXT`](https://aiohttp.readthedocs.io/en/stable/websocket_utilities.html#aiohttp.WSMsgType.TEXT "aiohttp.WSMsgType.TEXT") message.
left vector
#

whats that

slate swan
slate swan
#

it will just show Playing with the API as the activity/status of the bot

#

wherever you're setting it

#

ohh

cloud dawn
left vector
#

oh

clever hamlet
#

is there anyway to connect a file into another file?

slate swan
cloud dawn
#

!d import

unkempt canyonBOT
#

7.11. The import statement¶


import_stmt     ::=  "import" module ["as" identifier] ("," module ["as" identifier])*
                     | "from" relative_module "import" identifier ["as" identifier]
                     ("," identifier ["as" identifier])*
                     | "from" relative_module "import" "(" identifier ["as" identifier]
                     ("," identifier ["as" identifier])* [","] ")"
                     | "from" relative_module "import" "*"
module          ::=  (identifier ".")* identifier
relative_module ::=  "."* module | "."+
```...
grim oar
dim tapir
#

how do i pass args when loading a cog

clever hamlet
dim tapir
#

i want to pass a object

slate swan
clever hamlet
#

sorry im just new here

slate swan
#

Hey, i have problem with message.content.

    try:
        print(f"Message: {message.content} ") ```
#

wait, but why

#

no wait, you can

dusky pine
slate swan
#

wdym

dusky pine
#

do you know what intents are

slate swan
#

nope

#

all the other messages were just images/embeds

slate swan
# dim tapir i want to pass a object
class Cog(commands.Cog):
  def __init__(self, bot: commands.bot, arg1, arg2):
    ...

#while loading

bot.add_cog(Cog(bot, "uwu_arg_one", "uwu_arg_two"))
dim tapir
#
#level.py
class Level(commands.Cog):

    def __init__(self, client, console):
        self.client = client
        self.console = console

#bot.py
for filename in os.listdir("./cogs"):
    if filename.endswith(".py"):
        _console.print(f"Loading extension: {filename[:-3]}", 1)
        # i want to pass _console as a arg
        client.load_extension(f"cogs.{filename[:-3]}")
slate swan
clever hamlet
#

#bot-commands

#

sorry

slate swan
#

just make console an attribute of the bot.

dim tapir
slate swan
clever hamlet
#

can someone help me to make an IDE

#

oops

slate swan
#

how do i give a time using
type=discord.ActivityType.playing ?

clever hamlet
#

my bad wrong channel

slate swan
#

ohh

dim tapir
slate swan
slate swan
unkempt canyonBOT
#

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

your console
dim tapir
#

dat didnt work my brother

slate swan
dim tapir
#
_console = Console()

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

client = commands.Bot(command_prefix = ',', intents=intents)
# create a new attribute for the bot called console
client.console = _console
slate swan
#

yeah and what did you do after that?

dim tapir
#

wait nvm im dumb af my bad

#

i forgot i added another argument and didnt specify it

slate swan
potent spear
slate swan
#

its a rich presence, not supported by bots

slate swan
shrewd apex
slate swan
#

and put the my_task.start thing

slate swan
# slate swan how?
from discord.ext import tasks

bot = ...
bot.activity_up = 1

@tasks.loop(minutes=1)
async def add_time():
  await bot.wait_until_ready()
  bot.activity_up += 1
  await bot.change_presence(activity=discord.Game(f"Valorant | Elapsed: {bot.activity_up}"))

add_time.start()
bot.run("token")
swift pumice
#

hey i have a problem

shrewd apex
#

ask

swift pumice
#
async def on_ready():
    Channel = bot.get_channel(988526792602177636)
    Text= "Wie alt bist du(13-15)[Reagiere auf die nachricht]"
    Moji = await Channel.send(Text)
    await Moji.add_reaction('👶')
@bot.event
async def on_reaction_add(reaction, user,message):
    Channel = bot.get_channel(988526792602177636)
    if reaction.message.channel.id != Channel.id:
        return
    if reaction.emoji == "👶":
      Role = nextcord.utils.get(user.server.roles, name="988529250493661184")
      await user.add_roles(Role)
    else:
        await bot.process_commands(message)``` why isnt this working?
shrewd apex
#

reaction add?

swift pumice
slate swan
# slate swan

yeah, that'll work like that, you can't have rich presence and sarth told

#

sadge

swift pumice
shrewd apex
#

just reaction and user

swift pumice
#

and then it will work?

#

@shrewd apex

shrewd apex
#
@bot.event
async def on_reaction_add(reaction, user):
    Role = bot.get_role(988529250493661184) or await bot.get_role(988529250493661184)
    if reaction.message.channel.id != 988526792602177636: return
    if str(reaction.emoji) == "👶": await user.add_role(Role)
    else: await bot.process_commands(message)
swift pumice
#

idk

shrewd apex
#

what's not working?

slate swan
#

does somebody know how to get every arg after a certain arg discord.py

swift pumice
shrewd apex
#

user.add_role()

swift pumice
swift pumice
# shrewd apex user.add_role()
@bot.event
async def on_reaction_add(reaction, user,message):
    Role = nextcord.utils.get(user.add.roles, id=988529250493661184)
    if reaction.message.channel.id != 988526792602177636: return
    if str(reaction.emoji) == "👶": await user.add_roles(Role)
    else:
        await bot.process_commands(message)```like this?
shrewd apex
#

i edited my answer check that

slate swan
slate swan
# shrewd apex wym?

I want to like get the sentence after these args and if I add space it moves to another arg I want how many spaces I add it will read all args after a certain arg

swift pumice
shrewd apex
#
async def(arg1, *, arg2): #this will make all subsequent arguments after arg1 a string arg2
async def(*arg1): #returns a tuple of all ur args
slate swan
shrewd apex
#

u just access arg1 and 2 not the *

#

thats just an indicator

slate swan
#

so like I would I access it:
arg1+arg2
and will it return all the args between it

shrewd apex
#

y don't u print and see👀

potent spear
slate swan
#

ok

shrewd apex
#

emm it pretty simple it would be a better learning experience to print and get on his own

#

it's just a string and a tuple💀

potent spear
#
async def shit(ctx, first_arg, *, second_arg)
  #...

!shit pants every single day

first_arg = "pants"
second_arg = "every single day"```
vs 
```py
async def shit(ctx, first_arg, *second_arg)
  #...

!shit pants every single day

first_arg = "pants"
second_arg = ("every","single", "day",)```
=> more info about this: `consume rest operator`
slate swan
#

is it possible to script a badge and put it on your pfp in discord?

#

ok

shrewd apex
#

wdym by script a badge tho?

#

u can't fake badges and put in ur profile tho👀

cloud dawn
#

Slash commands be like int value should be less than or equal to 9007199254740991.

#

Why are the using safe integer 😐

vocal plover
velvet compass
#

!rule 5

unkempt canyonBOT
#

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

velvet compass
#

We won't help with a token grabber

#

Also, you leaked your token

left vector
left vector
velvet compass
#

Its not just a file name, its a well known package on github

#

And as such, we won't provide help on it

left vector
#

alright then

#

also sorry for ping but do you guys see as synapse x as a roblox hacking tool or a dev tool @velvet compass

#

aka am i aloud to ask help about it here

velvet compass
#

Looks like it is a package specifically designed to exploit Roblox. I'd say it falls under rule 5 as well

left vector
#

alright then good to know thank you

swift pumice
#

why isnt this working?py @bot.event async def on_reaction_add(reaction, user,message): Role = bot.get_role(988529250493661184) or await bot.get_role(988529250493661184) if reaction.message.channel.id != 988526792602177636: return if str(reaction.emoji) == "👶": await user.add_role(Role) else: await bot.process_commands(message) error TypeError: on_reaction_add() missing 1 required positional argument: 'message'

warm tulip
#
                     description="Answers a yes/no question.",
                     brief="Answers from the beyond.",
                     aliases=['eight_ball', 'eightball', '8-ball'],
                     pass_context=True)
async def eight_ball(context):
  possible_responses = [

     'That is a resounding no',
     'It is not looking likely',
     'Too hard to tell',
     'It is quite possible',
     'Definitely',
     'Maybe so.'

    ]
await context.channel.send(random.choice(possible_responses) + ", " + context.message.author.mention)```

why its not working?
cloud dawn
#

!d discord.on_reaction_add

unkempt canyonBOT
#

discord.on_reaction_add(reaction, user)```
Called when a message has a reaction added to it. Similar to [`on_message_edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_message_edit "discord.on_message_edit"), if the message is not found in the internal message cache, then this event will not be called. Consider using [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") instead.

Note

To get the [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message "discord.Message") being reacted, access it via [`Reaction.message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Reaction.message "discord.Reaction.message").

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

Note

This doesn’t require [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members") within a guild context, but due to Discord not providing updated user information in a direct message it’s required for direct messages to receive this event. Consider using [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") if you need this and do not otherwise want to enable the members intent.
cloud dawn
#

Doesn't take a message.

swift pumice
swift pumice
swift pumice
#

@cloud dawn

cloud dawn
swift pumice
cloud dawn
swift pumice
robust fulcrum
#

Guys how can we display the servers count of bot in its status?

shrewd apex
#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
quaint epoch
cloud dawn
quaint epoch
#

trolling smh

cloud dawn
#

This isn't the appropriate channel for this please use @novel apex

swift pumice
# cloud dawn Yep.
async def on_reaction_add(reaction, user):
    Role = bot.get_role(988529250493661184) or await bot.get_role(988529250493661184)
    if reaction.message.channel.id != 988526792602177636: return
    if str(reaction.emoji) == "👶": await user.add_role(Role)
    ```it still isnt working? pls help
quaint epoch
sick birch
#

@robust fulcrum please don’t change presence in on ready

cloud dawn
swift pumice
sick birch