#discord-bots

1 messages · Page 916 of 1

maiden fable
#

¯_(ツ)_/¯

slate swan
#

lol

vocal plover
#

I coded last night while totally drunk and while I don't understand the code I wrote at all it works twice as well as the code it replaces and is fewer lines happyThonk

maiden fable
#

LMAOOOO

vocal plover
#

oh yeah side note, don't try to explain TCP/IP to your drunk friends while you are also drunk

maiden fable
#

Pov: I don't have friends/People around me ain't as nerdy as me

vocal plover
slate swan
slate swan
maiden fable
#

Says who 👀

vocal plover
#

the mutual friends tab on discord

slate swan
#

your preference

maiden fable
slate swan
vocal plover
#

pretty much whatever except vim because vim will just confuse you

slate swan
maiden fable
#

No

#

Stop with the uwu and take the editor chat to #editors-ides thanks

vocal plover
#

uwu

#

now you can run the pip command again

#

and hopefully it should work

maiden fable
#

😔 Adding to PATH sucks

vocal plover
#

if it doesn't I'm not sure, I have git installed by default on my distro and I dont use windows

maiden fable
#

ajb, stop using linux and go to a doctor

vocal plover
#

but without linux how will I have such pretty terminals and not have to deal with windows bs

maiden fable
#

Use Mac!

vocal plover
#

I'll be dead before I willingly overpay apple for a computer kek

#

the 75% profit margin I'd be paying apple is much better spent on servers mmLol

maiden fable
#

😔 use ChromeOS

vocal plover
#

well that also has a disadvantage

#
  • you're using chromeos
slate swan
#

monkaHmm chromeOs uses linux kernel..

proper acorn
#

pls help me, i cant do 2+ word from file forbidden

#

i mean forbidden check event

#

only work when i put one word in that file

#

um wait

#

@slate swan

maiden fable
#

You gonna buy all of us a Mac, right? 👀

#

🥺

proper acorn
#

wat

#

wdym?

unkempt canyonBOT
#

Hey @slate swan!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

hazy oxide
#

How to enable nextcord slash command perm?

#

I use @commands.has_permissions but it didn't work on slash command

dense swallow
#

for me it triggers sometimes...

slate swan
dense swallow
#

I can send the code for it

slate swan
#

Does it send the message which were not edited too?

hazy oxide
unkempt canyonBOT
#

PizzaHat/cogs_hidden/events.py line 45

async def on_message_edit(self, before, after):```
slate swan
hazy oxide
#

Checking perms

#

Required perms to run the command

dense swallow
#

not always

slate swan
maiden fable
slate swan
#

So maybe check that

maiden fable
#

Oh wait, u r Yerl

#

😔

#

What

#

Lol

slate swan
#

why would it not

maiden fable
#

Vanity

slate swan
#

nope

dense swallow
#

other than that what else?

slate swan
#

you are trying to log only edited content right?@dense swallow

dense swallow
#

yup

spice basalt
#

how do i install a pip?

dense swallow
#

with python, add it as path

slate swan
#

you can just return it after.content == before.content

slate swan
dense swallow
slate swan
spice basalt
dense swallow
#

oh alright thanks

slate swan
dense swallow
#

it's on the bottom of the installer

slate swan
#

Or add python to your system environment variable manually

dense swallow
#

2 boxes I think

spice basalt
dense swallow
#

u have to reinstall it

spice basalt
spice basalt
slate swan
#

It's changed in 3.10 maybe

#

Well the pip option which I s ticked

spice basalt
#

so how do i install a pip

slate swan
#

python will install pip now, click on next and continue with your install

drowsy thunder
spice basalt
#

yes

drowsy thunder
#

What to fix

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

drowsy thunder
#

Even if I unindent it,it doesnt work

spice basalt
drowsy thunder
#

@spice basalt also dont use discord components

spice basalt
drowsy thunder
#

Use Nextcord or dpy(personally I prefer dpy)

drowsy thunder
#

*you

#

@spice basalt

spice basalt
#

you already reply pinged me PepeStare

drowsy thunder
#

Ok dude

tawdry bobcat
#

how to fix this

#
Traceback (most recent call last):
Traceback (most recent call last):
  File "main.py", line 12, in <module>
    client.remove_command(name="help") 
TypeError: remove_command() got some positional-only arguments passed as keyword arguments: 'name'```
#

?

maiden fable
#

remove_command(name)

tawdry bobcat
#

@drowsy thunder

maiden fable
#

Not remove_command(name=name)

tawdry bobcat
#

ok

tawdry bobcat
#

i am unable to create a custom help command

#

@maiden fable

pliant gulch
#

"Not remove_command(name=name)"

tawdry bobcat
#

what to edit in this code

#

@pliant gulch

pliant gulch
#

You could also just passhelp_command=None to your bot's constructor

vocal plover
#

remove_command is not your bot's constructor

pliant gulch
#

remove_command vs. help_command=None in your bot constructor is pretty much a micro optimisation although

tawdry bobcat
vocal plover
#

discord.py doesn't have anything to do with python classes being created

pliant gulch
#

It's still better to just pass help_command as None

pliant gulch
#

Again not your bot's constructor

slate swan
#

That should be inside the constructor

pliant gulch
#

