#discord-bots

1 messages · Page 588 of 1

ornate lichen
#

i am

boreal ravine
#

disnake, discord.js ¯\_(ツ)_/¯

ebon plank
#

yes just friend me and call but be in mute and share screen @boreal ravine

boreal ravine
#

but im on mobile

tame marsh
boreal ravine
#

what

ornate lichen
#

help plss

ebon plank
rotund nova
#

dadasiduhjadas

#
                await ctx.send(f"Gracz {discord.Object(arg).name} Został odbanowany przez {ctx.author.name}.")
``` that
ebon plank
#

dude i am also mobile @boreal ravine

boreal ravine
ebon plank
#

?

boreal ravine
boreal ravine
ebon plank
#

ok

#

bye

ornate lichen
#

anyone got anytutorials on discord dictionary bots

rotund nova
tame marsh
#

@boreal ravine thanks bro

ornate lichen
boreal ravine
#

!resources learn how to index dicts pls 🙏 😔

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.

boreal ravine
#

or just google "how to index dicts"

ornate lichen
#

mean=json_data["list"][0]["definition"]

#

isnt this good enough??

tawdry perch
#

Is this correct way? ```py
@edit.command()
async def msg(self, ctx, message: discord.Message, *, content: str = None):
msgs = await self.bot.fetch_message(message)
msgs.edit(content)

rotund nova
#

@boreal ravine bot dont do it, but unban

slate swan
#

correct way of what

tawdry perch
#

to edit message *

tame marsh
#

@boreal ravine

tawdry perch
#

thx

slate swan
#

I think so

#

but for fetching the message... idk

boreal ravine
unkempt canyonBOT
ornate lichen
#

i sorted out

boreal ravine
#

try the command u did but add a ==2.21 at thee end @tame marsh

ornate lichen
#

but now ikeep getting the same outpur

slate swan
#

!d discord.TextChannel.fetch_message

unkempt canyonBOT
#

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

Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
boreal ravine
boreal ravine
ornate lichen
boreal ravine
ornate lichen
#

ok

tawdry perch
tame marsh
tame marsh
#

ERROR: Could not find a version that satisfies the requirement disnake==2.2.1 (from versions: none) still

slate swan
tame marsh
#

thats waht im doing

tame marsh
ornate lichen
#

my params=querystring

boreal ravine
#

i didnt mean that

#

I mean this

def define(word): #word is a param
    ...
define("kayle")
slate swan
#

I'm not a professional

#

but I'm certain

#

that you could use aiohttp instead of requests

#

cuz everyone says that so I'll say that too

boreal ravine
#

mhm

ornate lichen
boreal ravine
#

A word.

tawdry perch
#

This gave me a error: https://paste.pythondiscord.com/fobenuyuku.sql ```py
@edit.command()
async def msg(self, ctx, message: discord.Message, channel: typing.Optional[discord.TextChannel] = None, *, content: str = None):
if content is None:
await ctx.send("Message content is not provided")
if channel is None:
channel = ctx.channel
msgs = await channel.fetch_message(message)
msgs.edit(content)

slate swan
#

hm

boreal ravine
#

.edit(content=content)

#

hm

tame marsh
#

@boreal ravine whats the name of the argument for an message id image

#

in a slash command

ornate lichen
#

how do i take user input

boreal ravine
ornate lichen
#

yeah but how

#

querystring = {"term":"wat"}

boreal ravine
ornate lichen
#

in this wat is the term

boreal ravine
ornate lichen
#

how to i change that to useinput

boreal ravine
#

params

ornate lichen
#

uhhh

#

!!params

unkempt canyonBOT
#

Parameters vs. Arguments

A parameter is a variable defined in a function signature (the line with def in it), while arguments are objects passed to a function call.

def square(n): # n is the parameter
    return n*n

print(square(5)) # 5 is the argument

Note that 5 is the argument passed to square, but square(5) in its entirety is the argument passed to print

boreal ravine
ornate lichen
#

!params

unkempt canyonBOT
#

Parameters vs. Arguments

A parameter is a variable defined in a function signature (the line with def in it), while arguments are objects passed to a function call.

def square(n): # n is the parameter
    return n*n

print(square(5)) # 5 is the argument

Note that 5 is the argument passed to square, but square(5) in its entirety is the argument passed to print

ornate lichen
#

!functions

boreal ravine
#

#bot-commands

tawdry perch
boreal ravine
#

hm

sage otter
twilit scarab
#

Does anyone know if it’s possible to create custom embeds in discord with tkinter or do I have to create a whole GUI like Mee6 / Carlbot for e.G to get this done? Atm I have to write the embed in my script itself but moderators can‘t do that

tame marsh
tame marsh
#

And this as an argument in a slash command

twilit scarab
sage otter
#

What are your intentions again?

#

You want to make a custom embed thing?

#

You can’t even do that. You only have what discord gives you.

twilit scarab
dense swallow
sage otter
#

Oh I know what you mean now

twilit scarab
sage otter
#

I mean you can like build the embed one step at a time

#

If that’s what you mean

#

And give out the finished product once you’re done building

dense swallow
#

Idk how to make it tho

sage otter
#

Exactly what I said earlier

twilit scarab
#

The problem with this is, only I will be able to add this code to the bot

#

Not my staff

quaint radish
#

Are you trying to create a command like:

!createembed <embedtitle>.. etc

dense swallow
#

No.. u can listen to the msg sent by staff to make the embed.. if it's not in json throw an error msg @twilit scarab

twilit scarab
sage otter
#

I mean that’s not hard then

quaint radish
#

is your bot defined as client or bot? I can make some simple code for that

tawdry perch
#

This gave me a error: https://paste.pythondiscord.com/fobenuyuku.sql ```py
@edit.command()
async def msg(self, ctx, message: discord.Message, channel: typing.Optional[discord.TextChannel] = None, *, content: str = None):
if content is None:
await ctx.send("Message content is not provided")
if channel is None:
channel = ctx.channel
msgs = await channel.fetch_message(message)
msgs.edit(content)

