#discord-bots

1 messages ยท Page 1020 of 1

pliant gulch
#

I'm confused can you rephrase

glad cradle
#

no

slate swan
#

how can typehinting break inheritance at any codepoint~

#

its for typehinting stuff so i.e if you want an argument to get satisfied by a function it would be typehinted with Callable

pliant gulch
#

Typehinting decorators are a pain

regal pulsar
#

isnt it just

slate swan
#

sure

regal pulsar
#
def foo(bar: str):
    pass
slate swan
pliant gulch
#

You're proving my point

slate swan
slate swan
glad cradle
slate swan
#

it kinda is a pain just a bit

#

Embed one

glad cradle
#

@commands.command()
  async def ping(self, ctx):
        embed = discord.Embed(title="Ping")
        embed.add_field(name="`Pinging...`")
        embed.add_field(name=f"**Latency is** ``{round(self.bot.latency * 1000)}``**ms**")
        msg = await ctx.send(embed=embed)
slate swan
#

bro is it not documented or do i have the wrong path?

glad cradle
slate swan
#

Hmm

glad cradle
slate swan
#

Yes

glad cradle
#

this should work, just correct the indentation

slate swan
#

hm true, you can still just stringyfy the return type instead of returning self type

#

ah, got it

#

its still the same

pliant gulch
#

This could be easily fixed with a TypeVar though

#

Self is still the preferred way though

slate swan
#

How to solve this?

#

Means?

left crater
#

why are you storing ctx.send in a variable?

slate swan
left crater
#

that doesnt exist

#

its reply

slate swan
#

what

regal pulsar
#

like

slate swan
#

?

slate swan
#

2 space means?

regal pulsar
#
@bot.command()
async def test(ctx):
    msg = await ctx.channel.send("Ok")
    await asyncio.sleep(1)
    await msg.delete()
slate swan
regal pulsar
slate swan
#

Ok

#
@commands.command()
  async def ping(self, ctx):
        embed = discord.Embed(title="Ping")
        embed.add_field(name="`Pinging...`")
        embed.add_field(name=f"**Latency is** ``{round(self.bot.latency * 1000)}``**ms**")
        msg = await ctx.send(embed=embed)
regal pulsar
#

how are you using classes but not indenting right ๐Ÿ’€

slate swan
#

@regal pulsar

#

theres an invalid character in the line

#

so its not an underscore or a letter or number etc

#

You know you don't need to mark every picture you send as spoiler, right?

#

Copy pasting made you paste an invalid character

slate swan
slate swan
#

has happened to me before

#

yeah

slate swan
#

๐Ÿงข

#

?

#

Nothing

#

ok

red kernel
#

i require assistance

slate swan
#

We require code/errors

red kernel
#

ok so

#

ive made my bot

#

import os
import discord
from discord.ext import commands

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

@bot.command()
async def hello(ctx):
await ctx.send("Hello!")

token = os.environ['TOKEN']
bot.run(token)

#

tjhis is the code quite simple

slate swan
#

And your command doesn't work with no errors, right?

red kernel
#

oh no no it works fie

#

fine*

slate swan
#

Right

red kernel
#

the thing is how do i make a new command such as ?joke

river pivot
#

use api's

slate swan
#

Just like you made one for ?hello

#

Copy the command you've made in the middle and rename the fuction

async def joke(ctx):
red kernel
#

but then i get this

#

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "joke" is not found

#

am i supposed to like

#

write it on the same file or make a seperate on

#

cause thats what im doing rn is making a separate and copy pasting the code and only changing the command

river pivot
#

you need get channels at on_ready

red kernel
#

is someone gonna help me or should i go look on youtube

river pivot
#

@red kernel wwit

maiden fable
#

it takes upto 2 hours for those to show up

river pivot
#
@bot.command()
async def joke(ctx):
    await ctx.send("joke")
#

@red kernel

red kernel
maiden fable
#

seems like it

red kernel
#

in a new file or the same lines of code

slate swan
#

None

#

Below your other command

#
@bot.command()
async def hello(ctx):
    ...

@bot.command()
async def joke(ctx):
    ...
red kernel
#

now i get File "main.py", line 12
async def joke(ctx):
^
IndentationError: unexpected unindent
๎บง

fading marlin
#

what the- why do you have a discord.Client subclass inside of a Cog class?!

slate swan
#

!indents

unkempt canyonBOT
#

Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

red kernel
river pivot
#

here its shoes you used a japanese char

slate swan
#

Have you actually learned Python before doing a bot? Just as a side question

slate swan
#

The issue is the indentation

river pivot
#

!eval

def ๆ“(x):
    print(x)

ๆ“("a")
unkempt canyonBOT
#

@river pivot :white_check_mark: Your eval job has completed with return code 0.

a
river pivot
#

hmmm

slate swan
slate swan
river pivot
#

!eval

print(999-้˜ฟๅ‘†)
unkempt canyonBOT
#

@river pivot :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name '้˜ฟๅ‘†' is not defined
river pivot
#

hmmm

red kernel
#

ok im sorry

river pivot
slate swan
river pivot
wicked quest
#

what did you even expect to happen

river pivot
#

999 - 13

#

but it dont work

wicked quest
#

!eval

้˜ฟๅ‘† = 13
print(999-้˜ฟๅ‘†)```
unkempt canyonBOT
#

@wicked quest :white_check_mark: Your eval job has completed with return code 0.

986
river pivot
#

on def names or var nsmes unicode works

wicked quest
#

? i dont see a problem

red kernel
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

wicked quest
#

read this, do this

velvet haven
#

Can anyone help me with asyncpraw

wicked quest
river pivot
#

!eval

print(20-๐Ÿ™๐Ÿœ)
unkempt canyonBOT
#

@river pivot :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(20-๐Ÿ™๐Ÿœ)
003 |              ^
004 | SyntaxError: invalid character '๐Ÿ™' (U+1D7D9)
velvet haven
#

Actually unintentionally created NSFW bot ๐Ÿฅถ

river pivot
#

hmmm

slate swan
#

You can do your random tests in #bot-commands instead of flooding this channel ๐Ÿ‘

wicked quest
velvet haven
#

โฌ‡๏ธ

fading marlin
#

where are you defining my_msg?

wicked quest
#

not to be cocky but it would help if we knew what is my_msg

fading marlin
#

?

#

could you show the code?

slate swan
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

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

Adds a reaction to the message.

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

add_reaction doesn't return anything

slate swan
#

As you can see it doesn't return anything

#

So keep using msg instead of setting a new variable my_msg

wicked quest
#

yep

slate swan
#

what's that kwarg to set it so that ppl who are mentioned in the message aren't actually mentioned

#

so for example if u mention @slate swan it won't actually mention them

#

!d discord.AllowedMentions

unkempt canyonBOT
#

class discord.AllowedMentions(*, everyone=True, users=True, roles=True, replied_user=True)```
A class that represents what mentions are allowed in a message.