!e ```py
class Foo:
def init(self, arg: str) -> None:
self.arg = arg

Foo("bar") # constructor!

unkempt canyonBOT
#

@pliant gulch :warning: Your eval job has completed with return code 0.

[No output]
drowsy thunder
tawdry bobcat
drowsy thunder
#

Guys,how to check if a message has walls of text and repeated text?

tawdry bobcat
drowsy thunder
tawdry bobcat
drowsy thunder
#

@vocal plover can ya tell how to check walls of text and repeated text?

narrow grail
#

how to disconnect an bot from a voice channel?

#

await voice_bot.disconnect() doesn't work

#

voice_bot = voice_bot_in(server)

#

server = message.server

slate swan
#

!d discord.Member.move_to

unkempt canyonBOT
#

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

Moves a member to a new voice channel (they must be connected first).

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

This raises the same exceptions as [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.edit "discord.Member.edit").

Changed in version 1.1: Can now pass `None` to kick a member from voice.
slate swan
#

Acess bots member using guild.me and use move_to

narrow grail
slate swan
#

read the last line in the embed?

narrow grail
slate swan
#

show code

narrow grail
#

btw new error: move_to is not definied

azure scroll
#

how to send messages such that they are only visible to the author

slate swan
hushed galleon
tawdry bobcat
narrow grail
drowsy thunder
#

Guys

slate swan
unkempt canyonBOT
#

property me```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
drowsy thunder
#

Sparky is a raider

#

He tried to delete my bot code

drowsy thunder
#

He is reported to python modmail

narrow grail
#

example pls

slate swan
#

message/context.guild.me

narrow grail
cosmic agate
#

InvalidArgument: activity must derive from BaseActivity.

#
@bot.command()
@commands.is_owner()
async def status(ctx, *, arg=None):
    if arg == None:
        await ctx.reply("Where status?")
        return
    await bot.change_presence(status=nextcord.Status.do_not_disturb, activity=arg)
drowsy thunder
#

How to make the bot add reaction to the response

cosmic agate
#

??

drowsy thunder
#

@slate swan

hushed galleon
cosmic agate
drowsy thunder
hushed galleon
#

those activities have a name parameter that you can write your message in

#

e.g. ```py
activity = discord.Game('with chocolate')

Shows up as: Playing with chocolate```

cosmic agate
slate swan
cosmic agate
drowsy thunder
#

I am using msg

cosmic agate
hushed galleon
slate swan
#

!d discord.Client.change_presence

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
#

needs to be a discord.Game/ discord.Activity

cosmic agate
cosmic agate
slate swan
#

Where?

hushed galleon
#

arg is a string

slate swan
#

It's a str

hushed galleon
#

you cant literally pass arg as the activity, it needs to be wrapped in an activity class first

cosmic agate
#

hmm

hushed galleon
cosmic agate
#

i dont understand anything

slate swan
#

learn argument and annotations then

cosmic agate
#

XD

slate swan
#

The activity accepts a discord.Activity

cosmic agate
#

hmm n

lyric tusk
#

if a member has not send a message or reacted to a reaction in x days he wil be given a role. how can i make that?

cosmic agate
#

would this work ?

@bot.command()
@commands.is_owner()
async def status(ctx, *, arg=None):
    if arg == None:
        await ctx.reply("Where status?")
        return
    await bot.change_presence(status=nextcord.Status.do_not_disturb, activity=nextcord.Activity(f"{arg}"))
```????
#

imma test

hushed galleon
#

why the f-string?

cosmic agate
#

for arg?

hushed galleon
#

yeah, its already a string

cosmic agate
#

oh ok

hushed galleon
#

also you havent given the activity any type you want it to be

cosmic agate
#

??

hushed galleon
#

is it playing? competing? streaming?

cosmic agate
#

oh ok

hushed galleon
#

e.g. py discord.Activity(type=discord.ActivityType.watching, name='over you')

brittle flume
#

What is the use of discord.Widget? I mean what is a widget?

vocal plover
#

something like this embedded on a website

cosmic agate
hushed galleon
#

if you fix the use of discord sure

brittle flume
viscid relic
#

What is that?

vale wing
#

Command "userinfo" is not found

viscid relic
#

Code:
@client.command
async def userinfo(ctx, user: discord.Member=None):
embed = discord.Embed(title="User information")
embed.set_thumbnail(url= user.avatar_url)
embed.set_footer(text="Requested by {ctx.author}",icon_url=ctx.author.avatar_url)
embed.add_field(name="Nickname:",value=user.display_name,inline=False)
embed.add_field(name="Id:",value=user.id,inline=False)
embed.add_field(name="Owner",value=user.is_owner,inline=False)
embed.add_field(name="Joined to server at:",value=user.joined_at,inline=False)
await ctx.send(embed=embed)

vale wing
#

Obvious

vale wing
#

Also how do you define client

#

And yeah

#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

viscid relic
#

Really?

#

Ok i test this

viscid relic
vale wing
#

client = Thank you nice

viscid relic
#

Why {ctx.author} not work?

brittle flume
#

How to check if the author is a bot or not?

vale wing
#

@viscid relic what is your python knowledge level

vale wing
unkempt canyonBOT
viscid relic
#

Thank you

rugged marsh
vale wing
#

You should learn a bit more before getting to making discord bots

#

At least learn the basics of OOP

viscid relic
viscid relic
vale wing
#

We all know this

hushed galleon
#

object oriented programming is a very important concept for discord.py since there's a lot of objects and classes it uses (just look at the docs)

#

i would suggest knowing the difference between the two and instance attributes/methods vs class attributes/methods, that way you can avoid writing mistakes like discord.Member.name which tend to pop up in the help channels
if you want some resources you can type !resources in #bot-commands and search for OOP, there's a youtube playlist by corey schafer that covers them well

vale wing
#

I and other regular members of this channel usually suggest python beginners to learn more python before getting to making discord bots, because at this point most of them just copy code and understand nothing

#

Not discouraging them or anything

#

Well I mentioned the concrete topic but anyways thanks for telling me about this I will be aware of myself

slate swan
#

it just spams

gaunt ice
#

oof

#

pin this

#

very important message

slate swan
#

i agree tbh

gaunt ice
#

oh

#

okk

slim ibex
#

that isn't the only point of view though, thats the thing

#

there are 2 ways that a new programmer can get discouraged:

  1. people telling them to go learn the language before tackling a hard project
  2. the beginner doing the hard project and not being able to do anything so they get discouraged and quit
#

its kind of a double edged sword

slate swan
# slate swan how

how do i not spam console and just print whole list instead of spam

slim ibex
slate swan
slim ibex
#

where did you put it

slate swan
#

outside the for loop?

slim ibex
#

show the code

slate swan
slim ibex
#

????

#

we said put the PRINT outside the for loop

slate swan
#

oh

slim ibex
#

wonder if a list comp would do anything here

slate swan
#

i am having iq issues

#

iq spikes 💀

slim ibex
#

ye

#

don't think that and would help

#

but doesn't Python make them into bools?

#

oh

#

im thinking of Rust where both sides must be a boolean since the compiler doesn't coerce them

#

if statement must be boolean. if foo doesn't work

#
error[E0308]: mismatched types
 --> src/main.rs:4:8
  |
4 |     if number {
  |        ^^^^^^ expected `bool`, found integer

For more information about this error, try `rustc --expla
sick birch
#