quaint radish
#

what type of error?

sage otter
twilit scarab
quaint radish
boreal ravine
quaint radish
#

just capitalise the C then

tawdry perch
sage otter
#

That not what I mean

boreal ravine
#

discord.Client?

sage otter
#

discord.Client

boreal ravine
#

Ah

sage otter
#

That’s his bot instance

#

He’s not using the commands framework

quaint radish
#

o

#

thats mb then

sage otter
#

.command() isn’t applicable

boreal ravine
tawdry perch
twilit scarab
#

Wait a sec I can send a code of my self made embeds seems very similar

boreal ravine
#

Hm

tawdry perch
#

ye

#

Let me try again to be sure if it was wrong ID

quaint radish
#

i don't think you can have another param if you set one to None

#

what was the error?

quaint radish
#

o

#

my code just broken then very nice

boreal ravine
#

🤧

tawdry perch
twilit scarab
#

@client.command()
async def displayembed(ctx):
    embed = discord.Embed(
    title = 'Title',
    desciption = 'Das ist eine Beschreibung',
    colour = discord.Colour.blue())
    embed.set_footer(text='Das ist die Fußzeile')
    embed.set_image(url='https://th.bing.com/th/id/R.62a4c8c1e6c7c1d5bf82f6a4045b9eef?rik=4lMjn%2bzGk5IaHQ&riu=http%3a%2f%2fcdn.onlinewebfonts.com%2fsvg%2fimg_2382.png&ehk=iXWYrW4JB4Ccu6%2fybCCde3JhkK9rBCktSurZ5dEzUVs%3d&risl=&pid=ImgRaw&r=0')
    embed.set_thumbnail(url='https://apis.mail.aol.com/ws/v3/mailboxes/@.id==VjN-Zbt3c8-N7kOxm6T1YDJHrc92A3z36kOm-0-_CS-m8DoM6JCVFZntKKrwX6KKwGaBo7_qQ9o-6a8oIA8hEkZ7zw/messages/@.id==AC5734sGxdJAYW1pVwSIKFySmYM/content/parts/@.id==3/thumbnail?appid=aolwebmail&size=400w')
    embed.set_author(name='Autor Name',
    icon_url='https://apis.mail.aol.com/ws/v3/mailboxes/@.id==VjN-Zbt3c8-N7kOxm6T1YDJHrc92A3z36kOm-0-_CS-m8DoM6JCVFZntKKrwX6KKwGaBo7_qQ9o-6a8oIA8hEkZ7zw/messages/@.id==AC5734sGxdJAYW1pVwSIKFySmYM/content/parts/@.id==2/thumbnail?appid=aolwebmail&size=400w')
    embed.add_field(name='Feld Name', value='Feld Anzahl', inline=False)
    embed.add_field(name='Feld Name', value='Feld Anzahl', inline=True)
    embed.add_field(name='Feld Name', value='Feld Anzahl', inline=False)
    await ctx.send(embed=embed)

Lol don’t look at the format, im on mobile rn

boreal ravine
#

Why

boreal ravine
twilit scarab
twilit scarab
#

Displayembed(Ctx, title, description, embed_field) and so on?

boreal ravine
unkempt canyonBOT
#

@boreal ravine :white_check_mark: Your eval job has completed with return code 0.

001 | Title: Hi
002 | Description: Yes
003 | None
twilit scarab
#

Okay nice, I’ll play around with that later. Now I know where to start. Thank you!!! 🙏🙏🙏

boreal ravine
boreal ravine
#

nice

ornate lichen
#

how do i tell the user about error

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range

#

like this

boreal ravine
#

!d discord.ext.commands.Bot.on_command_error

unkempt canyonBOT
#

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

The default command error handler provided by the bot.