This class can be set during [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") initialisation to apply
to every message sent. It can also be applied on a per message basis
via [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for more fine-grained control.
slate swan
#

Take a look at allowed_mentions

#

!d discord.abc.Messageable.send

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

Right here

#

you can set it there and globally, as i do sometimes

#

Yes

pseudo portal
#

"(" was not closed i mean i did... (and im using pycord with bridged commands so i can have application and prefix)

slate swan
#

Probably missing a , after "Pick a category"

pseudo portal
#

ooh dang! i shldve seen that lol

#

tysm!

slate swan
#

Again

#

Stop doing msg = await msg.add_reaction

#

Just do await msg.add_reaction...

#

You're always setting the variable before that to None

#

Correct

#

Of course

#

Sure

#

For the ending you can use the timestamp <t:timestamp:R>

#

Here would be an example

#

!e

import time

print(f"<t:{int(time.time())}:R>")
#

Sending this will give nice formatting, try it yourself

#

Just get the timestamp of a datetime object, which is probably what you have right now.

pseudo portal
#

somma aint right ๐Ÿ˜‚

slate swan
#

You're using twice the same option value

pseudo portal
#

okay idek whats up with me anymore, istg i checked it five times howd i keep missing it ๐Ÿคฃ

pliant gulch
unkempt canyonBOT
#

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
fading marlin
#

in the app_commands.CommandTree.command() decorator, there's a guild kwarg where you can specify the guild ID

#

e.g @tree.command(guild=discord.Object(id=MY_GUILD_ID))

#

note that when syncing, you should also specify the guild ID the same way you'd do with the decorator c:

#

haven't gotten what to work?

pseudo portal
#

guild_ids

fading marlin
#

welp

#

oh

#

so bot has a bot.wait_for thing, which is basically what you want

#

!d discord.ext.commands.Bot.wait_for

unkempt canyonBOT
#

wait_for(event, /, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message,
or to react to a message, or to edit a message in a self-contained
way...
fading marlin
#

there we go

torn sail
pseudo portal
#

ye, if its puclic itd take your bot a few hours to sync, and make sure u invited the bot with application commands enabled. and add guild_ids to bypass waiting, but itd only work for the specific listed servers

slate swan
#
@client.event
async def on_ready():
    print("Loaded & Online!")
    client.loop.create_task(status_task())
``` how change into idle?
fading marlin
#

nono, it's a global wait_for, you specify what type of action you want in the event arg

#

I believe there's an example in the doc

slate swan
#

Yes

fading marlin
slate swan
#
@client.event
async def on_ready():
await bot.change_presence(status=discord.Status.idle)โ€Š

    print("Loaded & Online!")
    client.loop.create_task(status_task())
#

Like this?

torn sail
#

Make sure not to change presence on ready. Use the activity kwarg in the bot constructor

slate swan
#

Ok

fading marlin
slate swan
#

And dnd?

fading marlin
#

wdym?

brave forge
#

why don 't I click on the reaction if I didn 't click on the first one first ?? And why can they only work in turn ?

slate swan
#

@slate swan

torn sail
unkempt canyonBOT
slate swan
fading marlin
#

then you should probably remove the str(reaction.emoji) == ":one:" from your check, otherwise it'll only check for the 1๏ธโƒฃ reaction, instead of expecting any reaction as input

#

apart from that, you're already checking if the input reaction is already a 1๏ธโƒฃ, 2๏ธโƒฃ or 3๏ธโƒฃ

sick birch
fading marlin
#

nope, don't delete your if statement, delete the part in your check function where you check for the emoji type

#

yep

ebon island
#

If an Asyncio task has a done callback, and during the original task there is a VoiceClient.play() in that task, is the task considered done after the song is "played" or after it finishes and hits the after block?

pseudo portal
#
async def cmnd(ctx):
    select = Select(
    placeholder="Pick a category",
        options=[
            discord.SelectOption(label="One"),
            discord.SelectOption(label="Two"),
            discord.SelectOption(label="Three"),
            discord.SelectOption(label="Four"),
            discord.SelectOption(label="Five"),
    ])
    async def my_callback(interaction):
        await interaction.response.send_message()
```how can i make the `await interaction.` to edit it? wadda i use for edits? ![think](https://cdn.discordapp.com/emojis/846423939558801488.webp?size=128 "think")
worldly solstice
#

Hey guys quick question:

Is it possible to make the value of an embed a hyperlink?
I know it can be done by for example:
embed.add_embed_field(name='Buyer', value='[go to google.com](https://www.google.com/)')
, wont work for me since my value and my link are variables tho.

Thank you in advance ๐Ÿ™‚

ebon island
#

what do you mean they are variables?

worldly solstice
fading marlin
worldly solstice
#

thats how that would look in my case and this would for obv reasons not work

ebon island
#

I'm really confused about why you've written it that way, is there a particular reason you're doing it like that?

#

I'd suggest an f string and referenced the variable that way

pseudo portal
worldly solstice
ebon island
#

so your best friend is going to be an f string, a formatted string

#

denoted by f''

#

so for example f'What a nice day today, how are you doing, {name_of_friend}?'

fading marlin
#

!e ```py
my_var = "your best friends :D"
print(f"F strings are {my_var}")

unkempt canyonBOT
#

@fading marlin :white_check_mark: Your eval job has completed with return code 0.

F strings are your best friends :D
ebon island
#

๐Ÿ˜„

worldly solstice
#

Oh that could work, thank you very much!

#

Really appreciate it!

ebon island
#

haha it not only could work, it will work ๐Ÿ™‚ F strings are awesome, most places you use strings an F string is the best and most pythonic way to do it

fading marlin
#

there's also string concatenation, % thingamajic, and str.format

#

but we don't talk about those...

ebon island
#

yep, f string is basically an evolved version of those

pseudo portal
fading marlin
pseudo portal
#

aah rip

#

but itd prolly b similar

#

do u know why it gives an error even after await interaction.message.edit works?

fading marlin
#

traceback?

worldly solstice
#

It works, thank you very much guys! Today i learned about f" strings! Highly appreciated!

fading marlin
#

sure thing c:

ebon island
#

No problem ๐Ÿ™‚ Best of luck on your journey in Python! Keep asking questions and keep exploring!

pseudo portal
fading marlin
#

could you send the error that you're getting?

pseudo portal
vast gale
#

what's your code

#

use interaction.response.edit_message

#

not interaction.message.edit

pseudo portal
# vast gale what's your code
async def cmnd(ctx):
    select = Select(
    placeholder="Pick a category",
        options=[
            discord.SelectOption(label="One"),
            discord.SelectOption(label="Two"),
            discord.SelectOption(label="Three"),
            discord.SelectOption(label="Four"),
            discord.SelectOption(label="Five"),
    ])

    async def my_callback(interaction):
        await interaction.message.edit(f"You chose: {select.values[0]}")
    select.callback = my_callback
    view = View()
    view.add_item(select)
await ctx.respond("Here ye go!", view=view)
pseudo portal
sick birch
reef trail
#

yeah cause this makes sense

pseudo portal
sick birch
#

I see

#

Either way that doesn't seem right

slate swan
reef trail
#

despair i forgot

pseudo portal
slate swan
reef trail
#

i havent had to work with functions in like a good 2 weeks so i completely forgot how they worked

fading marlin
slate swan
#

methods*

#

its referred as a method since its inside of a class

vast gale
pseudo portal
#

hmm content="" embed=embed?

slate swan
#

no just embed=embed

fading marlin
#

^

pseudo portal
#

aah aight

#

tysm lads!

slate swan
#

๐Ÿป

fading marlin
#

:D

brave forge
#

@slate swanby the way, I threw my code here and there was Russian and you didn't write something like the rule number

slate swan
brave forge
sick birch
#

Because bots can't be focused in one channel like you might on your regular client

slate swan
sick birch
#

Ah. You can use ctx.channel.id for that

slate swan
#

Alright thanks.

sick birch
#

Yup

brave forge
#

@slate swan you're lucky you got an adequate assistant))

brave forge
# slate swan haha

But remember there are people from the category of I'll throw off the link without knowing what)

sick birch
brave forge
sick birch
#

About what? It seems like you're upset about someone linking you to docs/a rule?

brave forge
sick birch
#

That's because links often times explain things much better than we can

#

Especially when those links are official documentation

#

Written by a specialized team of people who know the library inside and out

brave forge
sick birch
#

Wise, I understand you're frustrated that people throw links around but like I mentioned, those links are helpful and reading documentation is an essential skill

brave forge
brave forge
sick birch
#

Yeah, from personal experience, I can tell you at one point you stop needing documentation because you've kind of memorized it at that point

#

And unfortunately the documentation does seem to cater to those people which is counterintuitive

#

Regardless, documentation is the best resources when you're trying to learn anything

brave forge
sick birch
#

I've heard it said that discord.js's documentation is better, yeah

brave forge
#

@sick birch
well, you see. You yourself understand that a person like me will never understand how to do something about it, well, this is more complicated

brave forge
brave forge
sick birch
#

I see

#

It's honestly really just practice, time and effort

jovial dock
#

why does it print this like once every few hours, it doesn't bother me and doesn't mess with anything. I just want to know why

sick birch
#

Which is why it's not suggested to do anything in there other than printing

jovial dock
#

jesus you type fast

sick birch
#

For example, if you were creating new database tables in on_ready, you'd have like 20 different duplicate tables just because it connects to the websocket multiple times over the course of a a few hours

#

!d discord.on_ready if you look at the documentation it actually has a warning saying exactly that too

unkempt canyonBOT
#

discord.on_ready()```
Called when the client is done preparing the data received from Discord. Usually after login is successful
and the [`Client.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.guilds "discord.Client.guilds") and co. are filled up...
sick birch
timber tendon
#

Is there a way to let a discord bot know when it has too many requests and then have it send a message letting the user know this?

Not sure if I'm explaining this well, but basically something similar to how if you spam commands in Bcoins bot, it tells you to wait like this:

slate swan
unkempt canyonBOT
#
Missing required argument

package

alpine pewter
#

Actually, it is how I formatted it.
Postman works fine, can someone show me what I did wrong?

timber tendon
slate swan
#

I really need sleep, sorry

alpine pewter
#

I'm not exactly great at coding, I'm learning too.
I would advise if you're starting, to learn slash commands - They're being enforced by Discord here soon.
Some may disagree but I learned how to use custom prefixes !help -help ?help as an example and switching just confused me.

I can send you YouTube links of videos that teach you if you'd like, the ones I learned from.

torn sail
timber tendon
torn sail
#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

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

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

I don't use .ext...

#

frick

torn sail
#

you can use it like this

@commands.command()
@commands.cooldown(1, 30, commands.BucketType.user) # so 1 use for every 30 seconds per user
async def command(ctx):
    ...
torn sail
timber tendon
#

because I just followed the first tutorial on youtube which uh doesn't use .ext

#

๐Ÿ’€

torn sail
#

well ext is much better

#

and yt tutorial are outdated

slate swan
cobalt zephyr
#

ext has amazing features and hybrid commands also in master branch

slate swan
#

or just check if the bucket for the endpoint is depleted

slate swan
timber tendon
cobalt zephyr
alpine pewter
#
@bot.slash_command(guild_ids=guild_ids)
async def log(interaction : Interaction, query : str = SlashOption(description="Enter the user's gamertag.")):
    for id in server_ids:
        url = f"https://api.nitrado.net/services/{id}/gameservers/games/players"
        async with aiohttp.ClientSession() as session:
            response = await (await session.get(url, headers=headers)).json()
        print(response["data"]["players"])

        if query in response["data"]["players"]:
            print("True")

Can someone help me with this?
The code works until line #7 - When I try to query a name in the file, it doesn't seem to come back.
Even though it's listed in the JSON.
Did I format it wrong?

slate swan
#

and the final if statement is unnecessary

alpine pewter
slate swan
#

you can jusr make one session?

alpine pewter
#

How would I go about that?
I asked in here and someone said this was the proper way to do it

slate swan
#

no you would just do a session outside of the loop

torn sail
#
# this is bad
for i in range(5):
    async with aiohttp.ClientSession() as session:
        ...

# this is good
async with aiohttp.ClientSession() as session:
    for i in range(5):
        ...
alpine pewter
slate swan
#

its fine you just need to be a little more careful

alpine pewter
slate swan
#

yeah just set your actual for loop inside of the context manager

alpine pewter
#

Okay, let me try to fix it some.
Though, at the bottom -

        if query in response["data"]["players"]:
            print("True")

Did I format this wrong or is it bec of how I did the rest of the code?

slate swan
#

you could just do

if response.get("data"):
    ...
torn sail
#

well on this line

print(response["data"]["players"])

it will raise a KeyError if its not in it

#

so the if statement will always happen

slate swan
#

yeah hence the reason you should use dict.get

torn sail
#

or there will be a key error

slate swan
#

!d dict.get

unkempt canyonBOT
#

get(key[, default])```
Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to `None`, so that this method never raises a [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError "KeyError").
alpine pewter
#

I guess I should explain what I'm doing more, I kinda didn't explain it well.
I'd be searching through 16 servers, getting their name and then matching it by fetching their id

End-Goal is for the user to type /ban gamertag then it'll ban them.
Though, you need their id to ban, wanting to make it more simple.

It's a bit of stretch, haven't done something like this before.

            "name":"HOLY Zyrtec",
            "id":"8561a51590f9d ....",
            "id_type":"internal",
            "online":false,
            "actions":[
               "delete"
#

I've yet to use dict.get let me check that out

boreal ravine
#

did you try restarting your bot?

abstract kindle
#

is it possible to check the type of device a user is on

#

I wish we could know if theyre on discord mobile or not

boreal ravine
#

stop your bot, run it again

abstract kindle
#

Not talking to you

boreal ravine
unkempt canyonBOT
#

is_on_mobile()```
[`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.10)"): A helper function that determines if a member is active on a mobile device.
abstract kindle
#

no way

#

Bruh

#

That's so helpful. Cause some embeds look like trash on mobile

boreal ravine
#

ctrl + c in terminal

slate swan
#

it have to check this all day long? it's almost an overload

boreal ravine
#

did you sync them?

abstract kindle
#

Are your commands global or local

boreal ravine
#

!d discord.app_commands.CommandTree.sync

unkempt canyonBOT
#

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

Syncs the application commands to Discord.

This must be called for the application commands to show up.

Global commands take up to 1-hour to propagate but guild commands propagate instantly.
cloud dawn
#

Client doesn't have cogs

boreal ravine
#

true

#

also why do you have a ctx parameter in the commands

cloud dawn
#

You need to either make a custom cogs ext or just use Bot

#

You would also need to make your own tree.

forest grotto
#

-help

#

@unkempt canyon

slate swan
#

Yo! I have a bot and a bot that I am working on from discord.ui import View, button works with one bot but doesnt work with the new one, it says there is no module named discord.ui

stone beacon
#

Make sure u got d.py installed m8

sick birch
heavy folio
#

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

slate swan
#

it is the same code for my other bot and it works fine, and I dont think that one is using the updated discord.py

heavy folio
#

await it

slate swan
#

@heavy folio why does my old bot still work the same?

#

Is there a way to just keep it like that for my new bot?

#

and when I await it says await outside of function

heavy folio
#

show code

slate swan
#
async def on_ready():
  print(f"{bot.user} is online!")
  
for filename in os.listdir("./cogs"):
  if filename.endswith(".py"):
    bot.load_extension(f"cogs.{filename[:-3]}")
#

please tell me I dont have to change much, I hate updates

supple thorn
#

What

slate swan
vagrant brook
#

i mean you can put it in on_ready no?

supple thorn
unkempt canyonBOT
#

class discord.ext.commands.Cog(*args, **kwargs)```
The base class that all cogs must inherit from.

A cog is a collection of commands, listeners, and optional state to
help group commands together. More information on them can be found on
the [Cogs](https://discordpy.readthedocs.io/en/master/ext/commands/cogs.html#ext-commands-cogs) page.

When inheriting from this class, the options shown in [`CogMeta`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CogMeta "discord.ext.commands.CogMeta")
are equally valid here.
slate swan
#

okay thanks

supple thorn
#

Updates brings features and bug fixes

slate swan
vagrant brook
#

you just have to add an await

#

how would that change everything

slate swan
#

bot.load_extension()
in mine disnake its not coro

slate swan
vagrant brook
supple thorn
supple thorn
vagrant brook
#

either way its not quite a lot of changes

slate swan
#

like that?

supple thorn
#

If you really don't like this changes then go back to the outdated version of discord.py

slate swan
#

cause that doesnt work

vagrant brook
#

await

slate swan
#

yeah it dont work๐Ÿคทโ€โ™‚๏ธ

vagrant brook
#

did you make the setup function async

sick birch
supple thorn
#

Ok told them to

slate swan
#

well thats not where they were originally

#

I was asking if thats how they said

sick birch
#

It's going to throw an ExtensionAlreadyLoaded and crash your bot in on_ready()

supple thorn
vagrant brook
#

Just add a boolean to check if on_ready was already called

sick birch
vagrant brook
#

anyway

#

did you make cog setup functions async

supple thorn
slate swan
#

okay, can I just make it like my other bot and stay at 1.7.3? But then I need help importing the discord.ui

#

even though my other bot works :/

vagrant brook
#

there isn't discord.ui in 1.7.3

sick birch
slate swan
#

But Im not on my other bot and it works just fine

#

Maybe my discord.ui is outdated to work with 1.7.3 also

sick birch
#

I really doubt you'd be able to use discord.ui on 1.7.3

slate swan
#

I swear I am

sick birch
#

There's probably something else going on

slate swan
#

Ill show my other bot code

sick birch
#

Like venvs or conflicting installs

slate swan
sick birch
#

What's to say that's the one your bot is using?

#

You've probably got a 2.0 somewhere else it's using

slate swan
#

well, I dont have to use the await shit for my old bot

sick birch
#

Then you've got a broken package install and you should get it fixed asap

slate swan
#

anyways I guess I am fucked so how do I do the await shit again?

#

for new bot

#

starting over

#
import discord 
import os
from discord.ext import commands
import json


bot = commands.Bot(command_prefix="!", intents=discord.Intents.all(), case_insensitive=True)
bot.remove_command("help")
@bot.event
async def on_ready():
  print(f"{bot.user} is online!")
  
for filename in os.listdir("./cogs"):
  if filename.endswith(".py"):
    bot.load_extension(f"cogs.{filename[:-3]}")


bot.run(os.environ.get("TOKEN"))

sick birch
#
class MyBot(commands.Bot):
  def __init__(...):
    super().__init__(...)
  async def setup_hook():
    # do setup stuff here
bot = MyBot(...) # this will be your new bot instance

@bot.event
...

@bot.command()
...
slate swan
#

I am confused already

sick birch
#

I'd love to be able to clarify

slate swan
#

How can I put that into my code? I cant make sense of all that, being so used to how mine is formatted

#

and with this new bot instance, will I have to change anything about my commands because that would be a painn

heavy folio
#
class Cog(commands.GroupCog):
  """this was more than 100 chars and was supposed to be a cog description""" # errored out if more than 100 chars

  @app_commands.command()
  async def test(self, interaction):
    """this is the slash cmd description which was less than 100 chars"""
    ...
```is it intentional that the cog description cannot be more than 100 characters? it used to be possible
sick birch
#

That's understandable, I see you have

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all(), case_insensitive=True)

commands.Bot is the default bot instance, and by subclassing it, you're basically making a copy of commands.Bot, and extending it. So your new class will take the place of commands.Bot

slate swan
#

Anyone know where I can find a mass dm bot on discord (DM if you can)

sick birch
slate swan
sick birch
torn sail
sick birch
slate swan
sick birch
#

Speaking of aiohttp client sessions, @alpine pewter you shouldn't be creating a new client session like this:

async with aiohttp.ClientSession() as session:
  ...

you should have a global one

sick birch
little briar
#

So, having a bit of a dilemma, can't get pydub to 'select' the file, it just exports it straight up. I needa have the MP3 as an object.

        import pydub
        import os
        import io
        print(pydub.audio_segment.AUDIO_FILE_EXT_ALIASES)
        recording = pydub.AudioSegment.from_file(io.BytesIO(txt2),format="mp3")
        mp3 = recording.export('voice_claim.mp3',format='mp3')
        await ctx.respond(mp3)
        # txt2 and ctx are irrelevant mumbo jumbo, I just need mp3 to be an actual object I can use.
sick birch
little briar
#

No, just post it as a file

unkempt canyonBOT
#

Hey @hidden hazel!

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

alpine pewter
sick birch
slate swan
#

thank you robin for your help, I have to sleep now but I will definitely be here tomorrow๐Ÿ˜ญ

little briar
#

Ah, alright.

heavy folio
sick birch
# alpine pewter Ohh alright. Someone explained it to me earlier and I thought it was just the lo...

Donโ€™t create a session per request. Most likely you need a session per application which performs all requests altogether.

More complex cases may require a session per site, e.g. one for Github and other one for Facebook APIs. Anyway making a session for every request is a very bad idea.

A session contains a connection pool inside. Connection reusage and keep-alives (both are on by default) may speed up total performance.
from: https://docs.aiohttp.org/en/stable/client_quickstart.html

sick birch
alpine pewter
sick birch
# alpine pewter Ohh alright. Someone explained it to me earlier and I thought it was just the lo...

As for how to fix it? Do the same thing I told Tok to do, subclass commands.Bot, and bind your newly instantiated aiohttp.ClientSession to your bot instance (self if you're subclassing):

class MyBot(commands.Bot):
  def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    ...

  async def setup_hook(self):
    self.session = await aiohttp.ClientSession()

bot = MyBot(...) # notice how this is different from how you might usually do `bot = commands.Bot(...)`?
#

Forgot self. Been doing too much javascript

alpine pewter
sick birch
#

You got it

alpine pewter
#

Okay, I'm somewhat newish to coding, I'll try that and if I need help, I'll let you know ๐Ÿ™‚
I do have one more question about cogsif you can

sick birch
#

Please, go ahead

alpine pewter
#
    server_ids = [10675, 10501, 10482, 10490, 1016, 10416, 1796, 10483, 1047, 10450, 10412, 10709, 179, 1051]
    guild_ids = [956462089935941652]

    def __init__(self, bot):
        self.bot = bot
  
    @nextcord.slash_command(guild_ids=guild_ids)
    async def ark_ban(self, interaction : Interaction, gamertag : str = SlashOption(description="Enter the user's gamertag.")):
        if (not interaction.user.guild_permissions.administrator):
            embed = nextcord.Embed(title="`โŒ` `System Exception Error!`", description="**Exception Error, Checklist:**\nEnsure user permissions are met.\nCheck the API's current status.", color=3066993)
            embed.set_thumbnail(url = "https://i.imgur.com/FmzHoKr.png")
            await interaction.send(embed=embed, ephemeral=False)
            return

        else:
            async with aiohttp.ClientSession() as session:
                for id in server_ids:
                    url = f"https://api.nitrado.net/services/{id}/gameservers/games/banlist"
                    response = await (await session.post(url, headers=headers)).json()
                    print(response)
                    
            embed = nextcord.Embed(description=f"**`>`** **`โœ… - System Success:`**\nThe user have been banned!\nResponse: `({gamertag})`", color=3066993)
            await interaction.response.send_message(embed=embed, ephemeral=False)              

How come guild_ids register through all my commands below that? Though the server_ids will not register?
(Haven't fixed the aiohttp yet)

#

Wait

#

Half the code is missing lmao

sick birch
#

Those server_ids don't seem to be valid IDs

#

Or is that for an external service?

alpine pewter
sick birch
#

Okay, and what do you mean by "the server_ids will not register"?

sage otter
#

I donโ€™t think so.

sick birch
alpine pewter
sage otter
#

just pass it in then

#

ClientSession() takes a loop kwarg

#

If not passed in it probably runs asyncio.get_running_loop

sick birch
#

Yeah, but when you have async setup hook function you may as well call it in there with nothing attached

sage otter
#

i mean thereโ€™s not really any extra effort needed

sick birch
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.

alpine pewter
sick birch
sage otter
#

Just put in the init
self.whatever = aiohttp.ClientSession()

#

And call it a day

sick birch
#

Yeah, don't know how you'd make a class constructor async anyway

sage otter
#

Context managers

#

Not really but you get the idea

alpine pewter
sick birch
#

!e

class AsyncConstructor:
  async def __init__(self):
    print("Asynchronous initialisation")

async def main():
  await AsyncConstructor()

asyncio.run(main())
#

don't think that's gonna work anyway

sage otter
#

async with aiohttp.ClientSession()

sick birch
alpine pewter
sick birch
sage otter
#

yea.

sage otter
sick birch
sage otter
#

Constructor = __init__

alpine pewter
#

Will do, that's how I started it, it gave an error but maybe I messed it up
One sec, trying again

sick birch
#

Also, if you were to make a global ClientSession like I mentioned earlier, you can just pass in your header into that and aiohttp will automatically include that with any requests made with that ClientSession instance

#

Straight from the docs:

headers={"Authorization": "Basic bG9naW46cGFzcw=="}
async with aiohttp.ClientSession(headers=headers) as session:
    async with session.get("http://httpbin.org/headers") as r:
        json_body = await r.json()
        assert json_body['headers']['Authorization'] == \
            'Basic bG9naW46cGFzcw=='
#

Notice how the headers are passed into aiohttp.ClientSession rather than session.* methods?

alpine pewter
#

Okay, that's starting to make more sense to me.
I was confused on how to go about that.

Will you be on for a few so when I switch it all you can check it out?

sage otter
#

They go with session?

#

I thought they went with the http methods

#

post/get/put etc

sick birch
#

It's useful for shared headers, like what our friend here is doing

sage otter
#

Thatโ€™s epic

sick birch
#

Yup, especally when you interact with different APIs that have their own headers, you can have multiple clients for each API with their own shared headers

sage otter
#

Across all methods tho? What if one of the methods doesnโ€™t require any headers?

alpine pewter
sage otter
#

did you put

#

self.server_ids

sick birch
sage otter
#

Sounds reasonable

alpine pewter
#

I did not know that lol

sage otter
#

Iโ€™m your init

sick birch
#

Yes

sage otter
#

All those variables you made there need self

#

Or it binds to the function not the class

#

pretty sure. Idk

alpine pewter
#

Even for guild_ids ?

sage otter
#

idk python. Iโ€™m just here.

sick birch
sage otter
#

Wait hold on

alpine pewter
#

I've used it normally without it for about a month, haven't ran into that issue

sage otter
#

Am I like missing something or is your indention off

alpine pewter
sage otter
#

No I mean like

#

They're not in the init.

sick birch
sage otter
#

They're basically in the same scope you had them earlier

alpine pewter
#

They're aligned, I don't think that's the issue.
It might look odd on the formatter

sage otter
#

I think. Iโ€™m just trying to support what Robin is saying. Since he said to move them into the init

alpine pewter
#

Then go from that

sick birch
#

!e

class MyClass:
  x = "Hello, world!"
  def say_hello(self):
    print(self.x)
MyClass().say_hello()
unkempt canyonBOT
#

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

Hello, world!
sick birch
#

Oh looks like it's automatically bound as a class instance when you have it top-level inside a class

#

Leave your stuff how it is then and just access them like self.server_ids and self.guild_ids

heavy folio
sly hamlet
#
async def start_loop():
        await self.api.start_loop()
        print("Post Count")

    start_loop()``` ```py
Warning (from warnings module):
  File "C:\Users\culan\OneDrive\Desktop\3.0.0 echo\cogs\api.py", line 28
    start_loop()
RuntimeWarning: coroutine 'DiscordListsPost.start_loop' was never awaited``` i can not seam to fix this can someone help?
unkempt canyonBOT
#

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

Hello world!
slate swan
#

๐Ÿ™€

#

okimii just showed us the path to eternity

jade tartan
#

This code was working before but now it isnt

#

can you help me

sick birch
slate swan
#

its the same for all instances and can be accessed with instances of the class

sick birch
#

Same thing, different terminologies

slate swan
sick birch
slate swan
#

theyre class variables and not instance variables

sick birch
#

It's more like static keyword in Typescript or Java

slate swan
#
self.x = x

i.e here self.x has a different value depending on the instance of the class
while

x = ...

is a class variable which will always be the same no matter the class instance

jade tartan
#

Hello

slate swan
#

that is so.

alpine pewter
#
    @nextcord.slash_command(guild_ids=guild_ids)
    async def ark_ban(self, interaction : Interaction, gamertag : str = SlashOption(description="Enter the user's gamertag.")):
        server_ids = [106, 101, 102, 1040, 104, 16, 10486, 1083, 1046, 100, 2, 104, 109, 1051]
        if (not interaction.user.guild_permissions.administrator):
            embed = nextcord.Embed(title="`โŒ` `System Exception Error!`", description="**Exception Error, Checklist:**\nEnsure user permissions are met.\nCheck the API's current status.", color=3066993)
            embed.set_thumbnail(url = "https://i.imgur.com/FmzHoKr.png")
            await interaction.send(embed=embed, ephemeral=False)
            return

        else:
            headers = {"Authorization" : key.nitrado_key}
            async with aiohttp.ClientSession() as session:
                for id in server_ids:
                    url = f"https://api.nitrado.net/services/{id}/gameservers/games/banlist"
                    response = await (await session.post(url, headers=headers)).json()
                    print(response)
                    
            embed = nextcord.Embed(description=f"**`>`** **`โœ… - System Success:`**\nThe user have been banned!\nResponse: `({gamertag})`", color=3066993)
            await interaction.response.send_message(embed=embed, ephemeral=False)

@sick birch - So, I figured out the issue, this is working mostly.
This command gives the response of it working - Though, it doesn't do anything.
The API response saying that the user was banned.

When I use it through postman, it works just fine.
Assuming it has to do with the aiohttp, should I try switching to what you said now?

slate swan
sick birch
alpine pewter
# sick birch "doesn't do anything" as in how?

The API responds with this below - Sorry, I should probs word things better.

    "status": "success",
    "message": "The user has been added to the banlist."
}```
It's a `POST` 

When I do it through my bot, it says it bans the player but doesn't work. 
When I do it through postman, it bans the player immediately. 
I'm unsure what's wrong with my part of the code.
#

Let me try it with one ID instead.

sick birch
slate swan
#

hi

sick birch
slate swan
sick birch
alpine pewter
slate swan
#

just completed my 400 lines only giveaway start cmd

#

;-;

sick birch
#

It's a start :)

slate swan
#

i used modals :D

#

wait let me send ss

sick birch
sick birch
sick birch
slate swan
abstract kindle
#

Anyone know why my interaction.user.status is returning as "offline"

loud junco
#

anyone knows how to set up webhook?

alpine pewter
abstract kindle
#

No

loud junco
#

im struggling to make a vote reward for my discord bot

abstract kindle
#

It's me, and I'm well online

slate swan
slate swan
sick birch
abstract kindle
#
intents = discord.Intents.all()
intents.message_content = True
bot = commands.Bot(command_prefix='-', intents=intents, case_insensitive=True, strip_after_prefix=True)
stiff gorge
#

could someone help me

Traceback (most recent call last):
  File "/home/runner/mv/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
TypeError: youtube() takes 1 positional argument but 2 were given

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

Traceback (most recent call last):
  File "/home/runner/mv/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/mv/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/runner/mv/venv/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: TypeError: youtube() takes 1 positional argument but 2 were given
    @commands.command(aliases=["YouTube", "YOUTUBE", "Youtube"], pass_context=True)
    async def youtube(ctx, *, query: str):
      req = requests.get(('https://www.googleapis.com/youtube/v3/search?part=id&maxResults=1''&order=relevance&q={}&relevanceLanguage=en&safeSearch=moderate&type=video''&videoDimension=2d&fields=items%2Fid%2FvideoId&key=').format(query) + os.environ['yt'])
      await ctx.reply('**Video URL: https://www.youtube.com/watch?v={}**'.format(req.json()['items'][0]['id']['videoId']))
slate swan
abstract kindle
#

This should work as intents, right?

sick birch
boreal ravine
abstract kindle
abstract kindle
#

Have a field for the title and the description at least

alpine pewter
#

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

slate swan
#

:D

slate swan
slate swan
slate swan
slate swan
#

it depends on the payloads you send

stiff gorge
sick birch
#

@alpine pewter could I have the link to your code again? Had it up on my laptop but switched to my desktop and lost it

slate swan
#

im now adding giveaway stop cmd

slate swan
slate swan
stiff gorge
#

m!youtube mo vlgs

slate swan
slate swan
#

sparky bro

alpine pewter
#

https://paste.pythondiscord.com/ohebufosey
@sick birch @slate swan

It works immediately when using postman, so I know it's something I'm doing wrong.
I've checked the server_id and it's accurate as well - The API returns a success code saying it bans the player and it doesn't actually ban the player with my code but it works as expected with postman.

slate swan
#

๐Ÿ˜ถ

alpine pewter
#

I trimmed the server id in the link for security purposes.
But other than that, it's 100% accurate

midnight gorge
#

does the phone status thing gets a lot of websocket requests?

abstract kindle
#

I just got a discord popup on my server, but I click before it came up so it disappeared immediately. Anyone know what it could have been?

#

I own the server btw.

slate swan
unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTubeโ€™s robots.txt file; (b) with YouTubeโ€™s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
slate swan
midnight gorge
#

?

slate swan
#

its http request and it wouldnt matter really the gateway handles it quite easily

sick birch
#

@alpine pewter by chance, are you using postman's special thing for authorizing? or are you doing it manually?

midnight gorge
#

i have it like this

#

wait

#

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

sick birch
slate swan
#

๐Ÿค” is the new change in slash commands permission anyhow breaking code-wise ?

jade tartan
#

This code was working before but now it isnt

slate swan
midnight gorge
slate swan
#

um whats that drop down menu called ??

alpine pewter
midnight gorge
#

@slate swan

slate swan
unkempt canyonBOT
#
Nuh-uh.

No documentation found for the requested symbol.

slate swan
jade tartan
#

?

alpine pewter
slate swan
slate swan
#

ohk..

midnight gorge
#

is the mobile status thing

slate swan
#

in src?

#

like where did you got that from lol

#

im so confused

slate swan
midnight gorge
#

in main file:

discord.gateway.DiscordWebSocket.identify = ok.get_mobile()

sick birch
# alpine pewter Authorization, under a Bearer token

Aha, spotted. When in Postman you select the "Authorization" tab and use a Bearer token, it actually creates a header like this:

{
  "Authorization": "Bearer YOUR_TOKEN_HERE" 
}

But yours looks like this:

{
  "Authorization": "YOUR_TOKEN_HERE" 
}

I can tell from this snippet in your code, line 27:

headers = {"Authorization" : key.nitrado_key}
#

It should be:

headers = {"Authorization" : "Bearer " + key.nitrado_key}
alpine pewter
#

Let me try that, I'm gonna be so happy if that's all

loud junco
#

alright indian guy on youtube solved my problem

stone beacon
#

Of course

slate swan
#

was it hunter?

slate swan
loud junco
#

LOL

slate swan
slate swan
loud junco
#

lmao

slate swan
#

hunter is a lovely indian lad

slate swan
sick birch
loud junco
sick birch
slate swan
loud junco
#

:D

slate swan
slate swan
# slate swan nah, just asking

btw, I wanted to ask, lightbulb-hikari doesnt have support for like nicknames and stuff? do i need to make direct requests to the api?

#

even after those splitgate games i even knew you before you had those colorful roles๐Ÿ˜”

alpine pewter
slate swan
slate swan
sick birch
slate swan
#

ayo?

#

okiuwume ????????????

#

i can only see scary eyes

loud junco
#

okiuwume

alpine pewter
slate swan
slate swan
#

no uwus guys im too mature for that

slate swan
slate swan
slate swan
slate swan
sick birch
#

Then let me know what you see next to "Authorization" (blank out your API key, of course)

slate swan
#

....

slate swan
#

im a man

slate swan
#

๐Ÿคฃ

sick birch
#

Alright lads, bit off topic. Let's get back on track

slate swan
#

๐Ÿ‘๏ธ๐Ÿ‘๏ธ

slate swan
slate swan
#

im 15?

alpine pewter
#

@sick birch

slate swan
#

the hell boy

#

ok so ill do it

slate swan
#

u cant stop me

sick birch
slate swan
#

!ot

unkempt canyonBOT
slate swan
#

MOVE TO OT

alpine pewter
slate swan
#

sarthak and hunter are my fav indian lads cuz they have me added๐Ÿ˜ก

slate swan
sick birch
slate swan
sick birch
alpine pewter
#

I just banned myself from my own server, it 100% works in postman

slate swan
#

everyone here add robin

sick birch
#

no please i have 32

slate swan
#

๐Ÿ˜ˆ

sick birch
#

32 is a nice number

slate swan
#

lets make it the funny number

slate swan
slate swan
alpine pewter
slate swan
slate swan
sick birch
slate swan
#

lol

alpine pewter
#

Oh boy

#

Is that the issue?

slate swan
#

hey robin!

slate swan
#

your view examples are poo!

alpine pewter
slate swan
#

anime fan

#

๐Ÿ‘๏ธ๐Ÿ‘๏ธ

sick birch
jade tartan
#

How do you mention your bots name in a f string?

slate swan
#

๐Ÿ˜‚ how does that matter where he's from, lets get back to the channel topic?

unkempt canyonBOT
alpine pewter
slate swan
#

๐Ÿ‘๏ธ๐Ÿ‘๏ธ

#

!rule 7

unkempt canyonBOT
#

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

slate swan
sick birch
#

I mean, at this point I can only chalk it up to an internal issue?

slate swan
#

lol

#

๐Ÿ˜ณ

#

๐Ÿฅฒ

loud junco
#

where do i test my webhook in top.gg

sick birch
#

Have you tried using just one ID?

alpine pewter
slate swan
#

hey robin i have a question

loud junco
#

indian guy on youtube got that

alpine pewter
loud junco
#

but i dont have

slate swan
#

๐Ÿ‘€

loud junco
slate swan
#

any reason why discord keeps their websockets closed to me๐Ÿ˜”

sick birch
loud junco
#

its mt

slate swan
#

!ot !ot !ot

unkempt canyonBOT
loud junco
#

LOL

slate swan
#

i cant connect even after sending hbs๐Ÿ˜”

alpine pewter
jade tartan
slate swan
slate swan
slate swan
jade tartan
sick birch
slate swan
#

i think discords websockets hate me๐Ÿ˜”

slate swan
sick birch
#

It has to be a backend bug

slate swan
#

i rickrolled okimii

loud junco
#

BRUH

jade tartan
#

No error

slate swan
alpine pewter
slate swan
#

๐Ÿ™€

loud junco
#

erm

slate swan
sick birch
jade tartan
#
async def verify7(ctx):
    e = discord.Embed(color=0x36393F)
    e.description = """How to get Selfie & Age Verified
    Make a selfie of you holding your (ID / Passport / Drivers License) (no copy/scan) & a physical piece of paper containing the following information:

    :heart: Discord name, ex. : User#0000
    :heart: Local time, timezone and date ex. : 00:00 AM NZDT, DD/MM/YYYY
    :heart: Server name: True Love 16+
    โคท After that make a close up picture of your (ID / Passport / Drivers License) showing the following information:
    :heart: Date of birth
    :heart: ID Photo 

    Send your verification photos to: (f"\n\n{client.user.name}")
    """
    await channel.send(embed=e)```
loud junco
alpine pewter
loud junco
#

u cant format a string inside a string

#

it will be taken as a text not a string formatter

slate swan
#

damn robin didnt answered my question hes just like websockets i send heartbeats and he never acknowledges them๐Ÿ˜”

sick birch
#

let me take a look for ya

alpine pewter
loud junco
#

`e.description = f"""How to get Selfie & Age Verified
Make a selfie of you holding your (ID / Passport / Drivers License) (no copy/scan) & a physical piece of paper containing the following information:

โค๏ธ Discord name, ex. : User#0000
โค๏ธ Local time, timezone and date ex. : 00:00 AM NZDT, DD/MM/YYYY
โค๏ธ Server name: True Love 16+
โคท After that make a close up picture of your (ID / Passport / Drivers License) showing the following information:
โค๏ธ Date of birth
โค๏ธ ID Photo 

Send your verification photos to: \n\n{client.user.name}
"""`
jade tartan
slate swan
#

๐Ÿ’€

loud junco
#

LOL

#

change it urself

sick birch
#

Well honestly, it's better suited for #965291516031549500 as this channel is quite busy at the moment. If you can send code, and any tracebacks that would be very helpful

slate swan
#

@loud junco ok see, this is where you enter your website to send request to, when the top.gg events are triggered
you first need to enter a value for this then the "Send" button appears

#

imagine sending your license to a random dating bot

slate swan
slate swan
unkempt canyonBOT
#

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

slate swan
loud junco
#

no send comes out

slate swan
#

..

sick birch
alpine pewter
#

Wait, I figured it out I think @sick birch
I just copied postmanes code of it and it worked

slate swan
#

too fast for that

slate swan
alpine pewter
loud junco
#

alright got it thanks

sick birch
#

Ah, interesting

slate swan
loud junco
#

ahem

slate swan
slate swan
loud junco
#

fixes u in what way

slate swan
#

any way you want to imagine

slate swan
loud junco
#

ye

slate swan
#

It just helps you to invite a bot you visit its profile

alpine pewter
#
url = "https://api.nitrado.net/services/XXX/gameservers/games/banlist?identifier=vSpectraI"

payload={}
headers = {
  'Authorization': 'Bearer B7rcAjbI5Nw...',
  'Cookie': '7c7a3581f78104008dff0...'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Yeah, this is all it is apparently to work.
Only took me an hour to realize there's a copy button pepesabre

slate swan
#

anyways im gonna go to sleep, Goodnight everyone!๐Ÿ˜…

#

gn oki

#

'night

loud junco
sick birch
slate swan
slate swan
loud junco
sick birch
#

Other than that, yeah, good for you! Sorry I couldn't be of more help to you

slate swan
#

AMONG US

loud junco
slate swan
#

Goodnight my fellow crewmates๐Ÿ‘๏ธ๐Ÿ‘๏ธ

alpine pewter
#

API is probably terrible

sick birch
#

Should be it. I'm off to bed, so if there's any issues ping me, I usually check my inbox in the mornings

alpine pewter
sick birch
#

t'was my pleasure

slate swan
#
@client.event
async def on_command_error(ctx, error):
        embed =discord.Embed(color=000000, title=f'Vexon | Error!', description=f"**:RikkaDance: | {error}**")
        await ctx.reply(embed=embed, mention_author=True)
#

I want to change this

#

Into this

#

SPOILERS

#

Xd sorry

#

๐Ÿ˜ถ

#

Anyone?

#

Use the Levensthein distance algorithm to get the closest matching command (recommended). Or simply check if the command you've used is in one of your commands, e.g. you have command botinfo and ban but you've tried info, info is in botinfo but not ban. (Less recommended as it might not always be accurate.)

jade tartan
slate swan
#

Append .mention

jade tartan
#

like mention it like @ everyone for example

slate swan
#

That you can't

jade tartan
#

I have seen servers and it seems thats you can

slate swan
#

You will need to send it in the content kwarg

#

You cannot ping people in embeds

jade tartan
slate swan
#

What you can do is mention someone, but they won't get any notification

slate swan
jade tartan
slate swan
#

Cloning another bot NotLikeThis

jade tartan
#

or yeah mention the bot in embed

slate swan
#

bot.user.mention as said

#

I hope you moderate your server really well and make sure everyone is 18+
If there's minors being involved on the server and no one is kicking them out, then yes, it's against ToS and your server will get terminated along with your account.

#

How to change bot status into this?

#

Can you stop marking them as spoiler? It's really annoying as many people already said...

#

And you can't do that

#

Why?

#

Because the API doesn't let you do it

pliant gulch
#

You can, but it's not intended

sick birch
slate swan
#

I know.

slate swan
#

Yes

#

Hence not recommended and shouldn't be explained

#

Surprised they're not completely blocking it

#

?

#

:v

#

Simply don't do it

slate swan
#

Again

#

lmao

#

๐Ÿ˜ถ

#

It is technically possible

#

Hmm

#

But

  1. Not recommended
  2. Pretty sure it's against ToS in that case
  3. With your knowledge I wouldn't get myself into that
#

why would you even need that if its not recommended, its just a status and doesn't affect performance of the bot

#

is it related to api manipulation?

#

Yes

#

ah

#

Well

sick birch
slate swan
#

Which is as per terms of service disallowed

sick birch
#

I suppose as you're working with that sort of thing, you're naturally going to be interested in that

slate swan
#

yeah

#

Seriously?

slate swan
sick birch
slate swan
#

Xd got it

#

They would probably do something else than terminate your account directly

#

Such as a warning or hindering your bot to use that status

#

๐Ÿ‘

alpine pewter
#

Figured out the actual issue smile_cry
I forgot the params @sick birch

sick birch
#

Ah

#

It happens lol, don't fret about it

slate swan
#

How can I host my bot on android

#

were all humans!

slate swan
#

๐Ÿ˜ณ