#discord-bots

1 messages Β· Page 59 of 1

vocal snow
#

Ur class names are 40ft long i don't remember

#

Just see where you are subclassing

slate swan
dire pier
#

.

white citrus
# vocal snow Just see where you are subclassing
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data, *, timeout=20):
        super().__init__(timeout=timeout)
        self.ctx = ctx
        self.settings_data = settings_data
        
            
        @nextcord.ui.button(
        label="Delete the Role",
        style=nextcord.ButtonStyle.danger)
        async def del_admin_role(self, button, interaction):
            embed=nextcord.Embed(description=f"{config.DiscordTic} The role has been successfully removed!", colour=config.grΓΌn)
            button = self.children[0]
            button.disabled = True
            button.style = nextcord.ButtonStyle.grey
            await interaction.response.edit_message(embed=embed, view=self)
            await self.unset_admin_role(interaction)```
You mean this class?
vocal snow
#

Yes

#

When u call the superclass init

#

Pass the arguments for ctx_or_interaction and the other one

white citrus
vocal snow
#

I don't have time to teach python basics rn sorry

#

Did u get admission yet

grim oar
#

Entrance next week

vocal snow
#

Ooh good luck

grim oar
#

I am not ready at all nor I want to study.

white citrus
vocal snow
#

Nova will explain

grim oar
#

timeout=timeout

grim oar
#

make it timeout, ...
or make them all posargs

#

I don't want to give any freaking exam bro 😫

vocal snow
#

U will do fine

#

If you study and stop watching chainsaw man

sick birch
grim oar
#

It ain't even out yet bro

#

And am studying every freaking day, these mental ability exams are aids as fuck

vocal snow
#

Some weird addiction/obsession

grim oar
#

The music was great

vocal snow
grim oar
#

Yeah lmao 😫

vocal snow
#

Ah fuck ur screwed srry

#

good luck tho !!

grim oar
#

:') thanks for the motivation

#

Ty

dim cosmos
#

bro who even searches that stuff up

slate swan
vocal snow
#

Ashley clearly

grim oar
#

so true

slate swan
dim cosmos
#

i hate pillow & anything that has to do with image manipulation πŸ˜”

slate swan
#

how would that appear

#

on the recommendations

vocal snow
#

Why is that in ur recent searches hmm

grim oar
#

hmm hmm

#

sus

slate swan
#

it's on recommendations smh

vale wing
dim cosmos
white citrus
#

@grim oar

class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data, ctx_or_interaction, settings_data_admin):
        super().__init__(ctx_or_interaction, settings_data_admin, timeout=20)
        self.ctx = ctx
        self.settings_data = settings_data````

Now okay?
vale wing
#

Classes naming convention screaming in agony

dim cosmos
#

🀒

grim oar
#

Yeah follow pep-8

vale wing
#

Also why'd you need to set ctx as attribute, you can access it in callback

grim oar
#

The literature every person here does addiction of

dim cosmos
#

is there a way to get if a user has nitro in dpy v2.0

white citrus
# grim oar Seems so
Traceback (most recent call last):
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
    await coro(*args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 280, in on_application_command_error
    raise error
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\cog.py", line 221, in _setup_administrator_role
    await interaction.response.send_message(embed=error, view=settings_document_admin_buttons(interaction, settings_data_admin), ephemeral=True)
TypeError: settings_document_admin_buttons.__init__() missing 2 required positional arguments: 'ctx_or_interaction' and 'settings_data_admin'```


Still the error
vale wing
#

And to nanoseconds

dim cosmos
#

base64 my beloved

grim oar
silk fulcrum
#

!d discord.Member.premium_since

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC when the member used their β€œNitro boost” on the guild, if available. This could be None.

dim cosmos
grim oar
vale wing
#

!d discord.User

unkempt canyonBOT
#

class discord.User```
Represents a Discord user.

x == y Checks if two users are equal.

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

hash(x) Return the user’s hash.

str(x) Returns the user’s name with discriminator.
dim cosmos
#

waiting for danny to add another method πŸ”₯πŸ”₯

white citrus
#
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data, ctx_or_interaction, settings_data_admin):
        super().__init__(ctx_or_interaction, settings_data_admin, timeout=20)
        self.ctx = ctx
        self.settings_data = settings_data

        
            
        @nextcord.ui.button(
        label="Delete the Role",
        style=nextcord.ButtonStyle.danger)
        async def del_admin_role(self, button, interaction):
            embed=nextcord.Embed(description=f"{config.DiscordTic} The role has been successfully removed!", colour=config.grΓΌn)
            button = self.children[0]
            button.disabled = True
            button.style = nextcord.ButtonStyle.grey
            await interaction.response.edit_message(embed=embed, view=self)
            await self.unset_admin_role(interaction)```
vale wing
#

Pretty sure you can't get it with bot

silk fulcrum
dim cosmos
#

fair enough

silk fulcrum
cerulean shale
grim oar
vocal snow
vale wing
silk fulcrum
cerulean shale
#

i installed pillow

#

but it aint working

vocal snow
#

Good

silk fulcrum
#

but in code u use PIL

white citrus
dim cosmos
vocal snow
vale wing
#

Hurb

grim oar
white citrus
vocal snow
#

Nova i think you should explain what functions are

grim oar
#

x_buttons takes 4 args, you just giving 2

vocal snow
#

And what parameters and arguments are

vale wing
#

What python is

grim oar
vale wing
cerulean shale
#
from PIL import Image, ImageFont, ImageDraw, ImageOps

  @commands.Cog.listener()
  async def on_member_join(self, member):
    channel = get_channel(bot.get_all_channels(), 'Welcome')

    img = Images.open("./data/bg.jpg")

    font = ImageFont.truetype("./data/Kelly Stones.otf", 225)
    font2 = ImageFont.truetype("./data/Kelly Stones.otf", 200)

    draw = ImageDraw.Draw(img)
    welcome = f"Welcome to {member.guild.name}"
    name = member.name

    draw.text((950, 750), welcome, (255, 255, 255), anchor = "ms", font = font)
    draw.text((950, 950), name, fill = "white", anchor = "ms", font = font2)

    img.save("boing.png")
    
    await member.send(f"**Hello** {member.mention}! **Welcome to {member.guild.name}**. **Pls check out** #πΆπ‘œπ‘šπ‘π‘Žπ‘ π‘  **for guidance. Get some fancy roles from** #𝑆𝑒𝑙𝑓-π‘…π‘œπ‘™π‘’π‘ . **Introduce yourself in** #πΌπ‘›π‘‘π‘Ÿπ‘œπ‘‘π‘’π‘π‘‘π‘–π‘œπ‘›π‘  **and have fun.**")
    await channel.send(file=discord.File("boing.png"))