By default this prints to [`sys.stderr`](https://docs.python.org/3/library/sys.html#sys.stderr "(in Python v3.9)") however it could be overridden to have a different implementation.

This only fires if you do not specify any listeners for command error.
tawdry perch
boreal ravine
#

me either I cant try ur code since im not on pc

rapid whale
tawdry perch
boreal ravine
#

👍

thick sigil
#

discord.Message typehint already converts it to a message object

cinder horizon
#
entry = {
                'title': f'Top {limit} Osu scores for {member.display_name}',
                'fields': [
                    {'name': 'Artist', 'value': m.artist},
                    {'name': 'Title', 'value': m.title},
                    {'name': 'Creator', 'value': m.creator},
                    {'name': 'CS (Circle Size)', 'value': m.diff_size},
                    {'name': 'AR (Approach Rate)', 'value': m.diff_approach},
                    {'name': 'HP (Health Drain)', 'value': m.diff_drain},
                    {'name': 'OD (Overall Difficulty)', 'value': m.diff_overall},
                    {'name': 'Length', 'value': m.total_length},
                    {'name': 'Score', 'value': i.score},
                    {'name': 'Max Combo', 'value': i.maxcombo},
                    {'name': 'Hits', 'value': f"{i.count300}/{i.count100}/{i.count50}/{i.countmiss} (300/100/50/misses)", "inline": False},
                    {'name': 'Perfect', 'value': "Yes" if i.perfect else "No"},
                    {'name': 'Rank', 'value': i.rank},
                    {'name': 'PP', 'value': i.pp},
                    {'name': 'Mods', 'value': str(i.enabled_mods)},
                    {'name': 'Date', 'value': str(i.date)}
                ]
            }
            
            entries.append(entry)
            messages = []
            for entry in entries:
              messages.append(entry)
            await ctx.send("\n".join(messages))
```This be a smol osu command m trying and i cant get entry thing to be sent as one message...and could someone help me wid dat and adding these values to multiple embeds....like when they run `!osu scores 2` it gives 2 embeds which i can later put it up as paginator thingy
river kindle
#

I was creating a command a clear, and it works, in addition I wanted the bot to send a message: "I have deleted the messages." i tried to do it with delete_after = 5 but it doesn't work. Can someone help me?

cinder horizon
river kindle
cinder horizon
river kindle
#

ss?

cinder horizon
#

screenshot*

river kindle
#

it has no errors when the command is executed

#
   delete_after=5,colour=discord.Colour.green())
   await ctx.send(embed=embed)
``` this is the code
cinder horizon
#
embed = discord.Embed(description=f"  Deleted.."colour=discord.Colour.green())
await ctx.send(embed=embed, delete_after = 5)
``` try this
#

wait

river kindle
#

ok

#

lemme try

boreal ravine
#

what doesnt work exactly

#

😌

river kindle
#

okok

#

yay

#

it works, tysm

cinder horizon
#

peashe

warm goblet
#

Does anyone know how to have the bot send animated emotes in separate lines? My attempt at it wasn't very good :

Edit : Nevermind, figured it out.

boreal ravine
#

!ot please

unkempt canyonBOT
ebon plank
#

hey @boreal ravine pls click on the link which i send

ebon plank
#

pls

boreal ravine
#

no

ebon plank
#

there's a quiz abt me

boreal ravine
#

no

ebon plank
#

why

warm goblet
warm goblet
boreal ravine
ebon plank
#

?help

tawdry perch
slate swan
tawdry perch
#

Why is this here?

slate swan
#

feels like some virus ngl

tawdry perch
#

Dunno, maybe I just ignore that

#

.topic

lament depotBOT
#
**What commands/features are you proud of making?**

Suggest more topics here!

tawdry perch
ebon plank
#

@tawdry perch

crimson pulsar
#

that is strictly off topic @ebon plank and advertising is not allowed unless approved

tawdry perch
#

You actually wont

slate swan
slate swan
#

why would anyone know about you

slate swan
#

sus , alt?

ebon plank
tawdry perch
#

Lets move back to topic

#

.topic

lament depotBOT
#
**What unique features does your bot contain, if any?**

Suggest more topics here!

tawdry perch
slate swan
#

if bugs were features , many

tawdry perch
#

Bugs are features

dusk dust
#

is this wrong?

role = discord.utils.get(ctx.author.guild.roles, id=905084755400335370)
    await ctx.author.add_roles(role)
``` when the bot gets to this part of the command it results in a CommandInvokeError... why?
ornate lichen
#

??

ornate lichen
#

.

#

.

#

what do i do then

boreal ravine
ornate lichen
#

because it soed say that theya re supported

ornate lichen
boreal ravine
#

use another python version

ornate lichen
boreal ravine
#

why

ornate lichen
boreal ravine
#

just use 3.9.7

#

python*

dapper cobalt
ornate lichen
#

doesnt work

dapper cobalt
ornate lichen
boreal ravine
#

pp

cloud dawn
dapper cobalt
#

You need to install the packages again.

ornate lichen
dapper cobalt
#

Well, it works with 3.5.3 and higher. So I guess the answer is obvious.

ornate lichen
slate swan
#

is 3.10 higher than 3.5.3? 😳

tawdry perch
#

and 3.10.0 does not have any critical changes so it should work

ornate lichen
slate swan
#

reload vsc

tawdry perch
#

you are not using it anywhere yet (may be a problem)

ornate lichen
#

wdym

dapper cobalt
slate swan
tawdry perch
dapper cobalt
#

This error means that the package is not installed. Though, it's a known visual issue with VSC.

slate swan
#

ye

tawdry perch
#

oh

ornate lichen
slate swan
#

that's why we reload after installing pkg

tawdry perch
#

Then I have mistaken it to another error, my bad

slate swan
#

but when working with venv, we don't need to reload in vsc

#

idk how this works

dapper cobalt
#

There's no error when you don't use a package.

ornate lichen
#

when i used 3.10.0

#

in the morning

#

it was this same error

thick sigil
#

did u even install the package under the right python version

#

lol

ornate lichen
#

how do i change it

thick sigil
#

py -3.10

dapper cobalt
#

Kai's here, I'm gonna just watch now. kekw

ornate lichen
cloud dawn
#

Your doing fine, we're vouching ducky_dave

ornate lichen
#

?

ornate lichen
#

bruhh

#

why is it still 2 over here

mild token
ornate lichen
#

i did lol

mild token
#

same error??

ornate lichen
#

yeah

#

i want to switch to 3.10.0

#

but im getting those import erros

mild token
#

do pip show discord.py in console and tell me what it says

#

and do pip --version aslo

ornate lichen
#

but here it shows this

mild token
#

do that mate it console

ornate lichen
mild token
#

i am also using vsc rn i know from bottom line u r sending

mild token
#

show full console output

slate swan
#

if member.premium_type == discord.PremiumType.nitro_class:, is this not valid?

#

same with if member.premium_type == discord.PremiumType.nitro:

ornate lichen
dusk dust
ornate lichen
#

@mild token

mild token
#

kill current terminal

ornate lichen
#

so how do i change

boreal ravine
mild token
#

and open new terminal

#

and check python --version again

ornate lichen
cloud dawn
#

just doing py should give all the info.

ornate lichen
#

@mild token

mild token
#

i recommend to uninstall all other py version and keep only 1

ornate lichen
#

only when i do python3 --version it shows 3.10.0

ornate lichen
#

whats the command

mild token
ornate lichen
mild token
mild token
ornate lichen
slate swan
#

if member.premium_type == discord.PremiumType.nitro_class:, is this not valid?
same with if member.premium_type == discord.PremiumType.nitro:

mild token
dusk dust
# boreal ravine show code
@bot.command(name='captcha')
async def verify(ctx):

    member = ctx.author.name
    user = ctx.author
    randomstr = (''.join(
        random.choice(string.ascii_uppercase + string.digits)
        for _ in range(7)))
    randomvar = str(randomstr)

    confirm = discord.Embed(
        title='text here ' + ctx.author.name,
        description=
        'text here: ``'
        + str(randomstr) +
        '``. text here',
        color=0xf1c40f)

    confirm.add_field(
        name='text here',
        value=
        'text here'
    )

    welcome = discord.Embed(title='text here',
                            description='text here',
                            color=0xc27c0e)

    confirm = await ctx.author.send(embed=confirm)

    def check(m):
        return ctx.author == m.author and m.content == randomvar

    await bot.wait_for("message", check=check)
    msg1 = await ctx.author.send(
        'text here')
    await asyncio.sleep(5)
    await ctx.author.send(
        'text here')
    await asyncio.sleep(2)
    await msg1.delete()

    role = discord.utils.get(ctx.guild.roles, id=905084755400335370)
    await ctx.author.add_roles(role)
mild token
#

dont use play button

ornate lichen
mild token
slate swan
#

if member.premium_type == discord.PremiumType.nitro_class:, is this not valid?
same with if member.premium_type == discord.PremiumType.nitro:

mild token
#

in console

ornate lichen
mild token
#

and after installing run again as i said

slate swan
#

ill just come back another time

cloud dawn
#

^^^ python3 -m pip install discord.py

mild token
ornate lichen
#

worked

#

i got a warning tho

mild token
#

doesnt matter

#

now run as i said

mild token
dusk dust
ornate lichen
mild token
#

i recommend to learn virtual environment

#

pipenv will make your life easier

#

if u have multiple py version

boreal ravine
mild token
ornate lichen
mild token
#

is your bot working??

ornate lichen
#

entConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x104adf2b0>

#

nope

mild token
#

check pin for ssl certificate error

ornate lichen
#

?

#

what pin

cloud dawn
#

From this channel.

mild token
#

if i remember correctly stella given very nice explanation

ornate lichen
#

?

cloud dawn
mild token
#

bot not able to connect to dev portal

#

i mean discord api lol

ornate lichen
#

huh

mild token
#

just rerun your code

ornate lichen
#

i did

mild token
#

same error??

boreal ravine
boreal ravine
ornate lichen
#

yeah

ornate lichen
mild token
ornate lichen
#

ggole what

boreal ravine
#

can u like read messsages?

mild token
#

@ornate lichen

cloud dawn
#

Thanks for spoiling.

mild token
slate swan
#

@ornate lichenI have no idea about the certificates thing, it should be related to securing the connection. But about the unclosed session, I suppose you are using a static session and not making use of an async context manager, so you should call __aexit__ on the session, this closes the connection which is what the context manager should have done.

ornate lichen
cloud dawn
# mild token ??

Sorry, ignore that, it's just that sometimes people have to give some effort of searching it themselves.

boreal ravine
#

^

slate swan
#

when your code finishes running

#

await session.__aexit__()

mild token
cloud dawn
#

I suggest clicking the link of @mild token.

boreal ravine
cloud dawn
#

Such a shame stella left though 😓

boreal ravine
#

she did?

ornate lichen
mild token
boreal ravine
#

idk what yall talking about

cloud dawn
#

😂

mild token
#

nope

#

check pins

ornate lichen
mild token
#

3rd last pin

mild token
ornate lichen
#

i followed it

mild token
#

yeh just checked 😂

boreal ravine
mild token
#

👍

boreal ravine
#

🤨

ornate lichen
#

yup did it

boreal ravine
#

when u gonna stop asking for help 🤨

ornate lichen
#

idk

#

but ill be helping one day too😁

boreal ravine
#

🤧

cloud dawn
#

We could use a smart set of hands, there are still alot of repl.it users. And people who don't bother to learn OOP.

boreal ravine
#

OOP is easy idk why people stressing about it

#

🧐

ornate lichen
#

🥱

cloud dawn
boreal ravine
#

Depends.

pliant gulch
#

Easy to learn since python is an OOP lang

#

Everything you learn as basics should have something to do with OOP

slim whale
#
@bot.command ()
async def giveaway (ctx, time = None, *, prize = None):
  if time == None:
    return await ctx.send ("Incluye una ** duración **!")
  if prize == None:
    return await ctx.send ("Porfavor pon un ** premio **!")
  embed = discord.Embed (colour=0x87CEEB)
  embed.add_field(name=f"Sorteo!",value=f"{ctx.author.mention} ha creado un **sorteo** || Premio: **{prize}**")
  time_convert = {"s": 1, "m": 60, "h": 3600, "g": 86400}
  gawtime = int(time[0] * time_convert[-1])
  embed.set_footer(text = f'Este sorteo acaba en: {time}')
  gaw_msg = await ctx.send(embed=embed)

  await gaw_msg.add_reaction("🎉")
  await asyncio.sleep(gawtime)

  new_gaw_msg = await ctx.channel.fetch_message(gaw_msg.id)

  users = await new_gaw_msg.reactions[0].users().flatten()
  users.pop(users.index(bot.user))

  winner = random.choice(users)

  await ctx.send (f"Enhorabuena! {winner.mention} ha ganado el **sorteo!** || Premio: `{prize}`")```
#

why my giveaway code doesnt work?

#
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: -1```
#

gawtime = int(time[0] * time_convert[-1]) i think its this but idk how to fix it

slate swan
#

time_convert = {"s": 1, "m": 60, "h": 3600, "g": 86400} has no key '-1'

slim whale
slim whale
slate swan
#

I don't understand your code's purpose, please be specific such as "how do I reverse a list"

#

that is a dict

slate swan
slim whale
#

if something in time_convert:

#

i want if time has an s it multiplies for the number i said in time_convert

slate swan
#

I see you're trying to get a duration, maybe try using datetime.strptime, more reliable

slate swan
slim whale
#

okk, i will check

slate swan
#

it parses stuff like this and converts to timedeltas
2d15h20s > 2 days 15 hours 20 seconds
1w1d > 1 week 1 day

#

specifically for discord bots

#

thanks to @distant birch ;)

