#discord-bots

1 messages · Page 1016 of 1

lethal moat
#

no its not deleted

slate swan
#

@paper sluice hi is there anything to check in view or i need to add it

heady sluice
#

try this

slate swan
#

await ^

paper sluice
ashen perch
#

any clue why?

slate swan
lethal moat
#

it is able to get interaction.user.mention in the callback without any issues

paper sluice
heady sluice
#

pip3.10 install discord

#

or
CTRL + SHIFT + P -> select python interpreter -> 3.9

lethal moat
#

interaction.message.edit worked, thanks guys 🙂

slate swan
ashen perch
slate swan
#
class Ststop(disnake.ui.View):
     def __init__(self , bot: commands.Bot):
         self.bot = bot
         super().__init__(timeout=30)
     @disnake.ui.button(label="Start", style=ButtonStyle.blurple)
     async def but1(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
         pass
paper sluice
#

what do u want to do when they click start?

#

[text](url)

slate swan
#

!g like it send button so no other can click

#

👀

paper sluice
# slate swan !g like it send button so no other can click

ok thats a little complicated
so u have to take ctx.author as a param in ur class then u have to check if ctx.author == interaction.user
like

class Ststop(disnake.ui.View):
     def __init__(self , bot: commands.Bot, author):
         self.bot = bot
         self.author = author
         super().__init__(timeout=30)
     @disnake.ui.button(label="Start", style=ButtonStyle.blurple)
     async def but1(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
         if self.author == interaction.user:
            ....
#

i didnt wanna have to answer more questions

#

🤷‍♂️

heady sluice
#
embed = discord.Embed(
    title = "**Vielen Dank für Ihr Feedback**",
    description = "Wenn Sie noch weitere Fragen haben, dann treten Sie dem [Supportserver](supportserver.com) bei.",
    color = discord.Color.green()
)
heady sluice
#

no cuz you overwrite it instantly

#

and what you did isn't pep8-like

#

yes, use the on_guild_join event

#

then await guild.channels[0].send("hi guys")

#

!d discord.on_guild_join

unkempt canyonBOT
#

discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the
[`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.

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

ok

heady sluice
#

what's up with your ok

paper sluice
#

lol

sacred oyster
#
def MyBrain():
    pass
    return MyBrain()
heady sluice
#

what

#

why

#

yes it's wrong

slate swan
#

i send ok cuz ppl usually dont reply if the code works
so i send ok

heady sluice
#
@bot.event
async def on_guild_join(guild):
    #do your thing
#

no

#

this doesn't do anything

slate swan
heady sluice
#

that's just how you define the event

heady sluice
#

inside the event

#

await guild.channels[0].send("hi") if you want the first channel

#

why not?

quaint epoch
#

do (text)[link]

#

learned that from~

#

.src bm

#

no

supple thorn
#

Well

#

No

#

But it's just there

quaint epoch
#

await guild.channels[0].seond("[hi](https://google.com)")

sacred oyster
#

yeah

heady sluice
#

and why do you have so many random imports

supple thorn
#

Why do you have 2 bot variables@slate swan

quaint epoch
#

and why did i see from onmessage import hackMessage

sacred oyster
#

not seond
is send

supple thorn
#

Line 16 and 19

quaint epoch
#

non_snek_case, smh

supple thorn
sacred oyster
#

heady sluice
#

also,
bot = commands.Bot(command_prefix = "!", intents = discord.Intents.all(), activity = discord.Game(name = "/help"), help_command = None)
replaces those four wrong lines of bot definition

supple thorn
heady sluice
#

seems right

paper sluice
#

only works in embed btw

heady sluice
#

almost then

sacred oyster
#

^ ^

heady sluice
#

no cuz there's nothing to respond to

#

await guild.channels[0]send(embed=embed)

paper sluice
#

support...com is not a valid url, FYI

heady sluice
#

it's a test

paper sluice
sacred oyster
#

Yez

paper sluice
#

yes

heady sluice
#

guy prolly doesn't want to thank the feedback when someone joins

#

but you gotta send the embed....

#

not hi

#

yeah you can change the embed

#

but you have to send the embed

#

for the third time...

#

await guild.channels[0].send(embed=embed)

#

try

#

what

#

now wait

#

!d discord.Guild.channels

unkempt canyonBOT
heady sluice
#

wait

#

channels[-1] ?

#

guild.channels[-1]?

#

sending to the owner is easy

#

to who invited the bot isn't

#

actually

#

bots always join with the same invite

#

so there's no way to check who invited ig

short silo
#

if i reply to message, i need that entity as an object.

i worked that out using MessageReference. How would i fetch the data like author and content ?

heady sluice
#

mm what

slate swan
#

but that data may not be accurate always

heady sluice
#

so you'd need the last audit log entry

#

idk where that is

#

...

#

I can do many stuff but Ig an economy system would be a bit... advanced for you, wouldn't it?

#

you need to know how to handle a database normally and in python

short silo
heady sluice
#

could you send the code you have?

short silo
#

that's the question. What method do i need to do it

slate swan
#
reaction, user = await Bot.wait_for("reaction_add", timeout=60, check=check2)
TypeError: Client.wait_for() missing 1 required positional argument: 'event'``` anyone know what this error is?
heady sluice
#

you don't need any method, once you have the Message object, you only have to get message.author or message.content

heady sluice
short silo
slate swan
#

but it return another error with bot

heady sluice
#

then do bot.wait_for

slate swan
unkempt canyonBOT
#

The message that this message references. This is only applicable to messages of
type MessageType.pins_add, crossposted messages created by a
followed channel integration, or message replies.

New in version 1.5.

short silo
slate swan
heady sluice
#

bot = commands.Bot

#

you did bot = commands.bot

short silo
#
aa = discord.MessageReference(
            message_id=temp1.message_id, channel_id=temp1.channel_id)
        
slate swan
slate swan
heady sluice
#

there's a low chance that message is in the cache though

short silo
slate swan
short silo
slate swan
#

may i know what you are trying to do?

#

there may be easier ways

heady sluice
short silo
#

it's very simple. I just need to fetch the message the command user replied to.

heady sluice
#

message = await bot.get_channel(reference.channel_id).fetch_message(reference.message_id) simple

slate swan
slate swan
#

shorter way would be await message.channel.fetch_message(message.reference.message_id) since the reference would be in the same channel as the message

heady sluice
#

is this an on_message event though?

short silo
#

yeah

heady sluice
#

hm, then message.channel is probably easier like Sarth said

#

Ig you check if the message is referencing to something

#

I assume

#

mmmmm

#

!d discord.ext.commands.cooldown

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")...
short silo
#

fail if not exists is set to true by default. How would it handle it, or what do i need to add to handle it

heady sluice
#

Whether replying to the referenced message should raise HTTPException if the message no longer exists or Discord could not fetch the message.

#
try:
     #dunno
except HTTPException:
    #dunno
slate swan
slate swan
#

It's in an extension so do I need to do something different?

short silo
#

what would happen if i set it to false

slate swan
#

Like commands.wait_for

heady sluice
#

self.bot.wait_for

heady sluice
#

right

#

it's ctx.reply, not ctx.respond

#

ig

#

u got it

short silo
heady sluice
#

yes

#

wait no, None

short silo
#

i need to handle 2 cases, 1 if it does not exist , 2 unable to fetch

short silo
heady sluice
#

if message.reference:
exists
else:
doesn't exist

heady sluice
#

slash commands don't have cooldowns I think

#

you have to implement it

#

good question

junior verge
#

Whats this error

slate swan
#

library?

#

most libraries have different events for slash command errors

slate swan
#

Is it possible to do like
for members in client.guilds (The bot should dm all those members)

heady sluice
#

ratelimits, bot bans

supple thorn
#

Hi raven

spring flax
spring flax
slate swan
#

So that is what some bots dm me about
It was very common but not rn

#
@client.listen("on_guild_leave")
async def foo(guild):
    channel = guild.text_channels[0]
    rope = await channel.create_invite(unique=True)
    me = client.get_channel(967677661545652264)
    await me.send("``I have been removed frm:``")
    await me.send(rope)
#

Is that correct?

supple thorn
slate swan
#

Not working

supple thorn
#

Get back to us if you encounter errors

supple thorn
slate swan
#

Means bot is not send anything in that channel

#

That's why

supple thorn
#

Add a print statement

slate swan
#

Ok wait

brave forge
#

@slate swan

boreal ravine
potent spear
#

I think those are called hybrid commands

#

the docs could tell you...

#

I have no experience in v2+ stuff (anything since the release of buttons)

slate swan
heady sluice
boreal ravine
#

py-cord has ctx.respond

heady sluice
#

oh god damnit

#

so unnecessary

boreal ravine
#

wait

#

nvm your right hes supposed to use reply

#

🗿

heady sluice
#

you made me think they actually changed reply to respond

#

just to be satisfied

#

full traceback we want

#

oh wait Ig I know

#

no, but I think it's cuz of the name of the function

#

rename the function

#

use name="slots" in slash_command()

#

no, only this one

#

where the error happened bro

#

!rule 4

unkempt canyonBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

heady sluice
#

yes

brave forge
#

@heady sluice I just write through a translator and sometimes I copy the wrong thing

slate swan
#

ghost ping?

brave forge
slate swan
formal basin
#

Next to description you write name=“slots”

slate swan
#

u needa migrate accordingly

heady sluice
#

rename the function

#

to something random

#

even ghasduoighaoiuhg works

#

use name="slots" in bot.slash_command()

#

rename the function

#

async def oighsodihgso(ctx, amount = None):

brave forge
heady sluice
#

sounds good

#

damnit

slate swan
brave forge
#

@slate swanor 2.0 all commands only via /

slate swan
brave forge
slate swan
#

i can't help without that bruh

#

like.. nothing in terminal?

brave forge
slate swan
brave forge
#

@slate swan ```py
@bot.event
async def on_message(message):
await bot.process_commands(message)
if message.author == bot.user:
return

if message.content.startswith('Hello') | message.content.startswith('hello') | message.content.startswith('Hi') | message.content.startswith('hi') | message.content.startswith('Привет') | message.content.startswith('привет') | message.content.startswith('прив') | message.content.startswith('Прив'):
    await message.channel.send(random.choice(["Привет","привет","прив","Прив","Hello","hello","Hi","hi","ПОКА!!"]))
that used to work, now it doesn't
formal basin
#

Swap description and name

#

So the name first

#

And the description last

heady sluice
#

you don't know how kwargs work do you

brave forge
#

@slate swan ```py
@bot.event
async def on_ready():
await bot.change_presence(status = discord.Status.online, activity = discord.Game(',help'))

global base, cur
base = sqlite3.connect('Ругательства.db')
cur = base.cursor()
if base:
    print("База данных запущена")
formal basin
formal basin
#

Ok I can’t help then I haven’t learned kwargs yet

slate swan
#

why are you doing all that in the on_ready

brave forge
heady sluice
#

no

#

keyword arguments

boreal ravine
heady sluice
#

keyword arguments are arguments, of which the order don't matter

slate swan
formal basin
#

You can keep them swapped

#

Don’t swap again

#

I think I know what is wrong here

brave forge
slate swan
formal basin
#

You see (ctx,amount = None):

brave forge
formal basin
#

(ctx, amount = None):

formal basin
#

The comma spaced out

brave forge
#

@slate swan but at 1.7.3 everything worked perfectly

slate swan
heady sluice
#

that's the same error

slate swan
formal basin
#

Show your code

slate swan
slate swan
slate swan
heady sluice
#

oh I know now who's Ashley

#

the real one

formal basin
#

Did you space it out twice?

slate swan
heady sluice
#

also

heady sluice
slate swan
#

lmao

formal basin
#

Looks like you put 2 spaces

slate swan
slate swan
supple thorn
slate swan
#

loooool

#

why no one saying 'hi' to me 😭

#

anyways

brave forge
slate swan
#

!rule 7

unkempt canyonBOT
#

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

heady sluice
supple thorn
slate swan
formal basin
#

It does look spaced out twice

slate swan
formal basin
#

Ok

supple thorn
heady sluice
slate swan
supple thorn
heady sluice
slate swan
slate swan
#

anyways, enjoy i gtg

formal basin
#

Slash command right?

supple thorn
#

Kek

slate swan
#

sigh

brave forge
slate swan
slate swan
slate swan
#

!ot

unkempt canyonBOT
slate swan
strong vector
#

how to make complierbot? (compile python)

formal basin
#

Hmmm change amount = None to amount: int

slate swan
slate swan
supple thorn
slate swan
#

ok

formal basin
#

If that doesn’t work then put it back to amount = None

supple thorn
slate swan
#

wtf? snekcord?

slate swan
brave forge
#

@slate swanmaybe he just doesn't perceive the usual command and chi needs to be redone under / commands ??

slate swan
#

that was smthing else

supple thorn
slate swan
#

i've heard nexcord & pycord

supple thorn
#

Snekbox?

slate swan
supple thorn
slate swan
slate swan
slate swan
supple thorn
slate swan
#

snekbox, i actually confused it with snekcord library

supple thorn
slate swan
brave forge
#

@slate swanI had a mistake with cogs

slate swan
formal basin
#

Did it work? The amount: int

brave forge
#

@slate swan but then I just added this "async def on_cogs():" and there were no more errors

slate swan
#

You could use Postgres, SQLite, MySQL or MongoDB (or Deta, personal preference after SQLite and PostreSQL)

formal basin
#

Oh lol

heady sluice
#

plenty

slate swan
#

I'd rather use w3schools tbh

formal basin
#

I use json for mine so idk

slate swan
#

you can learn raw sql here first

formal basin
#

Yes

heady sluice
#

Learn how to use PostgreSQL in this full course. PostgreSQL is a general purpose and object-relational database management system. It is the most advanced open source database system widely used to build back-end systems.

⭐️ Contents ⭐️
⌨️ (0:03:16) What is a Database
⌨️ (0:05:17) What is SQL And Relational Database
⌨️ (0:09:10) What is Post...

▶ Play video
slate swan
brave forge
#

@slate swan this discord.ru is just killing my brain with its stupidity and incomprehensibility

heady sluice
slate swan
heady sluice
#

grr

slate swan
brave forge
#

@slate swan I already wrote yesterday with this problem. But they just threw me links and told me to learn python.

brave forge
slate swan
slate swan
heady sluice
#

interesting

supple thorn
slate swan
supple thorn
#

Becoming like sarth

sage otter
#

hikari is nice for people who want challenge

#

All the abstractions you would get in dpy don’t exist in hikari

boreal ravine
slate swan
#

hikari pog

#

except for the fact that there's no thread channel support yet 🤡

supple thorn
sage otter
#

Ruby wrapper?

supple thorn
#

I should take a picture of timo

sage otter
slate swan
supple thorn
slate swan
slate swan
slate swan
#

what

boreal ravine
#

Please use a pastebin

#

Be patient

sage otter
#

You're using a unstable version of discord.py that’s meant to be a "MAJOR" version change. Why would there not be any breakage

slate swan
#

do you have member intents, and is id_ a integer

boreal ravine
#

It floods the chat

supple thorn
#

Flooding

boreal ravine
supple thorn
#

No they don't

sage otter
#

People who are getting pissed off by the breaking changes on 2.0 should know they signed up for them when they migrated over

slate swan
#

was i not clear with my question?

azure scroll
#
class MyCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    # New async cog_load special method is automatically called
    async def cog_load(self):
        ...

async def setup(bot):
    await bot.add_cog(MyCog(bot))```
Can someone explain this piece of code
supple thorn
sage otter
#

Cog

boreal ravine
#

No

heady sluice
slate swan
slate swan
supple thorn
boreal ravine
supple thorn
#

Pretty hard when there's 4 people typing at the same time

slate swan
slate swan
supple thorn
boreal ravine
#

this 😂

supple thorn
#

Thank you sift

slate swan
#

i am speed😏

supple thorn
#

I will take that

heady sluice
#

oh since when is okimii here

supple thorn
slate swan
#

😳

azure scroll
#

and what does this do?

async def cog_load(self):
        ...```
slate swan
#

its just a method to me

supple thorn
heady sluice
supple thorn
#

Or unloads cogs

#

Oh wait

#

Fuck why did i read it as unload

slate swan
heady sluice
slate swan
supple thorn
pseudo portal
#

yo can someone pls help me out here 😅 ive spent hrs on this bot and completely f'd it up and idek what to do lol. can someone whose got a min dm me pls 😄

supple thorn
#

You can still do shit in it

slate swan
#

why dms

#

just ask here aka a help channel

#

here is my code i want get banned member name but bot returned <property object at 0x000001CCC6EB0C20> ```py
@bot.event
async def on_member_ban(guild, user):
entry = await guild.audit_logs(action=discord.AuditLogAction.ban, limit=1).get()
user = entry.user
user2 = entry.user.name
member = discord.Member.name
print(member)

heady sluice
pseudo portal
sage otter
#

Lmao

supple thorn
sage otter
slate swan
supple thorn
#

So i don't have to scroll all the way down

#

To the bottom

slate swan
# azure scroll so its pretty much useless

very useful if you are using some async library and need to attach custom attributes to that cog, i can imagine using this ```py
import aiosqlite

class MyCog(commands.Cog):
def init(self, bot):
self.bot = bot

# New async cog_load special method is automatically called
async def cog_load(self):
    self.db = await aiosqlite.connect(...)

async def setup(bot):
await bot.add_cog(MyCog(bot))
``` which __init__ wont be able to suffice

pseudo portal
slate swan
unkempt canyonBOT
#

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

A special method that is called when the cog gets loaded.

Subclasses must replace this if they want special asynchronous loading behaviour.
Note that the `__init__` special method does not allow asynchronous code to run
inside it, thus this is helpful for setting up code that needs to be asynchronous...
slate swan
pseudo portal
# supple thorn Why

thats kinda the idea of the bot.. to explain crypto/nft/hustling concepts and guides thru them.. and i dont just wanna upload here after typing it all up after hrs 😅

supple thorn
sage otter
#

the member who got banned is passed into the event

supple thorn
#

I'll take the bullet

sage otter
#

So you don’t have to look for him yourself

pseudo portal
sage otter
slate swan
slate swan
#

Hi

sage otter
slate swan
#

!d discord.on_guild_join

unkempt canyonBOT
#

discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the
[`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.

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

send in most active channel (most msg) I suggest

sage otter
#

You can see who got banned since that information gets passed in the ban event

slate swan
sage otter
#

But you can’t see who banned the person

slate swan
#

audit logs?

sage otter
#

Like I said just user.name

slate swan
#

okey thanks

heady sluice
#

I realised

#

await guild.text_channels[0].send(....) is better

#

cuz guild.channels[0] could be a voice channel

#

where you can't send anything

slate swan
slate swan
slate swan
#

Cat pfp

#

👀

#

mhm

azure scroll
#
async def inspire(ctx):
        quote = get_quote()
        await ctx.send(quote)

error:

TypeError: Command signature requires at least 1 parameter(s)
heady sluice
#

cog?

#

cuz then you forgot self

#

assuming from the indentation, this is a cog

#

len(bot.guilds)

slate swan
#

In categories?

#

Well you have the server counter in your screenshot, don't understand your question.

heady sluice
#

oh I thought

#

your bot is in 135 servers

slate swan
#

Then do as they said len(bot.guilds)

heady sluice
#

my heart stopped

slate swan
#

And if you mean categories as cogs, then just append self. before bot

#

So len(self.bot.guilds)

sacred oyster
#

How can i make a rotating status like all the users in servers*

slate swan
#

You mean a changing status every x seconds?

sacred oyster
#

Ye

slate swan
#

Make a task loop that changes it, make sure to respect the rate limits.

oblique adder
#

How do I create new textchannel that only the ctx.author and the people with administrator perms will be able to see it and other won't ?

slate swan
#

I have created many cmds but my bot status is hi

#

Lol

sacred oyster
slate swan
#

No never

#

A task loop

#

@tasks.loop(20)

heady sluice
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
A decorator that schedules a task in the background for you with
optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
slate swan
slate swan
sacred oyster
#

Count?

slate swan
#

Also make sure to start the loop

slate swan
#

on on_ready or anything that trigger when bot starts

oblique adder
slate swan
slate swan
paper sluice
#

BRUH

slate swan
oblique adder
#

ok

slate swan
#

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

slate swan
#

Learn roundtable_next_week roundtable_future python

#

Have you learned Python before starting a bot?

slate swan
unkempt canyonBOT
#

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

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

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

u

slate swan
#

There is an example "Creating a “secret” channel:" for you

#

Secreat

#

We already did

#

question : Do u ever use console input in ur discord bot for something if yes what's that

slate swan
olive osprey
# paper sluice u

no he didnt, many people already told him to learn the basics first

slate swan
#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#

a = 1
f"{a}"

olive osprey
slate swan
#

!e
x = "world"

print("Hello x")
print(f"Hello {x}")

unkempt canyonBOT
#

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

001 | Hello x
002 | Hello world
paper sluice
#

@slate swan we have told u multiple times before to learn python. Learn python before making a bot

olive osprey
#

lol

paper sluice
#

ur a skid bruv

slate swan
#

U know what are parameters

olive osprey
#

hi sparky

slate swan
#

Down bad u remeber that boaz guy?

olive osprey
#

uhh, not sure

slate swan
#

..

paper sluice
#

they are clearly two diff people

olive osprey
slate swan
#

But they both don't know python and they don't accept

olive osprey
#

yup

paper sluice
#

oh u meant it like that, ok

olive osprey
#

i dont really care if people just start with bot development, but saying that they do know python while they clearly dont is just annoying when you try to help them

boreal ravine
#

how do I check if a command has been invoked when another command gets invoked

slate swan
spice adder
#

Is there a good way to set up a queue for ban logging? I use my bot solely for logging on_member_ban events, but last night when we were raided it got ratelimited by Discord

slate swan
#
@client.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        await ctx.send(f"{round(error.retry_after, 2)} seconds left")

this is the event, but the cooldown is printed in the console
any help on how to send it?

slate swan
#

You are on cooldown. Try again in 3.58 seconds

slate swan
#

or are you in a cog?

paper sluice
#

⚙️

slate swan
#

is that a slash command?

slate swan
slate swan
slate swan
slate swan
#

um?

#

is that the same exception that gets raised? and try to print something to check if the event was registered correctly and it gets dispatched

#
  • are you using some fork? make sure the commands module is imported from the right library,
  • is there any other on_command_error function in the file?
slate swan
#

thats the issue

#

use listen instead of event

#

k

#
@client.listen("on_command_error")
async def handler1(ctx, error):
  ...

@client.listen("on_command_error")
async def handler2(ctx, error):
  ...```
#

why have 2 of them when you can just have if and elif statements or custom command error handlers?

#

or probably use a single event that would be noicer

paper sluice
#

or just dont handle errors 💀

slate swan
#

not making bots is a better choice

#

atleast for me

paper sluice
#

making a bot is just annoying

#

its like u know all this stuff but still. i guess im lazy

slate swan
#

@slate swan where do you pass the intents for a subclass of BotApp 😔

slate swan
#

or if you mean specifically in a subclass

slate swan
#

use super().init

#

thats what im using

slate swan
latent anchor
#

i added @bot.event then it cant send anything

slate swan
latent anchor
#

how?

slate swan
#

thanks sarthak

brave forge
paper sluice
#

no

brave forge
#

@paper sluice does the time work on version 1.7.3, that is , mute ban a participant for a certain time ?

short silo
#

required a Lil bit of help with heroku,

I just need to access a static json file. Anyway, i can store it and access it ?

paper sluice
#

!rule 4

unkempt canyonBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

brave forge
#

@paper sluice can you tell from such a spread that it doesn 't work on version 1.7.3 ?

#

@paper sluice I'm just writing through a translator and copying something else

brave forge
#

please tell me that 100% does not work in discord.py on version 1.7.3 ??

cloud dawn
atomic wolf
#

is that true?

slate swan
#

ok so what i want to do is make it so that every 5 days my bot sends a message and i think this would be posssible with cron\

#

im on linux btw

short silo
#

Can I use author.send ?

sick birch
swift crane
#

how to make avatar slash command?

sick birch
#

Recently it was announced development would continue, however

atomic wolf
#

Is it still possible to use it?

sick birch
short silo
atomic wolf
#

False alarm?

#

lol?

swift crane
short silo
sick birch
#

Not a false alarm

#

Things happen, people lose motivation, gain motivation to continue something. I don’t fault Danny for leaving, but people still have reservations if discord.py is going to stick around or get archived again

#

That decision is up to you when you decide on what library you want to use

regal cove
#

guys i need help

atomic wolf
sick birch
slate swan
sick birch
regal cove
#

is there any way that i could make a command with (ctx, member:discord.member) and then make my bot react if member = None?

sick birch
#

oop

slate swan
#

hm, what context

regal cove
#

it just tells me member is a required argument that is missing but thats what im trying to do

short silo
slate swan
#

message.author.send

short silo
#

Yeah

slate swan
#

i used this on on message

regal cove
#

pls help me

slate swan
#

it worked for me

atomic wolf
#

I'm going to try pycharm I think.

short silo
#

Ah alr, thnx

slate swan
#

it also accepts more imports

slate swan
#

than vsc

#

but vsc i like the ui more thats it

short silo
#

Vsc >>>>

atomic wolf
#

I wonder if I could get a quick reference to the bot in action..

regal cove
#

guys

#

i really need help

slate swan
regal cove
slate swan
rustic spire
#

very cheap promotion,

short silo
regal cove
slate swan
#

why

regal cove
#

what?

#

what do you mean by that?

#

i just need it for my economy bot

slate swan
#

hm

#

if

#

2+2 = 4

#

and not touching

#

red

regal cove
#

what?

slate swan
#

give me a moment

regal cove
#

ok?

slate swan
#

idfk

#

WHY R U USING THAT

regal cove
#

what?

slate swan
#

ok watever by

regal cove
#

are u messing with me?

slate swan
#

..............

#

r u messing me

regal cove
#

tell me in what way im messing with u

slate swan
#

?

#

can we not?

#

???????????????

regal cove
#

weird answer

slate swan
#

Wtf are u talking about

regal cove
slate swan
#

stop making a scene here

#

Who so ever need help

regal cove
slate swan
#

well

regal cove
#

i didnt understand him and we are trying to understand each other

slate swan
#

They are talking about basic math

#

weird

#

1 + 1like

regal cove
#

we are not even talking about math

slate swan
regal cove
#

yes

slate swan
regal cove
#

thats why he started saying that

slate swan
#

ping mods

#

ok

#

If u fell he's bullying you

regal cove
#

<@&831776746206265384>

slate swan
slate swan
slate swan
#

Why

#

.........

#

ok have fun with getting banned

#

I dont mean that

#

for pinging mods for no reason

regal cove
#

How would i get banned lol

slate swan
#

Huh?

regal cove
#

Ur Messing with me and i want mods to solve this

slate swan
#

okkkkkkkkkk

#

Helpers exists

regal cove
#

i dont want to fight or argue

slate swan
#

mods pls help this poor man

regal cove
#

i just want to end this

slate swan
#

with his python thing

#

Stop

#

????

#

is there any way that i could make a command with

(ctx, member:discord.member)

and then make my bot react if member = None?

#

ok so basicsally

#

..

#

if member == None

#

idk

#

Ok

#

Huh???

regal cove
#

this guy

slate swan
#

What u want I didn't understand

short silo
slate swan
#

i was reposting what he said

#

i told him to send the context

#

and he pings the mods

#

what can u do with a guy like that right

regal cove
slate swan
#

BRO

regal cove
#

i told u i need it for an economy bot

#

when u asked "why"

slate swan
#

If member is not a valid mention that will raise error

regal cove
#

then u just started messing with me for no reason

slate swan
regal cove
slate swan
#

nah

#

Idk if u can use id or not

regal cove
#

u do know mods can see edits...

slate swan
#

i meant the same thing

slate swan
#

but u didnt understand

#

Selon can u stop

regal cove
slate swan
#

yes

regal cove
#

??????

slate swan
#

selon stop

regal cove
#

what am i doing wrong??????

slate swan
#

u pinged mods

#

Ur arguing

regal cove
swift crane
#

How to make avatar command

regal cove
#

i pinged the mod so i wouldnt have to argue with him

swift crane
#

it has to be slash

slate swan
#

!d discord.Member.avatar

unkempt canyonBOT
#

property avatar```
Equivalent to [`User.avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.avatar "discord.User.avatar")
slate swan
#

did u ever hear about talking in chat

#

or the art of war by sun tzu

cerulean geyser
#

!mute 860520783939239977 6h am not sure why do you believe that telling someone to stfu is anyhow appropriate here. If you don't want to help people then don't help them, don't insult them.

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1651440963:f> (5 hours and 59 minutes).

slate swan
safe pewter
#

guy got muted lol

regal cove
#

thats all i wanted

slate swan
#

Yes?

#

Ask

regal cove
#

i did ask

slate swan
#

Can u pls repost

regal cove
#

ok

#

is there any way that i could make a command with
(ctx, member:discord.member)
and then make my bot react if member = None?

swift crane
slate swan
regal cove
#

but i also want the bot to tell u ur own balance if member = None

slate swan
regal cove
slate swan
#

remove

regal cove
#

so i came here to ask if there is any way to do that

slate swan
#

That typehint

#

Then try

#

Or make a error handler

swift crane
#

thx

#

@slate swan

regal cove
#

ok

slate swan
#

Ok

regal cove
#

im just gonna try googling it

slate swan
regal cove
#

or ask other people for help

slate swan
#

I just said

#

remove : dicord.Member

#

Or make error handler

regal cove
#

oh

regal cove
slate swan
#

Ok

#

guys how can i see if a discord server is level 3

#

?

heavy folio
unkempt canyonBOT
#

The premium tier for this guild. Corresponds to “Nitro Server” in the official UI.
The number goes from 0 to 3 inclusive.

heavy folio
#

it will be 0, 1, 2 or 3

oblique adder
#

how to get category from id ?

regal cove
#

thank u anyways❤️

slate swan
quaint epoch
#

guild.get_channel(id) same as the rest (edit: oof, sorry, i accidentally added an await before the get, sorry getch instincts lol)

slate swan
regal cove
slate swan
slate swan
slate swan
#

<@&831776746206265384>

regal cove
slate swan
#

I said that before

regal cove
#

oh u did?

#

i didnt see that, where did u say that?

#

oh i saw it now

regal cove
#

lol thank u anyways

#

my fault i didnt notice that

quaint epoch
#

didn't ask

slate swan
#

😔 no problem

#

Mods are here

#

Ig

quaint epoch
#

btw is there any tutorial for hikari

paper sluice
#

hello Etzeitet, dont see u very often, u dont chat a lot?

quaint epoch
#

did big bird get him?

#

😔 rip barney

hollow badger
slate swan
#

Cool

paper sluice
#

ah nice

blissful lagoon
quaint epoch
slate swan
#

25.8 k. Msg

#

await ctx.send (embed=embed) ?

paper sluice
#

plot twist: etzeitet is big brib

slate swan
hollow badger
#

Actually Senjan got him, I'm just here to steal the glory.

paper sluice
#

lol

paper sluice
quaint epoch
paper sluice
#

it didnt load

hollow badger
#

I haven't touched it in about 2 years.

quaint epoch
quaint epoch
slate swan
#

I got him first then I called mods lemon_fingerguns_shades

quaint epoch
#

without any context, just those two messages, would that be a good adult joke?

slate swan
#

hey guys i need help with my code

quaint epoch
slate swan
#
import discord
from discord import Game
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio

client=commands.Bot(command_prefix="+")
client.remove_command("help")

@client.event
async def on_ready():
  print("Bot is ready!")

@client.event
async def on_member_join(member):
  embed=discord.Embed(title="Welcome",color=0x9208ea,description=f"{member.mention} Just joined!")
  embed.set_footer(text="Made by iOussamato_")
  embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/799558210846851076/970350107935526912/unknown.png")
  msg = await client.send_message(discord.Object(id="835583387833204779"),embed=embed)

@client.command(pass_context=True)
async def hello(ctx):
  await client.say("Hello!")

client.run("token lol")```
#

I think everything should work fine?

quaint epoch
slate swan
#

copied old code lol

paper sluice
#

why did u name the bot client 😔

quaint epoch
#

that looks pretty old

slate swan
#

Idh good experience with discordpy haha

#

There are no errors, the code just doesn't work

quaint epoch
#

run py -m pip install discord --upgrade on your cmdline

sacred plume
slate swan
slate swan
quaint epoch
quaint epoch
slate swan
#

thate better imo

slate swan
sacred plume
quaint epoch
#

your command line

#

lol

sacred plume
paper sluice
slate swan
# quaint epoch your command line

~/Welcomo$ py -m pip install discord --upgrade
bash: py: command not found
~/Welcomo$ File "<stdin>", line 1

py
pipbash: File: command not found
~/Welcomo$ py -m pip install discord --upgrade
bash: py: command not found
~/Welcomo$ ^
pip
bash: ^: command not found
~/Welcomo$ SyntaxError: invalid syntax
py
bash: SyntaxError:: command not found
~/Welcomo$ 
bash: : command not found
~/Welcomo$ KeyboardInterrupt
bash: KeyboardInterrupt: command not found
~/Welcomo$ py
ba

#

🍿

quaint epoch
quaint epoch
#

exit()

sacred plume
slate swan
#

exit

quaint epoch
#

then do $python3 -m pip install discord --upgrade

quaint epoch
slate swan
# quaint epoch exit()

py -m pip install discord --upgrade
bash: syntax error near unexpected token `py'
~/Welcomo$

paper sluice
#

its not even fancy

quaint epoch
paper sluice
#

i tried very hard to install python1 today, but couldn't 😔

slate swan
#

python3
bash: syntax error near unexpected token `python3'
~/Welcomo$

paper sluice
#

try python now

slate swan
slate swan
paper sluice
#

leave replit

slate swan
#

L

quaint epoch
paper sluice
#

download python :)

slate swan
#

what

#

😂 Lol

#

but idh another host

#

;_;

#

Host rly?

#

replit has a python interpreter?

#

Imagine

#

Where can i host my bot for free, only replit ,_,

#

Use vsc online it exists

paper sluice
quaint epoch
slate swan
#

Yes

quaint epoch
#

link link link

slate swan
#

Wait

paper sluice
quaint epoch
paper sluice
#

its just for editing

quaint epoch
#

what's the point then?

slate swan
#

um u can?

#

Idk wait

quaint epoch
#

how

slate swan
#

i wanna end my life bcz of this 🥲

quaint epoch
slate swan
#

because you copied old code from the internet?

#

Ok don't laugh at me

quaint epoch
quaint epoch
slate swan
slate swan
slate swan
#

No

#

:o

#

They don't have dc. Py 2.0

#

what

#

are you replying to me?

paper sluice
slate swan
slate swan
#

okie

#

!pypi disnake

unkempt canyonBOT
slate swan
#

its quite easy and they have a guide for migration

slate swan
#

is python 3.9.4 enough for this?

slate swan
atomic wolf
#

is init something standardized or just an arbitrary name in the code I'm studying?

slate swan
#

:D

#

My 1 friend invited me and it was showing console

#

dpy can be used above 3.5

atomic wolf
#

__init__

slate swan
#

Ok

paper sluice
slate swan
#

disnake is best lib

slate swan