``` this is the code and it aint working, *PIL module is not found*
dim cosmos
#

According to my calculations, a parameter is something called a parameter.

vale wing
#

Issues with environment

dim cosmos
vale wing
dim cosmos
cerulean shale
#

wait nvm

dim cosmos
vale wing
cerulean shale
#

it works now

grim oar
#

Gato

cerulean shale
dim cosmos
cerulean shale
#

i didnt skidded bruh

vale wing
#

πŸ‘Œ

dim cosmos
vocal snow
cerulean shale
#

i watched few tutorials on that stuff and i made it ;-;

dim cosmos
#

is ur bot in multiple servers

cerulean shale
#

nope

vale wing
#

By the way fun fact: I skid all my code I don't write it by myself, all because python is a snake

cerulean shale
#

and it works now so its fine

dim cosmos
#

is it a private bot for just 1 server

grim oar
cerulean shale
vale wing
#

All my 26 repositories on github are pure skid

vocal snow
vale wing
#

And all my gists

dim cosmos
grim oar
#

h

untold obsidian
#

i have a doubt for my school python question πŸ‘€
can anyone help me?

vale wing
grim oar
#

r1 is None

vocal snow
#

Looks like ur query returned None

dim cosmos
#

what db are u using

vocal snow
#

MySQL i think

vale wing
#

All the text sent by me was skidded too

slate swan
#
    def check(reaction, user):
        return user == ctx.message.author and str(reaction.emoji) == 'βœ…'
    await bot.wait_for('reaction_add', check=check)
    embed = Embed(color=discord.Color.dark_green(), title="Challenged", description=f"Game has been accepted by {user.mention}")
    embed.add_field(name="?", value="?", inline=True)
    embed.add_field(name="?", value="?", inline=True)
    confirmationMessage = await ctx.message.channel.send(embed=embed)
    await confirmationMessage.edit(embed=embed)
    await confirmationMessage.clear_reactions()```

Possible to mention only the user who reacted inside the embed description?
dim cosmos
vocal snow
#

Ur query is returning None so the data you're requesting is not available in the db

dim cosmos
#

now get them on steam and pay for ur college tuition off them!

vale wing
#

And I keep skidding one

vocal snow
#

Either add the data to the db or handle the case where it returns None

dim cosmos
#

^

vocal snow
#

Or change your query to make sure it's actually requesting what you want to request

slate swan
vocal snow
#

Which one

#

This alr seems like bad schema

vocal snow
#

Redundant data !!

silk fulcrum
dim cosmos
slate swan
dim cosmos
#

it just shows the mention but doesnt actually ping

grim oar
#

That's what I am saying

vocal snow
#

Everything is same except one column, that's not good schema

grim oar
#

ok_handbutflipped I am helping here since when you all were in your daddy's balls

maiden fable
#

πŸ‘€

grim oar
#

amiright zeffhoe.

vocal snow
#

Yes that is true

maiden fable
#

What if someone's Dad has went to get milk?

dim cosmos
silk fulcrum
#

voice channel is so funny, i didnt know
sometimes i learn something as we talk about dimensions and sometimes we explain to someone how and and or work

slate swan
#

Where might I find documentation on mentioning users who reacted

grim oar
maiden fable
unkempt canyonBOT
#

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

Note

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

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

Note

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

!d discord.User.mention

unkempt canyonBOT
maiden fable
cold sonnet
maiden fable
#

meh

cold sonnet
#

meh

dim cosmos
#

is there any bot with lastfm integration here

maiden fable
#

Me who is hearing the name first time:

dim cosmos
cold sonnet
#

what name

#

we don't make music bots

dim cosmos
#

are you dumb

cold sonnet
#

finding songs and artists is doable tho

sick birch
dim cosmos
#

genuine question

cold sonnet
#

sometimes

maiden fable
#

r1 is None

silk fulcrum
#

!d discord.Interaction.send_message

unkempt canyonBOT
#
Out of the question.

No documentation found for the requested symbol.

silk fulcrum
#

!d discord.InteractionResponse.send_message

unkempt canyonBOT
#

await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, allowed_mentions=..., suppress_embeds=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by sending a message.
silk fulcrum
#

or you mean to send it into DMs of ctx.author? @slate swan

slate swan
#

@silk fulcrum I have a report command. When reporting on a participant in the chat, this reaction appears. And when the moderator clicks on the reaction. It is necessary that the nickname of the moderator who clicked on the reaction should be written in the bos to the author of the report

#

@silk fulcrumcan I write to you in Russian ?

silk fulcrum
#

uhm... sure... but in DMs i think

pulsar thunder
#

its says the name 'member' is not defined wot do i do

silk fulcrum
#

or full traceback

#

better both

pulsar thunder
silk fulcrum
#

!d discord.Interaction.edit_original_response @junior verge

unkempt canyonBOT
#