slim whale
#

tnxxx

#

i will check it

random sleet
#
async def vk(ctx, member : discord.Member, *, reason=None):
    embed68 = discord.Embed(title="Votekick", description=f"vote imod {member.mention}", color=0xf4000)
    channel88 = bot.get_channel(907352866946158632)
    await channel88.send(embed=embed68)```

Can someone help me remake this to 

When 5 votes have been send then the bot kicks the user 🙂
distant birch
slate swan
#
            if member.display_avatar.is_animated():
                nitro  = " :Nitro:"
            else:
                try:
                    req = await self.bot.http.request(discord.http.Route("GET", "/users/{uid}", uid=user.id))
                    banner_id = req["banner"]
                    if banner_id:
                        nitro = " :Nitro:"
                except:
                    nitro = ""``` no errors, probably due to the exception, but im not sure what im doing wrong
sage otter
slate swan
#

if the output is true, then it defines nitro as NitroBadge

#

if its not true, it checks if the user has a custom banner

#

if that result is true, it defines nitro as NitroBadge

#

if that result is also false, it defines nitro as ""

sage otter
slate swan
#

or False

slate swan
#

as seen here

#

but the attributes and strings themselves were causing problems i believe

manic wing
#

who is quikblend

#

i want to know what the hell all those badges are