More things to speed it up

hushed galleon
#

i believe this would make a list of references to the same embed actually, since and would return the last operand if all were true

slim ibex
#

ye

native onyx
#

I am trying to add this information to the .json in this way:

#

but it is being added like this:

#

code:

import json 
dictionary = { 
    "5622987331403947": {
        "username": "Arcanjo'#5288",
        "registered": "18/03/22"
    }
} 
json_object = json.dumps(dictionary, indent = 4) 
with open("inventory.json", "a") as outfile: 
    outfile.write(json_object)
#

can someone help me?

hushed galleon
#

with .json files, you need to read and write the entire file at once, appending cant be done

sick birch
#

One of the reasons it’s not suitable as a database

hushed galleon
#

you should consider storing user ids instead of their names fetching their username as needed (since they can change) and also using a database, for example SQLite (with asqlite or aiosqlite)

sick birch
#

Even changing something small requires you to rewrite the entire file

native onyx
native onyx
native onyx
#

during the installation no errors occurred

hushed galleon
native onyx
#

ok, I'll see if I can fix it here, thanks for the help

honest vessel
#

@native onyx answer is linux ftw

#

linux is best OS for servers

#

headless n u only waste ram cpu on wat u need

native onyx
#

sad, I had kali linux installed on virtual box

honest vessel
#

kali linux is pentesting distro tho

native onyx
#

i know

honest vessel
#

but a lightweight installed debian or arch

native onyx
#

do you recommend linux mint, ubuntu or antix

#

?

honest vessel
#

ubuntu has alot preinstalled shit u dont need for q server

#

all u need is nothing n install sshd

#

n screen

native onyx
#

so which one do you recommend

honest vessel
#

then use like putty

#

to connect to server

#

i recommend buy vps for 5$

#

instqll debian

#

selfhosting is whqck

slate swan
#

only message has that attr

#

!d discord.Message.content

unkempt canyonBOT
honest vessel
#

@native onyx what kind of bot u gonna run?

small igloo
#

:) how to make slash command

outer parcel
#

Guys im trying to run my bot on heroku but every time i run it it says my python is not configured for tkninter when i never even imported it

slate swan
small igloo
slate swan
#

main?

small igloo
slate swan
small igloo
slate swan
small igloo
honest vessel
#

@native onyx i can maybe let u get an acc to my server to host urs but wanna kno what kind of bot u gonna run

slate swan
supple crescent
#
@bot.command(name = 'order')
async def order(ctx: commands.Context, *, echo: str = "oops! make sure you say something! EX: !order [example]") -> None:
    msg = await ctx.send(echo)
    await msg.add_reaction(":thumbsup:")
    await msg.add_reaction(":thumbsdown:")

    channel = message.channel
    await channel.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')
    def check(reaction, user):
            return user == message.author and str(reaction.emoji) == ':thumbsup:'
    try:
        reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
    except asyncio.TimeoutError:
        await channel.send('Gotcha! order confirmed')
    else:
        await channel.send(':thumbsup:')

i cant seem to add the kwarg message and get it to work, depending on where i put it smthn diffrent happens every time. pls help

slate swan
slate swan
small igloo
slate swan
supple crescent
small igloo
slim ibex
#

why is your default a message meant to be sent in discord @supple crescent

slim ibex
#

async def order(ctx: commands.Context, *, echo: str = "oops! make sure you say something! EX: !order [example]") -> None:

#

echo arg

supple crescent
slim ibex
#

bro don't copy tutorials

slate swan
#

dont be like binds hehe

supple crescent
supple crescent
slim ibex
#

wait

#

i thought you said "dont be like that binds"

slate swan
supple crescent
uncut zephyr
#

I want to add some text to my bots status.
I know i can use

await client.change_presence(activity=discord.Game(name="test"))

But I want to display more information's when you click on the Bot. Like an Server Link etc.

#

Like here.

#

omg

supple crescent
uncut zephyr
#

yeah thank you

#

I am a bit stupid

#

lol

supple crescent
#

np

#

orrr @uncut zephyr you could make it the about me

#

wait nvm ur already using the abt me

uncut zephyr
uncut zephyr
supple crescent
uncut zephyr
#

Haha sorry, yeah its "about me"

supple crescent
uncut zephyr
#

Thanks :)

inner epoch
#

I have a button and with the press of button I just create a channel so the button shows interaction failed what should I do abt that? Is there any way to supress it as I only want to create button and dont wish to send back any message in channel on interaction

slate swan
#

what library?

torn sail
slate swan
#

!d discord.InteractionResponse.defer

unkempt canyonBOT
#