await edit_original_response(*, content=..., embeds=..., embed=..., attachments=..., view=..., allowed_mentions=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the original interaction response message.

This is a lower level interface to [`InteractionMessage.edit()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionMessage.edit "discord.InteractionMessage.edit") in case you do not want to fetch the message and save an HTTP request.

This method is also the only way to edit the original message if the message sent was ephemeral.
junior verge
#

ah thanks

pulsar thunder
junior verge
#

so no need for interaction ?

silk fulcrum
silk fulcrum
slate swan
#

he should write in private messages to the author of the command that called this button

slate swan
junior verge
vocal snow
#

IDs are stored as integers

silk fulcrum
slate swan
#

And just interaction.response.edit_message is fine

slate swan
#

Yes

silk fulcrum
#

no

slate swan
#

I am literally doing it 🀣

slate swan
#

And works fine

unkempt canyonBOT
silk fulcrum
slate swan
#

No.

silk fulcrum
#

it was changed in PyPI release

junior verge
slate swan
#

Idk why it doesn’t say type: int but whatever

silk fulcrum
#

it does not exist

slate swan
#

!d discord.Interaction.response

unkempt canyonBOT
#

Returns an object responsible for handling responding to the interaction.

A response can only be done once. If secondary messages need to be sent, consider using followup instead.

slate swan
#

!d discord.InteractionResponse.edit_message

unkempt canyonBOT
#

await edit_message(*, content=..., embed=..., embeds=..., attachments=..., view=..., allowed_mentions=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by editing the original message of a component or modal interaction.
slate swan
#

Look the types :)))

junior verge
slate swan
silk fulcrum
# junior verge uhh

you've already responded to that interaction, edit_original_response is editing the orginal message AS a response, and to just do it you need to get original message

junior verge
#
await interaction.followup.send("Pong!")
        await interaction.edit_original_response(content = f"Pong! **{round(self.client.latency * 1000)}**ms")  
``` just that
silk fulcrum
#

!d discord.Interaction.original_response

unkempt canyonBOT
#

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

Fetches the original interaction response message associated with the interaction.

If the interaction response was a newly created message (i.e. through [`InteractionResponse.send_message()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.send_message "discord.InteractionResponse.send_message") or [`InteractionResponse.defer()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.InteractionResponse.defer "discord.InteractionResponse.defer"), where `thinking` is `True`) then this returns the message that was sent using that response. Otherwise, this returns the message that triggered the interaction (i.e. through a component).

Repeated calls to this will return a cached value.
slate swan
#
    @discord.ui.button(style= discord.ButtonStyle.grey, emoji = 'πŸ“›')
    async def reports(self, button, interaction):
        await self.ctx.author(
                embed = discord.Embed(description= f'Π’Π°ΡˆΠ΅ΠΉ ΠΆΠ°Π»ΠΎΠ±ΠΎΠΉ занялся {interaction.user}', colour=0xF1C40F),
            )```
how to make it so that when you click on this button, the author of the command that called this button receives a message ??
silk fulcrum
#

you will need to do original = await interaction.original_message() and await original.edit(...) @junior verge

silk fulcrum
white citrus
junior verge
slate swan
#

Life is good when a problem only needs one response

silk fulcrum
#

i literally sent you what you need

silk fulcrum
#

sorry typo in first line

junior verge
#

no problem

silk fulcrum
#

and you don't put anything in it

#

which you don't put there

#

and you didn't do original = await interaction.original_message()

#

you just did the calling of this function

#

and so with that being said you should use await original.edit(...)

junior verge
#
original = await interaction.original_message("Ping!")
        await original.edit(content = f"Pong! **{round(self.client.latency * 1000)}**ms") 
``` ?
silk fulcrum
junior verge
#

oh

silk fulcrum
#

and then it will be gud

junior verge
#

do I just need a await interaction.followup.send() for the first message what will be edited

silk fulcrum
#

followup will send a followup

#

not edit

junior verge
#

so how will it get the first message

#

just this won't work

junior verge
#

wait I don't think you get it do you

silk fulcrum
#

probably

#

im in voice lol

junior verge
#

/ping

response: Pong

Edit: Pong! 100ms

Example

#

You get me

#

@silk fulcrum ^

silk fulcrum
#

so what is wrong wiht your current code?

junior verge
#

It never sends the Pong ?

slate swan
#

I have no idea how dbs work but your not parsing anything into fetchone

#

Obviously it’s not finding anything and is returning None

slate swan
#

Ok

junior verge
silk fulcrum
#

well actually it's db thing

#

but no need to redirect

slate swan
silk fulcrum
#

your cursor.fetchone() returns None

#

that's the problem

#

check your query

slate swan
silk fulcrum
slate swan
#

He kinda said that in his problem

silk fulcrum
#

oh bruh i only read errors if i see screenshots

#

show the query you are trying to fetch

#

like "SELECT * FROM table"

#

this string, what is it

slate swan
#

Damn he fr left

silk fulcrum
#

lmao

slate swan
#

I forget that there are other channels

junior verge
silk fulcrum
junior verge
#

no look

#

where would it send the first Pong!

#

And then edit it

silk fulcrum
#

show the code

#

of the command

#

how do you send the pong

#

oh wait

#

@junior verge you can't edit responses

#

or can you?

#

you 100% cannot edit ephemeral responses

junior verge
silk fulcrum
#

but im not sure about the responses

silk fulcrum
junior verge
#

I just want when I do /ping it sends Pong and then edits the latency in

junior verge
# silk fulcrum send the code of the command

well its just what you said lol

@app_commands.command(name="ping", description="Returns the latency of the bot")
    async def ping(self, interaction: discord.Interaction):
        await interaction.response.defer()
        original = await interaction.original_message()
        await original.edit(content = f"Pong! **{round(self.client.latency * 1000)}**ms")   
``` This won't do anything
slate swan
#

!d discord.InteractionResponse.edit_message # Yeah you definitely can't edit a response

unkempt canyonBOT
#

await edit_message(*, content=..., embed=..., embeds=..., attachments=..., view=..., allowed_mentions=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by editing the original message of a component or modal interaction.
junior verge
#

thats the whole point relax

silk fulcrum
#

editing the Pong without sending it

junior verge
#

I know that lolll

#

so how would I do that then

slate swan
#

send the message

silk fulcrum
#

first of all send a message

slate swan
#

This guy is STRUGGLING

junior verge
#

interaction.send?

slate swan
#

Await it

junior verge
#

yes ofc lol

slate swan
#

And why would you need to edit the message to send the bot.latency

junior verge
#

idk I just like that

slate swan
#

i guess

junior verge
#

and just testing out 2.0

primal token
#

?

#

You never answered his question kek

slate swan
#

Yeah and that's my point

primal token
#

no?

slate swan
#

There is no need to edit the message to get it or to make it relevant

#

You can simply directly send it

primal token
#

Its the letency between hb and ack hb lol

#

Gateway != REST API

#

what

slate swan
#

Some other bots usually calculate the difference between the message sent and the message actually being edited, there it makes sense to edit the message

junior verge
slate swan
#

Otherwise you can just send

junior verge
#

Yeah I know that

primal token
#

hbs are gateway events sent with the websockets

#

its not the same but ok

slate swan
junior verge
#

I removed it already

#

cba with it for now

primal token
silk fulcrum
slate swan
#

And then you face stubborn misleading people, no wonder it won't work..

junior verge
#

yeah lol

slate swan
#

Idk what game to play

silk fulcrum
slate swan
#

Well maybe in an off topic channel someone has an idea

slate swan
silk fulcrum
#

that's the only game for me possible (except shitty online games) to play so yes

primal token
#

Im correcting your statements as theyre incorrect, you should also listen to me so you can learn something and spread correct info

white citrus
#

@silk fulcrum i am confused are you able to help?

slate swan
silk fulcrum
slate swan
#

Why does scorn have to come out late October

slate swan
#

Why does high on life have to come out 12th of December ffs

#

Nothing to your concern

primal token
#

Hes currently having a boring crisis

silk fulcrum
white citrus
slate swan
silk fulcrum
#

uhm, so that is the query you are trying to fetchone right?

primal token
primal token
slate swan
silk fulcrum
#

that's just the example of how query looks

#

it could be SELECT yomama FROM hahahaha

primal token
#

Yeah youre harvs, kek

silk fulcrum
#

you have smth like this in your code

silk fulcrum
#

bruh just show full code of command

#

i think im not gonna see your query

slate swan
#

Hitman trilogy was so good

silk fulcrum
#

if i ask for it

#

so just show the code of the command

paper sluice
primal token
#

wait why the hell are you subclassing your custom viewducky_party

silk fulcrum
#

oh my dosh i didnt see that

#

yeah that is weirddddddddd

primal token
#

mobile?

#

mobile paste bins make me want to barf

silk fulcrum
#

uhm pool seems like this is pg

#

i dont think you have to get cursor

#

but whatever

white citrus
silk fulcrum
#

and why are you putting %s in ()

paper sluice
silk fulcrum
#

why yes?

primal token
#

deep explanation on what ryuga ment lol

silk fulcrum
#

and so your query SELECT role_id FROM ... returns nothing, that means there is no row with these WHERE conditions

#

i would open a GUI for my database and see what SELECT * FROM that_table returns

#

and see if there is a row with these conditions

#

if not then the problem is ovbious

silk fulcrum
#

there is no row like that

silk fulcrum
junior verge
#

uh

silk fulcrum
#

what do you want

paper sluice
#

discord.app_commands

junior verge
primal token
junior verge
#

or the bots owner doesnt really matter

silk fulcrum
#

and check manually if there is that row

#

im pretty sure he has not a lot of rows

#

public bots usually are not that poorly coded

primal token
#

youre interesting ducky_beer

silk fulcrum
#

ok

white citrus
silk fulcrum
shrewd apex
#

also why u need that * πŸ‘€

white citrus
#

What?

shrewd apex
#

, *, timeout

hollow lantern
#

how do I remove all reactions from a discord message, regardless of sender or reaction?

white citrus
junior verge
primal token
keen talon
swift pumice
#

help

primal token
#

those 2 events dont take any context

#

!d discord.on_member_join

unkempt canyonBOT
#

discord.on_member_join(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") joins a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").

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

the * is only for the parameters of a function definition

#

you cant pass it into a method youre calling

swift pumice
#

Thanks

wind wharf
#

Hello

#

I am trying to create discord server currency system

#

I tried to do something but

#

something gone wrong

#

may you help me about this issue if you have enough interest and knowledge about it

torn sail
#

You can check the time right before the bot starts then compare it

wind wharf
#

bot is working

lone lichen
slate swan
#

any errors?

#

what about it isnt working

torn sail
#

Show ur intents

hollow lantern
#

How do I remove all reactions from a message?

torn sail
#

What about just guild intents?

#

!d discord.Intents.guilds

unkempt canyonBOT
torn sail
#

Enable in code

#

Oh

#

Hmm you should enable logging with debug level to check if u are receiving the event

winged coral
#

@slate swan Is it possible that an error is being caught by some error handler and silently discarded?

#

You could maybe just wrap the entire command in a try except and see if anything comes out of it

#

It’s possible the first text channel in the guild isn’t sendable by the bot, like it gets a channel which it has no perms in and that causes an error

#

But the timing of the verification is probably indicative

#

How recently was it verified? Possibly it hasn’t gone through 100% yet and so the intent isn’t firing as it should

#

To check that you’d need to enable debug logging

#

Oh…

#

I did not see this πŸ™ƒ

#

You need to apply now you’re verified :P

torn sail
#

guild intents arent priveleged

winged coral
#

Oh right yeah this is guild join not member join mb

slate swan
#

w8

slate swan
torn sail
#
import discord
import logging

logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)

you will get a lot of stuff but when u join a server look for something like dispatching event on_guild_join

#

it will output in the console

slate swan
#

set is not a json serializable type

#

that is what it means

torn sail
unkempt canyonBOT
#

@torn sail :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 |   File "/usr/local/lib/python3.11/json/__init__.py", line 231, in dumps
004 |     return _default_encoder.encode(obj)
005 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
007 |     chunks = self.iterencode(o, _one_shot=True)
008 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
009 |   File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
010 |     return _iterencode(o, 0)
011 |            ^^^^^^^^^^^^^^^^^
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/xayuvagase.txt?noredirect

torn sail
#

basically json only wants lists and dicts

slate swan
#

not sets

#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#

idk why its not working tho cause 2 days ago it worked perfectly

#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#

😭

regal pulsar
#

lmao

slate swan
#

bruh what

#

fix

#

ik what you mean but its not possible

#

aight

torn sail
#

do you guys think this is a good get_or_fetch/getch method?

    async def get_or_fetch(sync_method: Callable[[int], T], snowflake: int) -> T:
        async_method_name: str = sync_method.__name__.replace('get', 'fetch')
        async_method: Callable[[int], Coroutine[Any, Any, T]] = getattr(
            sync_method.__self__, async_method_name   # type: ignore
        )

        return sync_method(snowflake) or await async_method(snowflake)
slate swan
torn sail
#

instead of hardcoding for every get_user, get_channel etc you can just pass the sync method in

torn sail
dull knot
#

How do I delete a user's message again?

I'm currently making a say/embedsay cmd but Idk how I can remove 'only' the cmd that's before the embedded/argument message

unkempt canyonBOT
#

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

Deletes the message.

Your own messages could be deleted without any proper permissions. However to delete other people’s messages, you need the [`manage_messages`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission.

Changed in version 1.1: Added the new `delay` keyword-only parameter.
dull knot
#

Alright. I'ma try that.

#

Thanks

slate swan
#

how can I make sure that data from one command is transferred to another ? That is , from command B the data is passed to the command A ??

slate swan
#

are you looking for variables...

primal token
slate swan
#

@slate swan Example. There is for example command prof. And there is, for example, a section where using command name you can specify some text

primal token
slate swan
slate swan
#

like !command 1 2 three??

slate swan
torn sail
slate swan
#

except dont say it like your a foreign person in england 😭

primal token
slate swan
primal token
#

yeah

slate swan
torn sail
# primal token yeah

wait also techinally my return annotation is wrong because i make them pass the sync method which can return None but in my case, if the sync method returns None then i use the async method which cant return None so it will never return None

slate swan
torn sail
#

i can just make then pass the async method and im good

slate swan
#

learning python instead of english 😭

#
import discord
from discord.ext import commands

bot = commands.Bot("!")
```  i think this is what you are looking for
torn sail
#

enable member intents

slate swan
#

!d discord.Client.event

unkempt canyonBOT
#

@event```
A decorator that registers an event to listen to.

You can find more info about the events on the [documentation below](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events).

The events must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.10)"), if not, [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") is raised.

Example

```py
@client.event
async def on_ready():
    print('Ready!')
```...
torn sail
#

intents.members = True

slate swan
#

ok damn nvm then

#

why use discord.Client 😭

torn sail
#

if not using message commands

#

they have debug_guilds which probably means they are using slash cmds

slate swan
#

Because what

torn sail
#

no its not related to ur problem

slate swan
torn sail
white citrus
#
Ignoring exception in on_application_command_error
Traceback (most recent call last):
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
    await coro(*args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 280, in on_application_command_error
    raise error
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\cog.py", line 221, in _setup_administrator_role
    await interaction.response.send_message(embed=error, view=settings_document_admin_buttons(interaction, settings_data_admin), ephemeral=True)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\buttons.py", line 9, in __init__
    super().__init__(settings_data_admin, timeout=timeout)
TypeError: settings_document_admin_view.__init__() missing 1 required positional argument: 'settings_data_admin'```
torn sail
#

πŸ‘

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
torn sail
#

yes

white citrus
slate swan
#

a ok, discord refers to message command as the application commands based on messages

white citrus
# slate swan the file thats causing the error
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data_admin, *, timeout=3):
        super().__init__(settings_data_admin, timeout=timeout)
        self.ctx = ctx
        self.settings_data_admin = settings_data_admin

        
            
    @nextcord.ui.button(label="Delete the Role", style=nextcord.ButtonStyle.danger)
    async def del_admin_role(self, button, interaction):
        embed=nextcord.Embed(description=f"{config.DiscordTic} The role has been successfully removed!", colour=config.grΓΌn)
        button = self.children[0]
        button.disabled = True
        button.style = nextcord.ButtonStyle.grey
        await interaction.response.edit_message(embed=embed, view=self)
        await self.unset_admin_role(interaction)```
torn sail
#

idk if thats better tho

slate swan
white citrus
shrewd apex
#

global ;-; and even worse editing the var using global

slate swan
#

@slate swanglobal can pass a variable such as a participant link ?

white citrus
shrewd apex
slate swan
slate swan
shrewd apex
white citrus
#

Still have a Problem

slate swan
shrewd apex
#
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data_admin, timeout=3):
        super().__init__(timeout=timeout)
        self.ctx = ctx
        self.settings_data_admin = settings_data_admin

        
            
    @nextcord.ui.button(label="Delete the Role", style=nextcord.ButtonStyle.danger)
    async def del_admin_role(self, button, interaction):
        embed=nextcord.Embed(description=f"{config.DiscordTic} The role has been successfully removed!", colour=config.grΓΌn)
        button = self.children[0]
        button.disabled = True
        button.style = nextcord.ButtonStyle.grey
        await interaction.response.edit_message(embed=embed, view=self)
        await self.unset_admin_role(interaction)
#

what's settings_document_admin_view

shrewd apex
white citrus
# shrewd apex what's settings_document_admin_view
class settings_document_admin_view(nextcord.ui.View):
    def __init__(self, ctx_or_interaction, settings_data_admin, timeout):
        super().__init__(timeout)
        self.settings_data_admin = settings_data_admin

        self.ctx_or_interaction = ctx_or_interaction
        if isinstance(ctx_or_interaction, Context):
            self.user = ctx_or_interaction.author
        if isinstance(ctx_or_interaction, Interaction):
            self.user = ctx_or_interaction.user
        
        
    async def interaction_check(self, interaction):
            
        filter_dict = {"_id": interaction.guild.id}    
        checka = await interaction.client.settings.find_by_custom(filter_dict)
        
        if checka is None:
            
            if self.user == interaction.user:
                return True
            else:
                embed = nextcord.Embed(description=f"{config.gf_error_emoji} You are not authorized to press this button", colour=config.rot)
                await interaction.response.send_message(embed=embed, ephemeral=True)
                return False
        
            
        if checka is not None:
            role_id = checka["admin_id"]
            if interaction.user.get_role(role_id):
                return True
            if self.user == interaction.user:
                    return True
            else:
                embed = nextcord.Embed(description=f"{config.gf_error_emoji} You are not authorized to press this button", colour=config.rot)
                await interaction.response.send_message(embed=embed, ephemeral=True)
                return False

        else:
            pass


        

    async def unset_admin_role(self, interaction: nextcord.Interaction):
        await interaction.client.settings.unset(self.settings_data_admin)```
weary flume
#

im making a vouch command and im confused why this isnt working

@client.command()
@commands.check(another_guild_role)
async def vouch(ctx, user: discord.Member, rating: int, *, reason):
    valid = {"1","2","3","4","5"}
    vouchem = discord.Embed(
        title = 'Vouch Given!',
        colour = discord.Colour.dark_red()
    )
    vouchem.add_field(name='Vouch By:', value=f"<@{ctx.message.author.id}>", inline=False)
    vouchem.add_field(name='To:', value=f"<@{user.id}>", inline=False)
    vouchem.add_field(name='Rating:', value=f"`{rating}`", inline=False)
    vouchem.add_field(name='Vouch Reason', value=f'{reason}', inline=False)
    if rating in valid:
        await ctx.send(embed=vouchem)
    else:
        await ctx.send('`Please rate 1-5`')
shrewd apex
#

u are subclassing a subclassed view why? just make a new view πŸ—Ώ

weary flume
#

it always responds with please rate 1-5

slate swan
#

lmao

weary flume
#

what should i change?

vocal snow
shrewd apex
white citrus
slate swan
unkempt canyonBOT
#
Missing required argument

code

shrewd apex
#

calm down ducky_dave

slate swan
#

!e

print(range(1,6))
unkempt canyonBOT
#

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

range(1, 6)
slate swan
#

am i dumb

vocal snow
#

harvs moment

regal pulsar
#

lmfao

slate swan
weary flume
umbral palm
#

range() does not show you a list of all numbers within it
you'll have to convert

umbral palm
#

!e

print(list(range(1,6)))

regal pulsar
#

!e [print(i) for i in range(1,6)]

unkempt canyonBOT
#

@regal pulsar :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
slate swan
#

!e

print(list(range(1,6)))
unkempt canyonBOT
#

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

[1, 2, 3, 4, 5]
vocal snow
#

!e print(*range(1,6))

unkempt canyonBOT
#

@umbral palm :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 3, 4, 5]
#