slate swan
#

Bro has damn near every badge i can think of 😭

manic wing
#

what are the 2 yellow ones and the far left one

slate swan
manic wing
#

damn nice

slate swan
#
**Badges**\n{staff}{mod}{partner}{hypesquad}{bravery}{brilliance}{balance}{bh}{bh2}{botdev}{early}{nitro}{boost}```
#

The only badge i can think of that he doesnt have is Bot Dev

slate swan
pale zenith
#

yeah theres like 12 of them that you can access trough the .public_flags attribute its a pain
(staffpartnernewhypesquadbughunterbraverybrilliancebalancesupporterbughunter_goldearlybotdevverified_botcertified_moderator)

pale zenith
#

then these lol

#

bless named tuples tho blobpray

slate swan
#

ive defined every mobile status, desktop status, web status, public flag, custom status, and now im working on rich presence

pale zenith
#

rich presence? how so

slate swan
#

speaking of, how can i check if a user is playing something

slate swan
pale zenith
#

!d discord.Member.activities

unkempt canyonBOT
#

The activities that the user is currently doing.

Note

Due to a Discord API limitation, a user’s Spotify activity may not appear if they are listening to a song with a title longer than 128 characters. See GH-1738 for more information.

slate swan
#

thanks

pale zenith
#

note

#

requires presences intent

slate swan
#

ive got all lol

pale zenith
#

good good

slate swan
#

oh the day i can have 1 open

#

rip, embed didnt load

pale zenith
#

rooMonkaS f

slate swan
pale zenith
#

no

slate swan
#

yikes

slate swan
distant tree
#
@commands.group(description='Give a member a role./Take away a members role.')
@commands.has_permissions(manage_roles=True)
async def role(self, ctx, member : commands.MemberConverter, *, role : MXRoleConverter):
    if role in member.roles:
        await member.remove_roles(role)
        await ctx.reply(f'Removed `{role.name}` from `{member.name}`.')
    else:
        await member.add_roles(role)
        await ctx.reply(f'Gave `{role.name}` to `{member.name}`.')

@role.command(description='Give a member a role./Take away a members role.')
@commands.has_permissions(manage_roles=True)
async def all(self, ctx, role : MXRoleConverter):

Yes the command is complete.

discord.ext.commands.errors.MemberNotFound: Member "all" not found.

slate swan
#

well

#

that means that you dont have a member in your server named 'all'

pale zenith
#

invoke_without_command = True in the group decorator

distant tree
pale zenith
#

subcommands without that work like this @distant tree :

#

!role <member> <role> all <role>

#

for example

distant tree
pale zenith
slate swan
pale zenith
#

what does that mean? a list

slate swan
#

well

#

its meant to test if the users streaming

#

i was just asking you if ive done it right lol

pale zenith
#

i told you not, and told you what was wrong tho lol

#

you can use discord.utils.find

slate swan
#

so in otherwords

#
if isinstance(member.activities, discord.Streaming):``` is the proper way to go about it
pale zenith
#

no

#

isinstance(member.activities, list) would be the only case that would be true

#

as it is, as i said, a list

pale zenith
# pale zenith you can use discord.utils.find
custom_activity = discord.utils.find(lambda act: isinstance(act, discord.CustomActivity), member.activities)
listening = discord.utils.find(lambda act: isinstance(act, discord.Spotify), member.activities)
slate swan
#

ohhhh

#

i see

pale zenith
#

in this case tho, your isinstance would work

#

i think

slate swan
# pale zenith ```py custom_activity = discord.utils.find(lambda act: isinstance(act, discord.C...

using this can i return a true/false? py if discord.utils.find(lambda act: isinstance(act, discord.Spotify), member.activities) is True: listening = "Listening to" elif discord.utils.find(lambda act: isinstance(act, discord.Spotify), member.activities) is False: listening = "" elif discord.utils.find(lambda act: isinstance(act, discord.Spotify), member.activities) is None: listening = ""

pale zenith
#

what

silent ermine
pale zenith
#

find will try to find

slate swan
pale zenith
#

and return None if not found

silent ermine
silent ermine
slate swan
#

so a third line

#

well

#

fifth and sixth

pale zenith
slate swan
#

that seems much shorter

#

a lot more efficient lol

pale zenith
#

yes

#

not having to find twice or thrice

silent ermine
#

so if i wanted to know if they were playing roblox, then it would be discord.Roblox.member.activites?

pale zenith
#

there is no such thing as discord.Roblox

#

that is not how activities work kekw

silent ermine
silent ermine
pale zenith
#

member.activities

silent ermine
#

so just spotify?

pale zenith
#

that is not how object-oriented-programming works

silent ermine
#

or is that wrong.

pale zenith
#

uhm

#

discord.Spotify and discord.Streaming exist as they are integrations w the companies and discord

silent ermine
pale zenith
#

and they are displayed differently/have different data