await defer(*, ephemeral=False, thinking=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Defers the interaction response.

This is typically used when the interaction is acknowledged and a secondary action will be done later.

This is only supported with the following interaction types...
slate swan
#

just use this.

inner epoch
inner epoch
slate swan
#

no

inner epoch
#

Aye ill add it then!!Thansk a lot @slate swan @torn sail

unkempt canyonBOT
brittle axle
#

https://paste.pythondiscord.com/guzifukela I am trying to create slash commands. No errors showed up but the slash commands did not show up on the servers the bot was in. I even re added the bot with applications.commands. Intents were also added

slate swan
gaunt ice
#

guys

#

wait nvm

supple crescent
#
@bot.command(name = 'order')
async def order(ctx: commands.Context, *, echo: str) -> None:
    msg = await ctx.send(echo)
    await msg.add_reaction(":thumbsup:")
    await msg.add_reaction(":thumbsdown:")
    await ctx.message.delete()

    channel = message.channel
    await channel.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')
    def check(reaction, user):
            return user == message.author and str(reaction.emoji) == ':thumbsup:'
    try:
        reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
    except asyncio.TimeoutError:
        await channel.send('Gotcha! order confirmed')
    else:
        await channel.send(':thumbsup:')

i cant seem get the second part, the rexognize if you have reacted part working. any help?

torn sail
inner epoch
#

Wait I got it!!

supple crescent
honest vessel
#

get a room

#

Ephemeral -> btw how often can u use those are there limits?

#

could i finally use this for game?

#

sink ships game or what ever RPG

#

or can we use Ephemeral just like any msg?

#

can u do bot dm->msg->send in server Ephemeral to a member? 😛

#

ofc u can

torn sail
spring flax
supple crescent
spring flax
#

you did channel = message.channel but haven't defined message

#

you mean ctx.channel

supple crescent
spring flax
#

save yourself an extra variable

    channel = message.channel
    await channel.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')

Change this to:

    await ctx.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')
supple crescent
#

ur right!

hushed galleon
spring flax
#

and change your def check function because it has message.author

supple crescent
supple crescent
hushed galleon
#

ah okay

spring flax
#

it's ctx.author, not message.author

#

!d discord.ext.commands.Context

unkempt canyonBOT
#
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.

This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.

This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
spring flax
#

look at the attributes of Context from the docs

supple crescent
#

ahhhhhh, i see now

supple crescent
spring flax
#

show your bot construction

#

where you defined bot

supple crescent
#

bot = commands.Bot(command_prefix='!', help_command=None, intents=intents)

spring flax
#

you likely have overriden that variable with another bot

#

@supple crescent actually, show your imports

supple crescent
#

@spring flax i do have some usless stuff from experimenting btw

from distutils import errors
from doctest import Example
from email import message
from http import client
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import time
from discord import Intents
from discord.ext import commands
import asyncio

spring flax
#

but why?

#

why are you repeating imports lol

#

are you just making a discord bot?

supple crescent
#

which ones am i repeating? am i just blind 😅

supple crescent
spring flax
#
import discord
from discord import Intents
from discord.ext import commands

import time
import asyncio```
#

this will suffice

supple crescent
#

wow ok

slate swan
#

imagine emailing

toxic bluff
#

Hey, I try to implement a slash command with the disnake libary. Every time I start the Bot I get the following error: SyncWarning: Failed to overwrite global commands due to 400 Bad Request (error code: 50035): Invalid Form Body
In 0.options.0.description: This field is required
In 0.options.1.description: This field is required
warnings.warn(f"Failed to overwrite global commands due to {e}", SyncWarning) looks like I need to add descriptions to the slash command parameters. Anybody know how to fix this?

supple crescent
toxic bluff
#

I already have disnake installed

supple crescent
spring flax
#

what have you done to define channel right now?

supple crescent
# spring flax what have you done to define channel right now?

i had it defined up there :

channel = message.channel
    await channel.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')

but then we streamlined it to

await ctx.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')

should i just redifine it doen there?

spring flax
#

huh

#

you're using the bottom one?

supple crescent
#

yup

spring flax
#

That's not the error

#

you said channel is undefined

daring olive
#

when writing commands, is it typically
1 class per 1 cog?

spring flax
#

you are referring to a channel variable right?

daring olive
#

tyty

slate swan
#

Also u need to setup

supple crescent
# spring flax That's not the error

yes but

    except asyncio.TimeoutError:
        await channel.send('Gotcha! order confirmed')
    else:
        await channel.send('👍')

was relying on channel = message.channel, although that was bugged since message.chanel didnt work anyway

slate swan
#

Name huh?

vocal plover
spring flax
#

yeah i believe a cog file was meant

slate swan
#

Yes

#

1 class per 1 cog file

spring flax
vocal plover
#

I'd do 1 cog per file, but you can have multiple cogs per extension and doing so can help with the structure of large bots

daring olive
#

ah yeah by cog i meant a file

#

what's the difference between a cog & an extension?

spring flax
#

a cog file and an extension?

slate swan
#

Do try excpet have else too?

vocal plover
#

A cog is the individual class, an extension is a 'module' with a setup method

spring flax
vocal plover
#

so an extension could be

file.py
```or it could also be
```py
folder/
  __init__.py - has a setup() method
  cog1.py
  cog2.py
  ...
supple crescent
vocal plover
#

extensions are resolved in the same way as imports, so if you can import setup from {extension} that extension can be loaded by dpy

slate swan
#

she was asking about extension ig

spring flax
#

for example

try:
  #do a bot.waot_for 
except:
  #if it failes
else:
  #if the check is met
trail oxide
#
    
    @commands.Cog.listener()
    async def on_member_join(self, member):
        with open('guilds.json', 'r', encoding='utf-8') as f:
            guilds_dict = json.load(f)

        channel_id = guilds_dict[str(member.guild.id)]
        await Client.get_channel(int(channel_id)).send(f'{member.mention} welcome!')


    @commands.command(name='welcome')
    async def set_welcome_channel(self, ctx, channel: discord.TextChannel):
        with open('guilds.json', 'r', encoding='utf-8') as f:
            guilds_dict = json.load(f)

        guilds_dict[str(ctx.guild.id)] = str(channel.id)
        with open('guilds.json', 'w', encoding='utf-8') as f:
            json.dump(guilds_dict, f, indent=4, ensure_ascii=False)
        
        await ctx.send(f'Sent welcome channel for {ctx.message.guild.name} to {channel.name}')

**Error: **

line 421, in on_member_join
    await Client.get_channel(int(channel_id)).send(f'{member.mention} welcome!')
TypeError: get_channel() missing 1 required positional argument: 'id'```
spring flax
#

is this a large bot or guild?

honest vessel
#

TypeError: get_channel() missing 1 required positional argument: 'id' btw

vocal plover
daring olive
#

mm i'm reading, 1 minute

spring flax
honest vessel
#

Client.get_channel(id=str(channel_id)) ?

slate swan
#

Do u guys suggest doing client.get_channel(2839282893).send("hi")

slate swan
vocal plover
#

I'd personally put the channel in a variable (and check that it isnt None) and then use .send() on that variable

honest vessel
#

then try convert to string

#

something is going on

slate swan
#

wait

#

Why string

#

I use direct?

honest vessel
#

also should't it be guild?

trail oxide
#

so what should i du

honest vessel
#

await Client.get_channel(int(channel_id)).send(f'{member.mention} welcome!')

spring flax
honest vessel
#

guild.get_channel?

slate swan
spring flax
#

what?

vocal plover
slate swan
trail oxide
cold sonnet
spring flax
honest vessel
#

just thought guild would be needed specified

slate swan
daring olive
#

so in my example here

PingCommand class is a cog?
info is an extension?

trail oxide
#

its working!

trail oxide
#

thanks guys

honest vessel
#

^^,

slate swan
spring flax
daring olive
#

so far yes lol

slate swan
vocal plover
#

ping is the only thing that belongs in a ping cog tbf

honest vessel
#

@slate swannp

spring flax
slate swan
#

Ok

honest vessel
#

why i read it as farting?

slate swan
#

Idk

spring flax
#

lol

honest vessel
#

weird brain

slate swan
#

..

daring olive
#

so if i were to add a /server command to info.py
i'd add a new class for it
and add another bot.add_cog(...) in info.setup?

spring flax
#

well yeah

slate swan
#

No

spring flax
#

wdym info.setup? you can use the setup method

slate swan
#

U can put the commands related to it in 1 class

honest vessel
#

never used add_cog only load_exstansion

final iron
honest vessel
daring olive
#

the setup method within info.py @spring flax

honest vessel
#

yes class

vocal plover
daring olive
#

that makes more sense yeah

slate swan
#

Epic docs fail

honest vessel
#

😄

daring olive
#

i don't think i've ever seen more than 1 add_cog in any setup method.. typically.. right?

honest vessel
#

i am newbie

#

!d discord

unkempt canyonBOT
#

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

Creating a Bot account is a pretty straightforward process.

vocal plover
slate swan
#

disnake*

honest vessel
#

epic fail of docs

slate swan
#

doesnt matter lol

daring olive
slate swan
#

Lol

vocal plover
#

extensions loading is how it is so you can have better structure, and then people went and made every file its own ext lol

honest vessel
#

!d from mayter import doesnt

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 | "."+
```...
slate swan
#

Not me

honest vessel
#

lol!!!!!

slate swan
#

Makes no sense

slate swan
#

H?

honest vessel
#

.bm things & cogs

lament depotBOT
#
In the future, don't do that.

Your input was invalid: You must either provide a valid message to bookmark, or reply to one.

The lookup strategy for a message is as follows (in order):

  1. Lookup by '{channel ID}-{message ID}' (retrieved by shift-clicking on 'Copy ID')
  2. Lookup by message ID (the message must be in the context channel)
  3. Lookup by message URL

Usage:```
.bookmark [target_message] [title=Bookmark]

slate swan
#

#bot-commands

honest vessel
#

In the future, don't do that. <-- i stay away

#

dont wanna start ww3

slate swan
#

I use

vocal plover
#

for GTAO's bot we have extension init files that look like this which makes the actual loading simpler while keeping good structure and everything in places you'd expect

oblique adder
#

how do I check if bot is able to give the mentioned role from the command?
do I check the role position or what ?

honest vessel
#

@daring olive why dont u have like !vps

slate swan
#

Imports

honest vessel
#

repl n i dont know those websites they use all complain not working

vocal plover
#

because that's how dpy loads extensions

daring olive
slate swan
#

I did without it

#

Somehow

vocal plover
#

some folders arent expanded else it would be massive, but if you want to see the structure of a specific one just point it out

slate swan
#

xD

honest vessel
#

@vocal ploveri would recommend do a standalone moderation bot

vocal plover
#

pretty much the only one I can't show because it would give away sensitive logic lol

honest vessel
#

u dont want ur RPG bot fail n cant do moderation when needed

slate swan
#

Sensitive logic.

honest vessel
#

and its no need to be same bot

vocal plover
#

yeah a couple hundred lines of scam detection is not something I want to make public for the scammers to use to help them bypass it lol

slate swan
#

Custom voice does ur bot speak??

vocal plover
#

no it allows users to create small private voice channels for themselves via a command

slate swan
#

U mean private voice

honest vessel
#

maleonmale

slate swan
#

What?

honest vessel
#

1on1

slate swan
#

Melonmail?

honest vessel
#

yeah a moderation bot should be same as ur RPG bot

slate swan
vocal plover
#

I don't have an rpg bot

honest vessel
#

should't

slate swan
#

.

#

Imagine having a utility bot

honest vessel
#

this

slate swan
#

manager

#

Weird names

honest vessel
#

is moderation another bot?

slate swan
#

Ofc not

vocal plover
#

No it's part of the same bot because the bot is designed to handle important things for the server

#

In the same way @unkempt canyon has both moderation utilities and stuff like the eval command

honest vessel
#

modbot is an idler but when u need it u cant have a game bugging

slate swan
vocal plover
#

if I make it separate it wouldn't make a difference, everything in the bot is designed to fail without affecting other components, and if the whole thing is down it means the host is down so I'm fucked anyway

honest vessel
honest vessel
#

he still should keep modbot sperated from gamebot

slate swan
#

😶

honest vessel
#

ye lol?

slate swan
honest vessel
#

haha

#

will nvr happen with that wish

#

but i hope u get high traffic server one day

slate swan
#

In moderation ppl need ban kick mute unmute lock unlock nick resetnick warn

honest vessel
honest vessel
#

most usefull one

#

timeout

slate swan
#

Unban u

honest vessel
#

lol

#

timeout is kinda all u need

#

what if u timeout one 2 years why ban

slate swan
#

Ban hurts more

#

Ask me

honest vessel
#

true

#

timeout is good too

slate swan
#

I was banned for 1 year and unbanned today

honest vessel
#

kick is just meh

#

i like this buildt in timeout

#

it pauses u from all chans n voice

slate swan
honest vessel
#

n they have a countdown

slate swan
#

Also voicemute voicekick disconnect

#

How

honest vessel
#

powerabusers

#

😄

#

i hope u get shitty trafficed server

#

powerabuser

slate swan
#

Imagine completed bot but no hosting

honest vessel
#

imagine write a bot

#

n still single

slate swan
#

!_!

#

I hope discord provide free hosts for there bots

#

Later

honest vessel
#

dont u have 5bucks a month?

slate swan
#

No

honest vessel
#

i hope govs around world gives kids 5$ a month to spend on VPS

slate swan
#

I have

#

But why

#

I dont want my bot to be productive

honest vessel
#

if u want to host ur completed awesome bot

slate swan
#

I just maked it for fun

honest vessel
#

but u ask for free hosting

slate swan
#

Yup

honest vessel
#

ok i should even say that comparesion but nah bro

#

it dosnt work like that

slate swan
#

.

honest vessel
#

someone has to pay

#

electricity n bandwidthbut u want it for free

#

and 1999999999 more kids

slate swan
#

Ill pay when ill be like 18

honest vessel
#

dont you have like cutoff cards for vps duo studie'?

slate swan
#

Im 14 bro stop

honest vessel
#

maybe school should start give out that

#

personal vps 512mb

slate swan
#

Stop

#

Can we host in a router lol

honest vessel
#

if u root it yes

slate swan
#

No way

honest vessel
#

yes way

#

what does ur router do to u

slate swan
#

A ethernet pendrive

honest vessel
#

when login? put settings? hostiung?

slate swan
honest vessel
#

most routers also a linux

#

just root it n u can do what u want

slate swan
#

Who likes to root there router

honest vessel
#

but u would need a new router 😄

#

perhaps

#

u askedme

#

if u could host bot on router

slate swan
#

Nvmd

honest vessel
#

answer is yes

#

perhaps

#

probally

#

i think ur router cost more than 5$ vps

slate swan
#

Ok enough

#

@uncut zephyr

uncut zephyr
#

yes?

slate swan
#

Ur name say ping me

uncut zephyr
#

I wasn't sure if I would interrupt you

honest vessel
#

@uncut zephyr just cause of name i get no choice than to ping

slate swan
uncut zephyr
#

I guess my bad xD

honest vessel
#

lol

#

(dont ping me)

#

would prob get more

slate swan
#

@honest vessel

uncut zephyr
#

Yeah I have a question. You can add a "add to your Server" button to your Bot.
But when I try to click mine, this shows up

uncut zephyr
slate swan
#

U dont have permission

honest vessel
#

i can show mine

uncut zephyr
honest vessel
#

await channel.send(embed=embed, view=InviteBot())

slate swan
#

Vro hes saying about inviting his bot to the server

uncut zephyr
slate swan
uncut zephyr
honest vessel
#


class InviteBot(ui.View):
    def __init__(self):
        super().__init__()
        url = f"https://discord.com/oauth2/authorize?client_id=1111111111111&permissions=277105134663&scope=bot%20applications.commands"
        self.add_item(ui.Button(label="Add me to your server", url=url, style=ButtonStyle.blurple))

``` disnake
slate swan
#

I dont think thats asked

honest vessel
#

where

#

when i censured id

slate swan
#

url =

honest vessel
#

try use it

#

contact modmail

slate swan
#

Why f string there

honest vessel
#

cause i was born with 3 legs

slate swan
#

U mean 3 brain cells 🤣 jk

uncut zephyr
honest vessel
#

yea

#

super class

uncut zephyr
#

ah okay

#

yeah I guess I will ask later, thanks guys 😅

honest vessel
#

!d super

unkempt canyonBOT
#

class super([type[, object-or-type]])```
Return a proxy object that delegates method calls to a parent or sibling class of *type*. This is useful for accessing inherited methods that have been overridden in a class.

The *object-or-type* determines the [method resolution order](https://docs.python.org/3/glossary.html#term-method-resolution-order) to be searched. The search starts from the class right after the *type*.

For example, if [`__mro__`](https://docs.python.org/3/library/stdtypes.html#class.__mro__ "class.__mro__") of *object-or-type* is `D -> B -> C -> A -> object` and the value of *type* is `B`, then [`super()`](https://docs.python.org/3/library/functions.html#super "super") searches `C -> A -> object`.

The [`__mro__`](https://docs.python.org/3/library/stdtypes.html#class.__mro__ "class.__mro__") attribute of the *object-or-type* lists the method resolution search order used by both [`getattr()`](https://docs.python.org/3/library/functions.html#getattr "getattr") and [`super()`](https://docs.python.org/3/library/functions.html#super "super"). The attribute is dynamic and can change whenever the inheritance hierarchy is updated.
slate swan
#

Brooooo

#

He s just meant to invite his bot to his serv3r

uncut zephyr
#

nop

honest vessel
#

dosnt that do it?

#

wid a button

slate swan
#

Then

honest vessel
#

u think i bait u to invite my bot? 😄 u cant

uncut zephyr
#

I want this button to work. (in english: add to server)

slate swan
#

Oh.

honest vessel
#

what i just gave u code for

#

but its disnake

uncut zephyr
#

yeah but I dont understand your code

#

whats disnake?

honest vessel
#

oh

#

its a copy of discord.py that they kept develoipe while dpy died

slate swan
honest shoal
#

Discord fork lmao

slate swan
#

Lol

honest vessel
#

can i post my bot invite link here? jk

slate swan
#

Yes sure

#

I will surely not dm mod mail

boreal ravine
honest vessel
#

kek i just trie meme a valid id

honest shoal
#

it doesn't work

#

haha

slate swan
#

Its a jumpscare

honest shoal
#

ye

honest vessel
#

permission 8 😮

#

and u still clicks

boreal ravine
slate swan
honest shoal
honest vessel
#

i think i am already joined

slate swan
#

Nvmd

boreal ravine
honest vessel
#

ofc i would nvr share invite link here

half furnace
#

!stats

unkempt canyonBOT
#

Star / Wildcard imports

Wildcard imports are import statements in the form from <module_name> import *. What imports like these do is that they import everything [1] from the module into the current module's namespace [2]. This allows you to use names defined in the imported module without prefixing the module's name.

Example:

>>> from math import *
>>> sin(pi / 2)
1.0

This is discouraged, for various reasons:

Example:

>>> from custom_sin import sin
>>> from math import *
>>> sin(pi / 2)  # uses sin from math rather than your custom sin

• Potential namespace collision. Names defined from a previous import might get shadowed by a wildcard import.
• Causes ambiguity. From the example, it is unclear which sin function is actually being used. From the Zen of Python [3]: Explicit is better than implicit.
• Makes import order significant, which they shouldn't. Certain IDE's sort import functionality may end up breaking code due to namespace collision.

How should you import?

• Import the module under the module's namespace (Only import the name of the module, and names defined in the module can be used by prefixing the module's name)

>>> import math
>>> math.sin(math.pi / 2)

• Explicitly import certain names from the module

>>> from math import sin, pi
>>> sin(pi / 2)

Conclusion: Namespaces are one honking great idea -- let's do more of those! [3]

[1] If the module defines the variable __all__, the names defined in __all__ will get imported by the wildcard import, otherwise all the names in the module get imported (except for names with a leading underscore)
[2] Namespaces and scopes
[3] Zen of Python

boreal ravine
slate swan
#

!ot 💯

#

🙄

honest vessel
#

cya later

slate swan
#

Cya tmrw

honest vessel
#

happy hacking

slate swan
#

Lol

slate swan
#

🙂

cold sonnet
#

Happy hacking!

#

🙂

tacit token
#
@client.event
async def on_member_join(ctx, member):
    with open('log.json', 'r', encoding='utf-8') as f:
        guilds_dict = json.load(f)
        embed=discord.Embed(title=f"Hello {member}")
        channel_id = guilds_dict[str(ctx.guild.id)]
        await client.get_channel(int(channel_id)).send(embed=embed)
-TypeError: on_member_join() missing 1 required positional argument: 'member'
slate swan
#

how do i make this

#

instead of this

boreal ravine
slate swan
#

i am losing brain cells

#

cuz i am trying to add pages

boreal ravine
# slate swan
em.add_field(name=name, value=amount)
``` ![BanThonk](https://cdn.discordapp.com/emojis/726745780798488603.webp?size=128 "BanThonk")
slate swan
#

nono but it will send

#

all items in my inventory

#

i want like if u have more than 5 items

#

then it sends the embed with u have 5 items

#

and then going to other page

#

u can see other items

#

idk how to explain if u dont understand

tacit token
boreal ravine
hasty crest
#
def check_for_bot(self, ctx):
        def check(message):
            return not message.author.bot
        return check

res = await self.client.wait_for('message', check=MemCheck.check_for_bot(self, ctx))

I would like to understand why is the check function not working?
The check function checks if the author of the message is not a bot, but the bot just gets messages from itself regardless

slate swan
boreal ravine
slate swan
#

so basically i just needed to make name = i

boreal ravine
#

f

slate swan
#

(totally didnt suffer for 3 hours)

#

or less

tacit token
hasty crest
#

there is no context in that event

#

you have to remove it so the event works

tacit token
#

channel_id = guilds_dict[str(ctx.guild.id)]
NameError: name 'ctx' is not defined

hasty crest
#

also
channel_id = guilds_dict[str(ctx.guild.id)]
Look closer, this gets the guild not channel

boreal ravine
#

!d discord.Member.guild <-

unkempt canyonBOT
hasty crest
#

he needs to get a channel ID himself, there is nothing called member.channel in on_member_join

tacit token
boreal ravine
tacit token
hasty crest
# tacit token

What you are doing is wrong
You want to send a message to a certain channel right?
Get the ID of that channel manually and then do client.get_channel(IDHERE)

boreal ravine
hasty crest
#

because in on_member_join event, you only get the member that joined

hasty crest
boreal ravine
#

@tacit token what does guilds_dict contain?

tacit token
hasty crest
tacit token
boreal ravine
#

ok

hasty crest
slate swan
#

what do i do

slate swan
hasty crest
#

@boreal ravine Thanks for the help and sorry for bothering you
It seems I had a big misunderstanding for the check function

def check_for_bot(message): return not message.author.bot and message.channel.id == ctx.channel.id

This is what I wanted

slate swan
lapis meadow
#

Most likely a stupid question but I have a bot that posts a video response IE: Yes, No, Ehhh ETC. I want the video to post but not show the link. Here is an example of it happening. Is there something I put in my code to make the link disappear? I tried <Link> but that just shows the link and not the video.

slate swan
#

how do i make a channel move to a different category when a command is run?

#

but it wont work cuz of message.channel.id == ctx.channel.id?

slate swan
unkempt canyonBOT
#

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

Edits the channel.

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

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

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

Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead...
slate swan
boreal ravine
slate swan
slate swan
#

Btw make a command that checks the guilds, basically if ur bot has like 10 guilds with the same owner they'll not going to verify it

#

like this?

await guild.edit_text_channel.category('CLOSED TICKETS')```
#

wait

slate swan
#

omg i cant spell 💀

#

okay thanks

slate swan
#

iirc

#

!d discord.Guild.categories

unkempt canyonBOT
#

property categories```
A list of categories that belongs to this guild.

This is sorted by the position and are in UI order from top to bottom.
slate swan
#

yes

slate swan
#

Since category is a channel PB_lmao_sweat

slate swan
slate swan
#

guild has no attribute category?

#

bro_whut thats justinhmmcat

slate swan
#

ok

maiden fable
slate swan
#

anyone know why tf its saying this although it is in the same exact folder as the .py file

slate swan
maiden fable
#

and that is a good thing

maiden fable
slate swan
slate swan
maiden fable
#

understandable

#

try doing print(__import__("os").getcwd()) and see if the file is in the same folder as it prints

slate swan
maiden fable
#

😔 Yerl here, I will just go away and play some games

maiden fable
#

Idk

honest vessel
#

i dunno but fuck this gave me alaugh

slate swan
honest vessel
#

shit expensive fruits

maiden fable
#

AAAAAH YES

honest vessel
#

same price too

slate swan
honest vessel
#

give me 1000 coins plox

maiden fable
#

Reasons I hate economy bots

honest vessel
#

always wanted my own cucomber

slate swan
honest vessel
#

@slate swanhow did u come across python n start coding?

maiden fable
#

Agreed

maiden fable
honest vessel
#

lol

slate swan
#

come

lone lotus
#

import asyncpg could not be resolved

native onyx
#

do you know which type I have to pass to send the ID and the DATE?

USE usersData
CREATE TABLE listUsersData(
    id_user (typing),
    date_registered (typing)
    )
lone lotus
#

somebody help?

tacit token
#

guys on_member_leave works? on_member_join work but the leave not really

native onyx
#
comando = f"""INSERT INTO listUsersData(id_user,date_registered)
VALUES
    ({ctx.author.id},{date})"""
manic wing
manic wing
manic wing
#

!sql

unkempt canyonBOT
#

SQL & f-strings
Don't use f-strings (f"") or other forms of "string interpolation" (%, +, .format) to inject data into a SQL query. It is an endless source of bugs and syntax errors. Additionally, in user-facing applications, it presents a major security risk via SQL injection.

Your database library should support "query parameters". A query parameter is a placeholder that you put in the SQL query. When the query is executed, you provide data to the database library, and the library inserts the data into the query for you, safely.

For example, the sqlite3 package supports using ? as a placeholder:

query = "SELECT * FROM stocks WHERE symbol = ?;"
params = ("RHAT",)
db.execute(query, params)

Note: Different database libraries support different placeholder styles, e.g. %s and $1. Consult your library's documentation for details.

See Also
Extended Example with SQLite (search for "Instead, use the DB-API's parameter substitution")
PEP-249 - A specification of how database libraries in Python should work

lone lotus
honest vessel
#

SELECT Ukraine FROM Russia Where President.Name="....

#

Biden, Joe

#

meme

#

think i missed an inner join there

maiden fable
#

😔

#

Stop with these

swift imp
#

how to send a message to use in PM?

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

Sends a message to the destination with the content given.

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

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

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

which of the parameters is responsible for where the message is sent?

slim ibex
#

you specify the member instance to send it to, but that isn't a param

#

the member instance would be a param of your command function

slate swan
slate swan
slim ibex
#

well generally it would be a param

slate swan
#

get_member 👀

slim ibex
#

that works too

narrow grail
#

is there a methode to rename my discord bot If I do it in the Discord Developers Portal it doesn't work

unkempt canyonBOT
#

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

Edits the current profile of the client.

Note

To upload an avatar, a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object "(in Python v3.10)") must be passed in that represents the image being uploaded. If this is done through a file then the file must be opened via `open('some_filename', 'rb')` and the [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object "(in Python v3.10)") is given through the use of `fp.read()`.

The only image formats supported for uploading is JPEG and PNG.

Changed in version 2.0: The edit is no longer in-place, instead the newly edited client user is returned...
narrow grail
#

its a private bot

tacit storm
unkempt canyonBOT
#
Certainly not.

No documentation found for the requested symbol.

tacit storm
#

i's something like this

slate swan
tacit storm
#

ill find it real quick

honest shoal
slate swan
#

ghost ping 😔

narrow grail
vital steeple
slate swan
slim ibex
#

check what pop_random_line1() is

honest shoal
# slate swan same thing with avatar right?
To upload an avatar, a bytes-like object must be passed in that represents the image being uploaded. If this is done through a file then the file must be opened via open('some_filename', 'rb') and the bytes-like object is given through the use of fp.read().```
slim ibex
#

what is pop_random_line1()? can you show where it is defined?

slate swan
#

idk if encoding works

narrow grail
#

how to get the guild id when my bot is on some server?

honest shoal
#

how do you want an id?

#

like a command or something else

narrow grail
#

for example sending a welcome message on the certain server

honest shoal
slate swan
#

btw!

#

wait nvm lmao

slate swan
slate swan