@vocal snow :white_check_mark: Your 3.11 eval job has completed with return code 0.

1 2 3 4 5
slate swan
#

YAY

umbral palm
#

there

shrewd apex
#

if this command is in a cog u can use the class and make a class var and store there

white citrus
primal token
slate swan
shrewd apex
primal token
#

yeah, but its the same result as lunas lol

shrewd apex
primal token
slate swan
#

this is proof that noones learn python before coding a dpy bot

slate swan
bitter walrus
#

!e print("just testing")

unkempt canyonBOT
#

@bitter walrus :white_check_mark: Your 3.11 eval job has completed with return code 0.

just testing
slate swan
#

thats dumb

primal token
slate swan
primal token
quaint epoch
cold sonnet
#

why does it have 1 but not 6

umbral palm
shrewd apex
#

u just literally need to do bot.x = "something" and in command b if u do print(bot.x) it will print "something"

slate swan
umbral palm
umbral palm
#

they are 0 to n - 1

slate swan
cold sonnet
#

oh

#

I feel bullied

slate swan
vocal snow
umbral palm
#

where b is your end

cold sonnet
slate swan
shrewd apex
slate swan
shrewd apex
#

πŸ«‚

vocal snow
cold sonnet
#

❀️

slate swan
junior verge
#

Is getting accepted for verification hard?