#

no hold on a sec.

silent ermine
#

k

pale zenith
#

ok

#

those cases (roblox and minecraft)

#

!d discord.Game

unkempt canyonBOT
#

class discord.Game(name, **extra)```
A slimmed down version of [`Activity`](https://discordpy.readthedocs.io/en/master/api.html#discord.Activity "discord.Activity") that represents a Discord game.

This is typically displayed via **Playing** on the official Discord client.

x == y Checks if two games are equal.

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

hash(x) Returns the game’s hash.

str(x) Returns the game’s name.
silent ermine
pale zenith
#

yes

#

scroll down from here once it loads:

#

there are the different types

#

discord.Game, discord.Streaming, etc

silent ermine
#

streaming, watching, game?

pale zenith
#

discord.Game, discord.Streaming, discord.CustomActivity and discord.Spotify

silent ermine
#

ahhhhhhhhh ok

pale zenith
#

streaming and watching are discord.Activity.type

#

which returns a discord.ActivityType such as discord.ActivityType.listening

#

of course all of them being instances not the classes, etc etc basic oop

silent ermine
#

ohhhh

#

ok thank u

thorn leaf
#

How do you make buttons with v2?

flat thistle
# thorn leaf How do you make buttons with v2?
from discord_components import Button, ButtonStyle, Select, SelectOption, ComponentsBot

rolesbutton = await ctx.send("-------------------------", components=[Button(style=ButtonStyle.red, label="Click to view member list", custom_id="button1")])
interaction = await client.wait_for(
                "button_click", check=lambda inter: inter.custom_id == "button1"
            )

@client.event
async def on_button_click(interaction):
    with open('userlist.txt') as f:
        lines =f.readlines()
        f.close()
    listembed = discord.Embed(name='Role Members', description=''.join(lines))
    listembed.set_thumbnail(url="")
    await interaction.channel.send(content=None, embed=listembed)
    with open('userlist.txt', 'w') as f:
        f.truncate(0)
        f.close()

This is pulled straight from my working bot, I included everything the bot references for buttons

#

Ofc, the txt file parts is specific to the bot, so ignore that and the embed parts

thorn leaf
#

Thanks

flat thistle
#

Np, if you have any questions about it, feel free to DM or ping me

thorn leaf
#

👍

slate swan
#

Hey, I am migrating my code to slash commands, and I've ran into trouble. I am aware of my problem being that I respond to the same interaction more than once. I have tried many different methods to fix this but I gave up. Here's what I want the output to be:

When the /gban command is ran, the interaction is immiedtely responded to with "Banning user from all SL2 servers". Then, once the user is banned from one server, the interaction's original message is edidted, and the "Banning user" message is gone and now it says "User was banned from: (insert server)" As they are being banned from every server, the bot continues to edit and add the server they are being banned from BUT keeps the earlier servers as well. There should also be an exception edit, so if a user cant be banned from the certain servers I defined, it should also insert that server and alert the command executor to the failure. Finally, once all is done, there should be a bolded message at the end of the message that says "Banned the user from all SL2 servers".

@client.slash_command(name="gban", guild_ids=[794596546830008330], description="Ban a user from all SL2 servers!")
async def gbanslash(ctx, user: disnake.User, reason: str):
    if ctx.author.id in authors:
        for guild in client.guilds:
          if guild.id in guilds:
              try:
                await guild.ban(user)
                await ctx.response.send_message(content='Sucessfully banned **' + str(user) + '** from the server called **' + guild.name + '**')
              except (disnake.Forbidden, disnake.HTTPException):
                await ctx.response.send_message(content='There was an error banning **' + str(user) + '** from the server called **' + guild.name + '**')
        await ctx.response.send_message(content='Successfully banned **' + str(user) + '** from all SL2 servers!',mention_author=True)
    else:
        await ctx.response.send_message(content='Only SL2 High Command can run this command, please contact **SaintBrighten#3919** for more information!', delete_after=5)
        await ctx.message.delete(delay=5)

Here is my current code, obviously I am aware of the interaction already responded error as aforementioned.

Any and all advice/help would be appreciated on how to achieve this!

#

this nested dictionary wont work {'data': 'compontent_type': 2, 'custom_id': '暋ࣁ微⟺徍囈㩅繁ղ汦ℕ犦殿媧寐㻉枱槮็椕絮坪ಁ㾯糎燩㝀耀'}} it says sytanax error

slate swan
#

also idk how to read those symbols

#

are those symbols right?

slate swan
silent ermine
#

So I have this problem:
In cogs i have to define variables each time in the command
Is there a way to put it 1 time like in a main.py file?

pale zenith
silent ermine
#

!d discord.Spotify

#

huh

silent ermine
pale zenith
#

yes

#

or as a bot attribute

silent ermine
pale zenith
#

bot._last_member = ...

#

(your bot is named 'client')

silent ermine
silent ermine
#

Nvm

valid perch
#

If your unfamiliar with them I'd suggest brushing up on em

slate swan
#

import discord
from discord.ext import commands

client = commands.bot(commands_prefix = !)

@client.event
async def on_ready():
await client.change_presence(activity=discord.game('hi'))
print('bot is ready.')

client.run

#

Invalid syntax line 4

dusky pine
#

you forgot the quotes at !

slate swan
#

Ok ty

dusky pine
#

and it's not commands_prefix, its command_prefix

slate swan
dusky pine
#

show me the code

slate swan
#

import discord
from discord.ext import commands

client = commands.bot('command_prefix' = '!')

@client.event
async def on_ready():
await client.change_presence(activity=discord.game('hi'))
print('bot is ready.')

client.run

#

@dusky pine

true mica
slate swan
#

Ok

dusky pine
#

wtf

#

they're right

slate swan
#

capitalize Bot

dusky pine
#

yea that too

slate swan
#

@slate swan huh

slate swan
#

Capital b on Bot

#

Ok

#

AYYY

#

Ty

#

@slate swan thx

slate swan
round schooner
#

hi

slate swan
round schooner
#

i need help with class link for python

slate swan
#

@slate swan new problem XD

dusky pine
#

capitalize Game

#

discord.Game

slate swan
#

^

slate swan
#

NOW

#

My status bot is finished

#

Nice

#

Thanks

#

alex

#

i need help can u talk to me in dms

slate swan
#

@dusky pine thanks

timber kindle
#
import discord
import os

client = discord.Client()
@client.event
async def on_ready():
  print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
  if message.author == client.user:
    return
  if message.content.startswith("/Hi"):
    await message.channel.sent("Hello!")

  client.run(os.getenv('TOKEN'))```