#

Applying rn

slate swan
cold sonnet
#

no

junior verge
cold sonnet
#

literal scam bots are being verified

junior verge
#

oh lol

slate swan
vocal snow
slate swan
#

like a driving license or smth

junior verge
#

oh that

quaint epoch
junior verge
#

that ID

slate swan
#

get that fake ID for verified discord bot πŸ’―

cold sonnet
#

you have to show a part of your code so they see what your bot does

junior verge
#

I was thinking of a discord id xd

cold sonnet
#

not even everything

junior verge
#

I got a ID so I'm fine

junior verge
slate swan
quaint epoch
shrewd apex
slate swan
shrewd apex
vocal snow
sick birch
junior verge
#

@sick birch Got any tips for bots verification xd

slate swan
#

@shrewd apex I just have one good example of this discord.js . The documentation there is much better done. And the bot can be written purely on it without even knowing js itself

sick birch
winged coral
junior verge
#

Huh? But you are so good at dpy

vocal snow
winged coral
#

They’re intuitive

junior verge
#

I wouldn't say a bot thats in more than 75+ server is big

sick birch
#

Though I agree with your point on discord.py having terrible documentation

winged coral
#

I think they’re great

slate swan
cold sonnet
#

the documentation is made automatically by source code

slate swan
sick birch
slate swan
winged coral
#