Am I doing something wrong? My bot won't go online
slate swan
#

uh i think ur right send me ss of the error

slate swan
slate swan
timber kindle
slate swan
#

its a error but i dont want show it on the discord server bc it shoes my bot token can i show u in dms

final iron
#

Just remove the token

slate swan
#

Yuh

slate swan
timber kindle
#

I forgot to add the token

slate swan
#

I got a python code for status and I got json code for appearance (phone icon) but the online from python code is taking over json code

slate swan
#

We’ve all made that mistake

timber kindle
#

It's still not working

slate swan
#

Show error

timber kindle
#

It doesn't show an error... the program just does... nothing

final iron
#

client.run needs to be outside of the event

#

Unindent it 1 level

#

Also don't make a bot like that

timber kindle
#

changed that and like 5 errors in lines that aren't even there pop up

final iron
#

Send the error

timber kindle
final iron
#

Using a / as a prefix is a bad idea

slate swan
#

Yes

#

Bc that’s being discord api

timber kindle
slate swan
#

Process.env.TOKEN

final iron
#

Are you using repl?

slate swan
#

Maybe

final iron
#

Shit

slate swan
#

Finally

#

Did it all on repl btw

final iron
#

While this may seem like a nice and free service, it has a lot more caveats than you might think, such as:

  • The machines are super underpowered.
    • This means your bot will lag a lot as it gets bigger.
  • You need to run a webserver alongside your bot to prevent it from being shut off.
    • This isn't a trivial task, and eats more of the machines power.
  • Repl.it uses an ephemeral file system.
    • This means any file you saved via your bot will be overwritten when you next launch.
  • They use a shared IP for everything running on the service.
    This one is important - if someone is running a user bot on their service and gets banned, everyone on that IP will be banned. Including you.
#

@slate swan ^

slate swan
#

I use hacker plan

#

I use repl bc I can code on pc and mobile so I can code on the go lol

#

I have shit pc bc it’s laptop

#

So repl is good

final iron
#

Yes

slate swan
final iron
#

Its still a self bot

slate swan
#

It’s just changing icon to phone

#

Well self bot is for yourself

#

So it’s not actually self bot

#

😎😎😎😎

final iron
#

I'm not sure how the rules would stand on doing something like that

pale zenith
#

¯_(ツ)_/¯

final iron
#

I mean using something to change the status to mobile

#

I'm aware of discord tos and this servers tos

pale zenith
#

"change the icon to mobile"?

final iron
#

I'm guessing that he means the status showing the mobile icon

pale zenith
#

ah.

timber kindle
final iron
#

It should work on pycharm

#

You would just need to insert your token into the code

shy roost
#

i was wondering if there is a method to get the date when a user joined a server?

slate swan
#

!d discord.Member.joined_at

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC that the member joined the guild. If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be None.

slate swan
shy roost
#

ah okay

#

i did joined_on

#

and that didn't work, i'll try this out

#

@slate swan that worked, I have another question, how can I get the url of a user's avatar?

timber kindle
#

I got my bot online... will It stay online if I close pycharm?

shy roost
#

@timber kindle no if you are locally hosting it through pycharm. If you deploy it to a server like a ssh one that you can purchase, then you won't have to deploy it from pycharm and it will stay online, but if you are deploying your bot through pycharm, then your bot depends on it, therefore if you close the pycharm window, the bot will go offline.

timber kindle
#

makes sense

unkempt canyonBOT
#
Huh? No.

No documentation found for the requested symbol.

slate swan
#

example:

await ctx.send(f"{member.avatar_url}")
opaque plinth
#

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

but to get the url u must add _url

#

is this right client = commands.Bot(command_prefix=prefix, intents=intents)

opaque plinth
#

yes

slate swan
#

k so i want my bot perfix to be =help tell me the code

pale zenith
#

command_prefix = '=help' i guess?

#

but why tho

#

=helphelp, =helpban, =helpkick

#

i dont see the point but 🤷‍♂️ who am i to question it

slate swan
#

bro it gives me erros when i tryed it

pale zenith
#

said errors are?

slate swan
#

command_prefix = '=help i copy paste it and it gave me errors

opaque plinth
#

What's the error

pale zenith
#

said errors are?

stark hearth
#

but why =help

timber kindle
opaque plinth
#

also who use =help as a prefix 🤔

slate swan
opaque plinth
#

yea

final iron
#

I do think this choice is strange though

#

=helpwhois @final iron

#

Imagine typing that in

#

also =helphelp

slate swan
final iron
#

prefix is pls

slate swan
#

yeah ik

#

its a little phrase tho i just idk

#

it just feels odd to me

final iron
#

^

silent ermine
opaque plinth
# final iron Dank memer does that

but his prefix is =help it's must be help or just = =help is weird when he want to send the help command he should use =helphelp weird.

opaque plinth
loud junco
#
  userid = message.author.id
  idk = str(userid) + 'wool'