? does it matter

slate swan
shrewd apex
#

look here buddy no matter what u say simple oop will never be on the documentation and if u wanna learn oop u need to learn it urself u can argue they don't have command examples in docs but u can't argue that they have poor docs coz u are not understanding oop

slate swan
white citrus
#
Ignoring exception in on_application_command_error
Traceback (most recent call last):
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
    await coro(*args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 280, in on_application_command_error
    raise error
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\cog.py", line 221, in _setup_administrator_role
    await interaction.response.send_message(embed=error, view=settings_document_admin_buttons(interaction, settings_data_admin), ephemeral=True)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\buttons.py", line 9, in __init__
    super().__init__(settings_data_admin, timeout=timeout)
TypeError: settings_document_admin_view.__init__() missing 1 required positional argument: 'settings_data_admin'```
slate swan
#

@slate swandon't link me!

junior verge
#

uh, I store message_content for just my ranking system, if someone sends a message it will get x xp but I don't store the messages though right?

slate swan
winged coral
#

Don’t ping him

sick birch
slate swan
#

why shouldnt i ping him

#

@sick birchI find it more difficult to describe it

sick birch
#

You will still get the messages dispatched to you

slate swan
#

he pings me joobicookie

primal token
#

I think blaming documentation for you not having a certain skill is a problem you posses not the documentation

junior verge
slate swan
#

BRO

vocal snow
#

lmaooo

sick birch
slate swan
#

is that a threat 😭

junior verge
slate swan
#

fucked up. It's good to mention me, this is what it translates 2

junior verge
vocal snow
#

he brought out the fuckin russian πŸ’€

slate swan
sick birch
slate swan
#

he shit talking in another language so he dont get in trouble

junior verge
winged coral
vocal snow
#

this channel is so fucking hilarious

winged coral
#

If you don’t save the message content somewhere it’s N/A

slate swan
sick birch
slate swan
#

i am scared of this dude

junior verge
#

And the 2nd

white citrus
#
Ignoring exception in on_application_command_error
Traceback (most recent call last):
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
    await coro(*args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 280, in on_application_command_error
    raise error
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\cog.py", line 221, in _setup_administrator_role
    await interaction.response.send_message(embed=error, view=settings_document_admin_buttons(interaction, settings_data_admin), ephemeral=True)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\buttons.py", line 9, in __init__
    super().__init__(settings_data_admin, timeout=timeout)
TypeError: settings_document_admin_view.__init__() missing 1 required positional argument: 'settings_data_admin'```

Can someone help
shrewd apex
junior verge
#

"WHAT IS THE PROCESS FOR USERS TO REQUEST DELETION OF THEIR DATA?" and "FOR HOW LONG DO YOU STORE IT?" I don't store the data, right?

winged coral
#

If you don’t store it you can say that in the 3rd box

#

β€œI don’t store any”

slate swan
#

@slate swan the first word is unlikely to be translated into English

vocal snow
sick birch
#

You’re storing the amount of messages a user has sent

shrewd apex
#

it's parent class is taking a interaction or CTX param as well at second position

slate swan
#

Is it some Russian slur that’s extremely offensive

sick birch
#

User data should be taken very seriously with the utmost importance

white citrus
winged coral
primal token
#

I find this chat amusing ducky_beer

slate swan
winged coral
#

😭

shrewd apex
#

in parent class

white citrus
junior verge
shrewd apex
quaint epoch
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

shrewd apex
#

u passed only 2 params while u need 3

junior verge
#

Do I do "yes" or "no" on do you store message content

slate swan
#

@slate swan I don't think that the Russian mat is normally translated into English.

vocal snow
#

@primal fox please type your message 😭

winged coral
white citrus
shrewd apex
junior verge
#

then the 2nd I assume?

primal fox
shrewd apex
#

unlikely*

slate swan
winged coral
#

Yeah

primal fox
shrewd apex
junior verge
vocal snow
slate swan
#

Time to sit on the toilet and watch this channel

shrewd apex
#

this channel is 2nd most active after python general i think

junior verge
#

"FOR HOW LONG DO YOU STORE IT?" forever then right?

primal fox
junior verge
#

Is that bad?

white citrus
#

@shrewd apex should i send you the classes again?

primal fox
#

for a huge production-grade bot, probably @junior verge

junior verge
#

But it's not like it won't get verified

shrewd apex
vocal snow
primal fox
shrewd apex
white citrus
# shrewd apex just send the second class u were sending before
class settings_document_admin_view(nextcord.ui.View):
    def __init__(self, ctx_or_interaction, settings_data_admin, timeout):
        super().__init__(timeout)
        self.settings_data_admin = settings_data_admin

        self.ctx_or_interaction = ctx_or_interaction
        if isinstance(ctx_or_interaction, Context):
            self.user = ctx_or_interaction.author
        if isinstance(ctx_or_interaction, Interaction):
            self.user = ctx_or_interaction.user
        
        
    async def interaction_check(self, interaction):
            
        filter_dict = {"_id": interaction.guild.id}    
        checka = await interaction.client.settings.find_by_custom(filter_dict)
        
        if checka is None:
            
            if self.user == interaction.user:
                return True
            else:
                embed = nextcord.Embed(description=f"{config.gf_error_emoji} You are not authorized to press this button", colour=config.rot)
                await interaction.response.send_message(embed=embed, ephemeral=True)
                return False
        
            
        if checka is not None:
            role_id = checka["admin_id"]
            if interaction.user.get_role(role_id):
                return True
            if self.user == interaction.user:
                    return True
            else:
                embed = nextcord.Embed(description=f"{config.gf_error_emoji} You are not authorized to press this button", colour=config.rot)
                await interaction.response.send_message(embed=embed, ephemeral=True)
                return False

        else:
            pass


        

    async def unset_admin_role(self, interaction: nextcord.Interaction):
        await interaction.client.settings.unset(self.settings_data_admin)```
junior verge
primal fox
#

a rank itself isn't really that sensitive I guess, so you can keep it indefinitely

junior verge
#

Yeah, it just stores how many messages x user has sent

white citrus
# shrewd apex the other one
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data_admin, *, timeout=3):
        super().__init__(settings_data_admin, timeout=timeout)
        self.ctx = ctx
        self.settings_data_admin = settings_data_admin

        
            
    @nextcord.ui.button(label="Delete the Role", style=nextcord.ButtonStyle.danger)
    async def del_admin_role(self, button, interaction):
        embed=nextcord.Embed(description=f"{config.DiscordTic} The role has been successfully removed!", colour=config.grΓΌn)
        button = self.children[0]
        button.disabled = True
        button.style = nextcord.ButtonStyle.grey
        await interaction.response.edit_message(embed=embed, view=self)
        await self.unset_admin_role(interaction)```
shrewd apex
junior verge
vocal snow
#

whats with the caps 😭

junior verge
#

None I guess with a rank system?

junior verge
#

I just copied it

primal fox
shrewd apex
junior verge
#

Would that actually work lol

primal fox
#

think like Facebook, which takes in tons of user data... they provide an option to view all that data for transparency, and also a way to delete it all

shrewd apex
#

altho i still think 99.99 u won't get it discord will prolly only give it to like 3-4 big bots at max

white citrus
# shrewd apex `super().__init__(CTX, setting_data_admin, timeout)`
Traceback (most recent call last):
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 499, in _run_event
    await coro(*args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\bot.py", line 280, in on_application_command_error
    raise error
  File "C:\Users\domin\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\application_command.py", line 848, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\cog.py", line 221, in _setup_administrator_role
    await interaction.response.send_message(embed=error, view=settings_document_admin_buttons(interaction, settings_data_admin), ephemeral=True)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\buttons.py", line 9, in __init__
    super().__init__(ctx ,settings_data_admin, timeout=timeout)
  File "c:\Discord\Maja Projekt\MajaSystem\modules\setup\views.py", line 11, in __init__
    super().__init__(timeout)
TypeError: View.__init__() takes 1 positional argument but 2 were given```

Mhh
junior verge
#

I just want it verified that's all

pliant gulch
primal fox
#

yeah a command makes the most sense IMO

white citrus
shrewd apex
#

u added it in that view class

#

i swear i never read such long names even in my history class πŸ₯²

primal token
grim oar
#

Look at *ata's code base

white citrus
#
class settings_document_admin_buttons(settings_document_admin_view):
    def __init__(self, ctx, settings_data_admin, *, timeout=3):
        super().__init__(ctx, settings_data_admin, timeout=timeout)
        self.ctx = ctx
        self.settings_data_admin = settings_data_admin
primal fox
shrewd apex
#

ok now send the view class init function

white citrus
# shrewd apex ok now send the view class init function
class settings_document_admin_view(nextcord.ui.View):
    def __init__(self, ctx_or_interaction, settings_data_admin, timeout):
        super().__init__(timeout)
        self.settings_data_admin = settings_data_admin

        self.ctx_or_interaction = ctx_or_interaction
        if isinstance(ctx_or_interaction, Context):
            self.user = ctx_or_interaction.author
        if isinstance(ctx_or_interaction, Interaction):
            self.user = ctx_or_interaction.user```
primal fox
#

discord bots are often the gateway to coding for a lot of people, so I can't blame them completely

primal token
shrewd apex
#

it's a keyword only argument

primal fox
#

most of the time people don't want to actually learn python though, just make a bot

vocal snow
primal token
#

Well it does depend

grim oar
#

They are bunch of hypocrites anyways

primal token
#

If you redirect them and give constructive criticism i wouldnt classify it as gatekeeping

primal fox
#

if someone comes in with no understanding of basic python, you aren't gatekeeping them by telling them to look that stuff up

primal token
primal fox
#

more often than not it's someone who copied code from a discord bot tutorial and doesn't understand why their idea doesn't work

vocal snow
primal token
grim oar
#

I was once muted for saying for f*cks sake

slate swan
#

how can i create a temporary server invite code with my bot for a specific server

vocal snow
unkempt canyonBOT
#

await create_invite(*, reason=None, max_age=0, max_uses=0, temporary=False, unique=True, target_type=None, target_user=None, target_application_id=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates an instant invite from a text or voice channel.

You must have the [`create_instant_invite`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.create_instant_invite "discord.Permissions.create_instant_invite") permission to do this.
vocal snow
#

get the Guild you want with bot.get_guild, pick a channel and use that

fickle hamlet
primal token
grim oar
vocal snow
#

pip install -U discord.py, discord.py version 2 has the new discord features

grim oar
primal token
#

i do agree with you tho, some mutes are quite unfair but you really shouldnt assume the whole system

slate swan
vocal snow
slate swan
#

okay

primal fox
primal token
# grim oar Don't have that kind of time, nor care

If you dont care about it, why did you bring it up? To speak about your personal experiences, yes but its your experience so assuming the staff in pydis are hypocrites is a strong subjective statement dont you think?

vocal snow
#

yes

junior verge
#

Sqlite

primal fox
junior verge
#

oh no

primal fox
#

then you don't need to worry about it

junior verge
#

Hm Robin said I had to do yes

vocal snow
primal fox
primal token
grim oar
#

Let's move on, I can already feel someone's presence

woeful tendon
#

"Can somebody tell me whats wrong with my code?"

import discord

@client.event
async def on_ready():
print(f"{client.user} logged in now!")

@client.event
async def on_message(message):
if message.content.startswith("$greet"):
await message.channel.send(f"Hello! How are you {message.author}")
elif "$thought" in message.content:
response = phrases[random.randint(0, len(phrases) - 1)]
await message.channel.send(response)

my_secret = os.environ['TOKEN']
client.run(my_secret)

grim oar
#

!ot

unkempt canyonBOT
unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

junior verge
vocal snow
primal token
slate swan
junior verge
#

Is server member intent also on_server_add ?

grim oar
#

Yeah

woeful tendon
#

Alright

primal fox
primal fox
#

the whole idea is discord doesn't want you to use that stuff if you don't need it. it's sensitive info

junior verge
#

yeah i don't have that

junior verge
primal fox
#

I'm not sure

junior verge
#

What's the server member intent exactly

woeful tendon
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

primal fox
#

I believe that's being able to see members in a guild @junior verge

white citrus
#

@shrewd apex thank you very much

pliant gulch
#

Even if you don't store sensitive data U.S privacy laws still require you to allow users to request data deletion

junior verge
#

So I guess I don't use it then

woeful tendon
junior verge
#

..

pliant gulch
#

If you do then you need the intent for caching to work

primal fox
junior verge
#

Yeah I get that yes,

junior verge
slate swan
primal fox
slate swan
#

Always helpful before doing a discord bot in python

woeful tendon
junior verge
#

well just the simple ctx.user.avatar.url thingy

vocal snow
slate swan
woeful tendon
slate swan
vocal snow
primal fox
junior verge
#

I think Zeffo is right

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.

junior verge
#

Before I'll submit do you know anything that is important that I like can't miss

slate swan
#

I told a guy to β€œrun b!help” and h just typed β€œrun b!help” in chat πŸ—Ώ

pliant gulch
shrewd apex
pliant gulch
#

You must also include your privacy policy when verifying iirc

junior verge
#

Yeah ik

pliant gulch
#

Post it somewhere like in a github gist

#

Or if you have a github for your bot, make a md

junior verge
#

I'm submitting

grim oar
#

Bring okmi back bro stuff so boring in here

shrewd apex
#

no one to flirt with Nova pithink

slate swan
grim oar
#

I am a dude

slate swan
shrewd apex
slate swan
grim oar
#

And you all are dudes too.

slate swan
grim oar
#

That's crazy

slate swan
shrewd apex
#

that emoji looks so gay

slate swan
junior verge
slate swan
#

Oops meant to send that to my message

primal token
grim oar
#

You sound very much like him

pliant gulch
pliant gulch
#

They would be able to provide way better help regarding verifications

junior verge
#

If it's denied for some reason do they help there too?

primal token
pliant gulch
#

Yea just ask

vocal snow
grim oar
#

Seems so

slate swan
#

Idk if I should code or play r6

primal token
shrewd apex
primal token
#

i actually have self control

junior verge
#

alr ty bro

vocal snow
junior verge
#

pray it gets verified

vocal snow
#

okimii come on ur main

slate swan
primal token
vocal snow
shrewd apex
#

noid does it by himself while oki got others to do it for him

pliant gulch
#

Why do you wanna give discord your personal ID so bad

slate swan
woeful tendon
#

Alright, now another error: NameError: name 'os' is not defined

primal token
#

im so confused right now

slate swan
#

!resources

unkempt canyonBOT
#
Resources

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

grim oar
#

noid, stop the act bro.

vocal snow
primal token
#

ok

slate swan
#

All anime pfps are the same people.

silk fulcrum
#

hey guys :) hows it goin here, im in the best mood i could've have rn

woeful tendon
#

bro so many errors 😭

silk fulcrum
primal token
#

bro im not okimii nor do i want to be himducky_beer

silk fulcrum