```will this work
#

will it be 757508305256972338wool?

opaque plinth
#

try it and see

loud junco
#

idk where to try

silent ermine
final iron
#

Make a test command

loud junco
#

i dun wanna risk my whole project

loud junco
silent ermine
#

!eval print('testing' + 'wool')

unkempt canyonBOT
#

@silent ermine :white_check_mark: Your eval job has completed with return code 0.

testingwool
loud junco
silent ermine
final iron
#
@bot.command()
async def test(ctx):
  userid = message.author.id
  idk = str(userid) + 'wool'
  print(idk)
#

You can always create a second bot for testing

slate swan
#

message is undefined

final iron
#

I just copied their code for them

#

Its their job to fix it

loud junco
#

what is context btw

#

i use async def test(message): normally

slate swan
#

!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.
slate swan
#

the message thing in your code must actually be context

#

misleading name moment

loud junco
#

=.=

#

so message is a kind of context?

slate swan
#

no

#

its a context , you just named it message

loud junco
#

oo

slate swan
#

try doing message.content in the command and you'll get what im saying

loud junco
#

so i changed context to message?

#

just the name?

silent ermine
#

message is basically ctx (context)

loud junco
#

its still context?

#

i just change its name?

silent ermine
slate swan
#

yes

silent ermine
#

message is basically ctx

loud junco
silent ermine
#

ok

queen summit
#

ctx is context

slate swan
#

variable naming doesnt matter

loud junco
#

message == context in that scenario

queen summit
#

ah

#

didnt read it so

slate swan
#

you can even use just c as your context py async def cmd(c):

loud junco
#

oo

loud junco
#

i think yes

loud junco
slate swan
loud junco
slate swan
#

its just a function which works regardless of variable names

loud junco
#

i get it now

slate swan
#

or even c.send would work

#

context has a send coro

#

!d discord.ext.commands.Context.send

unkempt canyonBOT
#

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

Sends a message to the destination with the content given.

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

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

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

can i write userid = message.author.id itself as a line of code?

#

not in a function

#

cuz i cant

slate swan
#

message would be undefined then

loud junco
slate swan
#

well not necessarily

slate swan
loud junco
slate swan
slate swan
#

make a bot variable

silent ermine
slate swan
#

you can do "global <varName>"

#

what's c?

#

globals in discord bots are bad

slate swan
slate swan
silent ermine
slate swan
#

if you really wanted to

loud junco
slate swan
loud junco
slate swan
#

because with concurrent code, the variable would update for other concurrently running functions

#

bot._my_id = the id

#

simpl

loud junco
#

the id?

#

user_id?

silent ermine
#

show me your code

slate swan
loud junco
#

like this?

slate swan
#

you can

loud junco
#

i wanna make user_id as the var name is this how i do it?

slate swan
#

yeah sure

loud junco
#

alright

#

but where do i add it ? anywhere?

slate swan
#

you would get it when u do , bot.user_id

loud junco
#

or in specific places

slate swan
loud junco
#

its same forever

#

i wanna do this

#

i save those user's items with their code

#

like 12345432wool
1232947648329fish

#

so i will take their id and add it to the items

#

to get their items

slate swan
#

so at the place where you defined bot py bot = commands.Bot(..............> #just add this below bot.user_id = #the id you want

loud junco
#

=.=

slate swan
silent ermine
loud junco
#

lemme create one

slate swan
#

dont say you use discord.Client 🔪

loud junco
#

erm

silent ermine
loud junco
#

client = discord.Client()

silent ermine
#

:(

loud junco
#

oof

silent ermine
#

:)

slate swan
slate swan
#

yes

loud junco
silent ermine
#

oh wait its bot = commands.Bot

slate swan
#

!d discord.ext.commands.Bot this is the thingy

unkempt canyonBOT
#

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

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

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

yes

loud junco
#

i write like this?

bot = commands.Bot
client = discord.Client()
slate swan
#

yeah

silent ermine
#

bot = commands.Bot(command_prefix = commands.when_mentioned_or("$", "$$"))

slate swan
#

its much more helpful while making commands

silent ermine
#

or that ig

loud junco
boreal ravine
#

why not just use commands

#

🙃

loud junco
#

wdym by commands

slate swan
silent ermine
boreal ravine
silent ermine
boreal ravine
#

how is this related

silent ermine
#

...?

slate swan
silent ermine
#

define a prefix and then do like @client.command(), etc

slate swan
#

just use commands.Bot it makes life easier

slate swan
#

hm

loud junco
silent ermine
silent ermine
slate swan
boreal ravine
silent ermine
boreal ravine
silent ermine
#

@loud junco

Here is a basic starting main.py (or what ever the name of the main file is):

from discord.ext import commands

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

@bot.command(name="hello")
async def hello_world(ctx):
    await ctx.send("Hello, world!")

bot.run("your_token_here")```
boreal ravine
#

why spoonfeed

silent ermine
#
  • he seems to know all of that
boreal ravine
#

yes, but they wont understand if you spoonfeed and I already gave a tutorial about discord.ext.commands

silent ermine
#

I am helping summarize it

boreal ravine
#

the type of things you should learn before using dpy

silent ermine
loud junco
#

im going to change everything in my bot again

#

AHHH

#
import discord.ext.commands
from discord.ext import commands
```this 2 is the same right?
#

or isit different

slate swan
#

first line is wrong

slate swan
#

import discord.ext.commands

loud junco
#

=.=

boreal ravine
#

Well ig if you use the first one your gonna have to do
discord.ext.commands.Bot()

loud junco
#

oo ok

boreal ravine
#

but like what sarthak said the 2nd import is better

loud junco
#

ok

#

now i need to change everything ;-;

#

!code

#

!link

#

whats the command

boreal ravine
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

loud junco
#

thanks

#

this is how my code looks like

#

it will still work right?

slate swan
#

yes

#

they will work 'too'

loud junco
#

=.=

#

wdym by 'too'

boreal ravine
#

dont ask about everything pls

boreal ravine
loud junco
#

oo

#

imma change then

slate swan
#

anything you did with discord.Client is possible with commands.Bot

#

so it will work 'too' i meant

loud junco
#

alright

slate swan
#

other than that there are many other ways to make commands with it

#

as mentioned in the tutorial kayle sent

boreal ravine
slate swan
#

.dev

zenith basin
boreal ravine
#

what

silent ermine
boreal ravine