#Basic Pycord Help (Quick Questions Only)

1 messages · Page 89 of 1

proud mason
#

Last line

somber pelican
#

bit nitpicky but

proud mason
proud mason
true panther
#

Does that mean bridges don't work in stable release? If they don't I won't bother with them

proud mason
true panther
tribal girder
#

is there a way to find a user by using a string? and not their exact name like "victo" then it search for "victor"

true panther
#

I'd do it by getting a list of users and then looping through

winter condorBOT
tribal girder
#

ty

fervent cradle
#

how do i use discord.ext with pycord?

#

im not sure how to install it

#

pip install what

somber pelican
true panther
grizzled sentinel
wary rover
#

I'm hosting a friend's bot, it's strange code

somber pelican
grizzled sentinel
somber pelican
#

okay thanks

grizzled sentinel
#

I think

somber pelican
#

alright

somber pelican
#
    async def callback(self, interaction: Interaction) -> None:
        await interaction.response.defer(ephemeral=True)

        self.bot.db.set("template", self.children[0].value)

        await interaction.followup.send(":saluting_face: Updated message template.")
grizzled sentinel
#

Ah ok, I must be wrong

somber pelican
#

this only started happening recently...

grizzled sentinel
#

Was the message always ephemeral? Or did you just change that recently?

somber pelican
#

as you can see the only git change i made was in the db line

grizzled sentinel
#

Did it actually show up as ephemeral tho?

somber pelican
#

could it be an intents issue?

#

this is pretty urgent, btw, and it seems to throw on .defer()

#

lemme try removing that

grizzled sentinel
#

I was wong about the ephemeral. It seems there is a special case for it

somber pelican
#

removing defer worked??

#

err ok im not complaining

spring hare
#

How to add cog-based before_invoke?
Like event which is called before any command is invoked in cog

#

on_command doesn't work btw

#

Okay, I found

#

cog_before_invoke

#

lmao

grizzled sentinel
#

XD

winged ravine
#

Mypy: Argument 1 to "add_roles" of "Member" has incompatible type "Role"; expected "Snowflake" [arg-type]
Mypy: Argument 2 to "add_roles" of "Member" has incompatible type "Role"; expected "Snowflake" [arg-type]
Is a Role not a subclass of Snowflake?

plucky citrus
#

I have it as ephemeral

#

But it still sends it?

grizzled sentinel
#

The docs of add_roles would disagree though.

grizzled sentinel
winged ravine
# grizzled sentinel It appears to only subclass `hashable`

why, if its meant to be a Snowflake?
wait isn't Snowflake a Protocol class tho so surely as long as Role implements all the variables & methods of Snowflake then it should be accepted as a valid Snowflake (or my understanding of Protocols may be completely incorrect)

grizzled sentinel
#

Your understanding of protocol classes is better then mine.
The code still works? It is just a type checking problem?

winged ravine
plucky citrus
#

Alright nevermind. Seems with a bug with discord

wooden flame
#

So in my main.py i register my groups, but want to use them in my cogs, how would i do such thing?

in main.py:

test = bot.create_group("test", "Just an test!")
bot.add_application_command(test)
spring hare
#

How to get all posible localizations with pycord?

young bone
#

You mean for the slash_commands?

spring hare
young bone
#

There is some where a list with any at discord

#

Im not sure if py-cord got a list for it

spring hare
full basin
spring hare
full basin
#

It's not in the lib

spring hare
#

bruh

#
discord_locales: dict[str, list[str, str]] = {
    "id": ["Indonesian", "Bahasa Indonesia"],
    "da": ["Danish", "Dansk"],
    "de": ["German", "Deutsch"],
    "en-GB": ["English, UK", "English, UK"],
    "en-US": ["English, US", "English, US"],
    "es-ES": ["Spanish", "Español"],
    "fr": ["French", "Français"],
    "hr": ["Croatian", "Hrvatski"],
    "it": ["Italian", "Italiano"],
    "lt": ["Lithuanian", "Lietuviškai"],
    "hu": ["Hungarian", "Magyar"],
    "nl": ["Dutch", "Nederlands"],
    "no": ["Norwegian", "Norsk"],
    "pl": ["Polish", "Polski"],
    "pt-BR": ["Portuguese, Brazilian", "Português do Brasil"],
    "ro": ["Romanian, Romania", "Română"],
    "fi": ["Finnish", "Suomi"],
    "sv-SE": ["Swedish", "Svenska"],
    "vi": ["Vietnamese", "Tiếng Việt"],
    "tr": ["Turkish", "Türkçe"],
    "cs": ["Czech", "Čeština"],
    "el": ["Greek", "Ελληνικά"],
    "bg": ["Bulgarian", "български"],
    "ru": ["Russian", "Pусский"],
    "uk": ["Ukrainian", "Українська"],
    "hi": ["Hindi", "हिन्दी"],
    "th": ["Thai", "ไทย"],
    "zh-CN": ["Chinese, China", "中文"],
    "ja": ["Japanese", "日本語"],
    "zh-TW": ["Chinese, Taiwan", "繁體中文"],
    "ko": ["Korean", "한국어"],
}
young bone
spring hare
#

lul

young bone
woeful spindle
#

I’m having this same issue

#

##1973

errant craneBOT
woeful spindle
#

if anyone knows a fix pls lmk

proud mason
#

Or a bad network/router/isp

woeful spindle
#

been using my host for a while and never ran into this issue until I began defering

maiden nexus
#

Uh, my bot sends a message which contains both an image and an embed.. I've had this for a long time and I just sent a message first with only the file (image) and then it also had buttons. If you clicked a button it would then also add an embed to the message, I've had this working for months now but today for some reason after I click a button it removes the file? Was there a new change?

proud mason
#

send_message just has extra data in the request

proud mason
#

Do you have any blocking code in your bot?

maiden nexus
#

hmm

woeful spindle
maiden nexus
hushed cargo
#
voice.play(FFmpegPCMAudio(source, **FFMPEG_OPTS), after=lambda e: await play_first_song())

how do i do sum like this? here it says i used await outside an async function, but it needs to be awaited

hearty gorge
#

Is it possible to remove/disable the default slash commands + their suggestions when typing /, but keep custom ones?

frank thistle
#

Why does defering in a modal call back result in a Unknown Message error all of a sudden?

This never happened before today sad

proud mason
fervent cradle
#

.

proud mason
#

If you can't find it, use asyncio.run_coroutine_threadsafe

frank thistle
#

Doesnt happen from a button click etc

frank thistle
#

Discord must have changed something on their end, havent changed my pycord in months

frank thistle
# hearty gorge Yep same
        try:
            await interaction.response.defer()
        except discord.NotFound:
            await interaction.response.send_message("Hello, bye", ephemeral=True, delete_after=0)
#

Make shift fix 😡

hushed cargo
#

is there a way to check if the bots playing anything ina vc?

woeful spindle
fervent cradle
#
class SearchView(discord.ui.View):
    def __init__(self, bot, timeout: Optional[float] = 90):
        super().__init__(timeout=timeout)

        search_places = getSearchPlaces(3)

        for place in search_places:
            self.add_item(discord.ui.Button(label=place, style=discord.ButtonStyle.blurple))

    async def callback(self, interaction: discord.Interaction):
        handle_place()``` how am i able to match the button labels in the callback?
versed fern
#

What's the best way to get the index of an embed field?

tender seal
#

I followed the pycord guide

#
import discord
from discord.ext import commands

class Ping(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def ping(self, ctx):
        ping = round(self.bot.latency * 1000)
        await ctx.respond(f'� Pong || {ping}ms.')

def setup(bot):
    bot.add_cog(Ping(bot))
#

my main code uses load_extension

#

loads the proper file

fervent cradle
#

are you using discord.Bot or commands.Bot

tender seal
#

discord.Bot in the main file, idk

fervent cradle
#

yes, and youre trying to use prefixed commands

tender seal
#

yup

young bone
tender seal
#

ok

fervent cradle
#

do i do @discord.slash_command instead? or what

tender seal
#

alr, changed all mentions of command. to discord.

#

works now

young bone
fervent cradle
#

okay so i do @discord.slash_command

#

and for cooldown? discord.cooldown?

young bone
#

commands.cooldown

#

Im not sure if you can get it with discord.cooldown

fervent cradle
#

oh so why can't i use commands.Cog if i use discord.Bot? i mean it works as well

fervent cradle
#

class SearchView(discord.ui.View):
    def __init__(self, bot, timeout: Optional[float] = 90):
        super().__init__(timeout=timeout)

        search_places = getSearchPlaces(3)

        for place in search_places:
            self.add_item(discord.ui.Button(label=place, style=discord.ButtonStyle.blurple, custom_id=place))

    async def callback(self, interaction: discord.Interaction):
        await interaction.response.send_message('hi')``` and how does one get the button callback for buttons added with add_item?
tender seal
#

I'm back to ask:

How can I import all cogs from all folders located in my src folder

full basin
fervent cradle
#

ahh okay

tender seal
#

so yeah load them basically

full basin
#

Yeah then import isn't the word girl

tender seal
full basin
#

Iterate through the src

#

And then into the cog folders

#

And then load the cog

tender seal
#

I guess

#

I just wanted to know if there's an even simpler way

fervent cradle
tender seal
#

cuz I'm lazy 🫠

full basin
#

Girl you gotta type 1 more line than you do normally

full basin
fervent cradle
full basin
#

I coded it based on the code you provided

wet coral
#

How can I dynamically register event listeners in a cog?

#

I have a list of event types as strings and want to add an event listener for each of them

somber pelican
wet coral
#

like this

class MyCog(discord.Cog):
  events: list[str] = ["on_message", "on_ready"]
  
  def __init__(self):
    # register event listeners for every event in self.events
somber pelican
versed fern
#

Hey, I have 2 branches on GitHub, one's the default branch and the other is named rewrite. How do I move all the code on rewrite to default? I don't want to merge the changes, instead, the entire code currently on default should be ignored and replaced with the code on rewrite. How do I do this?

full basin
proud mason
#

Use that?

wet coral
#

yeah I first used the Cog.listener inside the cog init, which didn't work, but then I figured out that I could just use the Bot.listen

proud mason
#

I don't think any of those would work 🤔

wet coral
#

Bot.listen works actually

proud mason
#

bot.listen is meant to be used as a decorator

#

Oh

wet coral
#

and Bot.add_listener should work too

proud mason
#

Ah you are calling it like a function ig

wet coral
#

you can use decorators just like normal functions, with a few customizations

proud mason
#

Double parenthesis

#

Mhm

wet coral
#

yep

#

but I didn't know that add_listener exists, so I'll use that one now

versed fern
# proud mason ||pr and rebase||

Just wanna be 100% sure before doing anything I might not be able to undo:
Does rebase completely delete the old code? It should since the entire code structure changed dramatically

proud mason
#

Squash and rebase will make a commit that practically overwites the current code. So no need to sort merge conflicts n stuff

You can always revert this commit to go back to the previous one

#

I'm not sure if squash and rebase is a thing tho

wet coral
#

@proud mason
Btw why does

        # dynamically add the event listeners
        def _create_event_listener(event: str):
            async def _event(*args):
                # do stuff
                print(event)

            return _event
        
        for event in self.events:
            bot.add_listener(_create_event_listener(event))
```work but
```py
        for event in self.events:

            async def _event(*args):
                # do stuff
                print(event)

            bot.add_listener(_event, event)
``` not?
Actually the second example does something, but not what one would expect. Do you know, what the difference is?

First example prints the right event name, when the event occurs and second example prints always the name of the last event in self.events, but on every event...
proud mason
#

Hmm

versed fern
proud mason
wet coral
proud mason
#

im not 100% sure about those

#

so do what works right

wet coral
#

yeah

river summit
#

how long do bot ratelimits last?

silver moat
#

sending messages have ratelimits, editing channel names have ratelimits, etc.

#

There is also an overall ratelimit

river summit
river summit
#

does it reset at 00:00UTC?

#

mine should have but it hasnt.

silver moat
#

who knows? What host are you using, if any?

river summit
#

galaxygate

grizzled sentinel
#

Ensure you are on latest pycord version as well to better prevent this issue

silver moat
#

I recommend registering commands locally

full widget
#

I'm getting a python return self.parent.qualified_id 2023-07-07 15:18:36,718:ERROR:fs_bot: ^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-07 15:18:36,718:ERROR:fs_bot: AttributeError: 'NoneType' object has no attribute 'qualified_id'
error when trying to mention a subcommand whose parent command group has no callback on its own, is that the expected behaviour?

grizzled sentinel
full widget
#

mentioning the subcommand gave that error

silver moat
grizzled sentinel
#

Ohh

silver moat
#

I thought we fixed that

full widget
#

maybe i'm on an old version

#

i'll take a look later thx

bleak cloud
#

What’s the easiest way to move a channel up by one within a category?
do i need to get the position and use edit? or move?

silver moat
bleak cloud
#

tyvm

dry fulcrum
#

I'm trying to install pycord dev version, and i'm during install it's showing that the package name's "UNKNOWN"

#

Install log:

starfiles@PRIMARY-Germany-1:~/pycord$ python3 -m pip install -U .[voice]
3Defaulting to user installation because normal site-packages is not writeable
Processing /home/starfiles/pycord
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
WARNING: unknown 2.4.1.dev142+g4de4d206 does not provide the extra 'voice'
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-2.4.1.dev142+g4de4d206-py3-none-any.whl size=2026 sha256=00917c009fbcf2baebe2da058f5fb1be1782a2ed385bbf2ac3511412fe3f3f3c
  Stored in directory: /tmp/pip-ephem-wheel-cache-408slulx/wheels/de/df/7d/20dbaf7b73f3d1337ed3498cba6a30c46264b22f691fd7aeb1
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
  Attempting uninstall: UNKNOWN
    Found existing installation: UNKNOWN 2.4.1.dev142+g4de4d206
    Uninstalling UNKNOWN-2.4.1.dev142+g4de4d206:
      Successfully uninstalled UNKNOWN-2.4.1.dev142+g4de4d206
Successfully installed UNKNOWN-2.4.1.dev142+g4de4d206

and when do try to import discord it give the generic package not found error

spring hare
#

python3 -m pip install -U .[voice] ?

dry fulcrum
#

that's the instructions given on the github

proud mason
#

?tag install

obtuse juncoBOT
#
  1. Uninstall discord.py or any other forks of discord.py you might have with the namespace discord.
    python -m pip uninstall discord.py discord -y

2a. Install py-cord
python -m pip install py-cord

2b. Update py-cord
python pip install -U py-cord

Installing other builds:
Note: You need to have git installed. Use ?tag git to find out how to install git.

Updating the module to master branch (unstable):
pip install -U git+https://github.com/Pycord-Development/pycord

proud mason
#

last line

dry fulcrum
#

that resort to the same thing

#

it's strange though

#

it works fine locally but not on server

proud mason
dry fulcrum
#

will try that

#

nope.. didn't help

#

yea, in the end i dockered that thing

#

and it just works fine now, thanks for your help though

agile minnow
#

how much time will it take to register global slash commands ?

#

?tags

obtuse juncoBOT
#
Tags (114)

yt-tutorials, youtube, xy, wavelink, virtualembed, usernames, usercmd, update, unofficialguide, um_cmds, tryitandsee, tokens, token, timer, tias, this, tcr, tca, tags, tagrules, swasvid, subcommands, sslfix, sqli, solved, snowflake, slashcommandmention, slashblog, rie, restartcmd, requests, replit-install, replit, removeall, pythonserver, python, practices, pp, pomelo, persistant_view, paste, partial_objects, oracle, option, oop, om, official, objects, notpycord, norepl, nojson, nohelp, nohello, no_status, name-conventions, mybot, msgcmd, mongodb, modal, missing_access, message-content, lp, localfile, learnpython, json, intents, install_slash, install_git, install, inline-fields, importerror, idw, ide, how2sql, helpgist, guide, git, getalpha, get_x, get-help, gather, fork, forbidden, exception, examples, ex, ephemeral, eh, docs, discord.app, discord.Bot, deploy, commandnoshow, colors, codeexamples, codeblock, closing, client, chatgpt, buttons2, buttonlimit, bridge, breaking-changes, botvar, bitwise, asset, applicationcommands-registration-delay, announcement_channel_options, aiohttp, activedevbadge, Woc, Timestamps, DMChannel, 429

coarse spire
agile minnow
#

hmm ok

grizzled sentinel
winter condorBOT
# agile minnow how much time will it take to register global slash commands ?

Application Commands Not Showing Up?

  • Uninstall libraries that conflict with the discord namespace (e.g. discord.py).
  • Invite your bot with the application.commands scope.
  • Load cogs before bot.run() (e.g. not in on_ready).
  • Do not override on_connect.
  • Update to the newest version of py-cord (see ?tag install).
  • Turn off User Settings > Accessibility > Chat Input > Use legacy chat input.
  • Share your code and errors.
agile minnow
#

ok thanks

wind jay
#

why do i get discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access when using this:

await after.channel.set_permissions(member, reason=f"Added User {member}", view_channel=True, connect=True)
#

the bot has manage channel rights in the category

#

when i do print(after.channel) i get the channel name printed

young bone
wind jay
#

i did and i cant resolve why

#

the bot has manage channels permission in that category and manage roles permissions

young bone
#

Is the role higher than the member role?

wind jay
young bone
#

Wow

wind jay
#

same error

#

has it to be higher than the highest role of the member?

trim cipher
#

is there any way to add an application command but it also works as a message command too?

young bone
trim cipher
proud mason
#

ext.bridge

errant craneBOT
#

Here's the bridge commands example.

trim cipher
midnight torrent
#

can check decorators have kwargs or paramaters?

oblique river
#
@bridge_command(name="slash", description="INFO")
async def slash(self, ctx):
    embed = discord.Embed(title="Slash")
    await ctx.respond(embed=embed)
``````error
'cogs.slash' raised an error: AttributeError: 'Bot' object has no attribute '_bridge_commands'```
young bone
oblique river
#

the cog file?

young bone
#

no?

#

How you define the bot

oblique river
#

thats the command?

#

I have defined the bot normally*

proud mason
#

also, update to latest pycord version (2.4.1)

#

i would actually suggest using master branch

#

?tag install

obtuse juncoBOT
#
  1. Uninstall discord.py or any other forks of discord.py you might have with the namespace discord.
    python -m pip uninstall discord.py discord -y

2a. Install py-cord
python -m pip install py-cord

2b. Update py-cord
python pip install -U py-cord

Installing other builds:
Note: You need to have git installed. Use ?tag git to find out how to install git.

Updating the module to master branch (unstable):
pip install -U git+https://github.com/Pycord-Development/pycord

silver moat
oblique river
proud mason
silver moat
oblique river
#

i work with __init__

silver moat
oblique river
#

from discord.ext.bridge import bridge_command

silver moat
#

we’re asking for the code for how you defined your Bot instance

proud mason
#

what client class do you use in the main file?
discord.Bot, commands.Bot, or bridge.Bot?

proud mason
#

which one specifically? there are 3 AutoSharded classes blobpain

oblique river
#

AutoShardedBot

silver moat
#

Sorry, this would be better if you just showed your code

proud mason
silver moat
young bone
#

Isnt it only required if the bot is in more than 2k servers?

proud mason
#

discord.AutoShardedBot, commands.AutoShardedBot, or bridge.AutoShardedBot

oblique river
#

na the bot runs normally with AutoShardedBot

oblique river
#

commands.AutoShardedBot

proud mason
#

ah

#

use bridge.AutoShardedBot

silver moat
#

if you’re using bridge you use bridge

oblique river
#

ah

silver moat
#

pages.Bot when /j

oblique river
#

should i import just from discord.ext or from discord.ext.bridge

silver moat
oblique river
#

from discord.ext.bridge import AutoShardedBot, bridge_command

oblique river
grizzled sentinel
#

Show your pip list

oblique river
#

i got it but still dont work

#

with bridge.AutoShardedBot

#

I believe this bridge stuff is broken

silver moat
silver moat
trim cipher
#

is py-cord not supported by wavelink?
and does pycord have a setup_hook ?

oblique river
proud mason
trim cipher
#

it's on the repo.

trim cipher
oblique river
#

In the normal case it should still work the lib

proud mason
#

and nope pycord doesn’t have setup_hook. you can always simply inject code into bot.start

class MyBot(...):
  async def start(...):
    # your stuff
    await super().start(...)
proud mason
#

put the library in place of ...

trim cipher
# oblique river In the normal case it should still work the lib

i tried it but it just doesn't connect to the lavalink server, when I asked in their discord, the moderator there asked me to use dpy but I can't coz I dont want to rewrte again. Then he tried connecting to the server and it worked. so he asked me to check it in this discord server

oblique river
#

Do you have the recent version of Lavalink?

trim cipher
#

3.7.6

#

didn't go for the beta yet

proud mason
#

how do you connect to the nodes?

oblique river
#

thats strange try the older version of the pycord.wavelink lib

oblique river
#

I just see they have deleted the first version hmm

#

try maybe the code from pycord.wavelink

proud mason
#

pycord.wavelink is old. do not use it. normal wavelink will work

oblique river
#

i know 5 persons who still use this and it works

cinder pelican
#

Is the documentation on the help commands up-to-date? I only ask because I expected it to be a slash command, but I could easily be missing a good reason why it's not.

silver moat
cinder pelican
prisma flicker
#

how can I compare a PermissionOverwrite to a TextChannel.permissions_for

cyan quail
cyan quail
prisma flicker
#

Can I just use is_subset?

zinc cloak
#

How do I send multiple modals?

#

wait wait nvm

#

I just thought of a better way to do this

#

is it a discord limitation to have more than five inputs in a modal?

zinc cloak
silver moat
zinc cloak
zinc cloak
#

How do I respond with a modal on a button press

#

Is that a thing

prisma flicker
zinc cloak
#

ok it's just send_modal

#

I'm tryin to find the docs for that tho

prisma flicker
#

.rtfm send_modal

prisma flicker
#

you'll need to subclass discord.Modal

zinc cloak
#

thx

fervent cradle
#

Might be a stupid question, but I forgot how to create a slash command name with space. Like: /translate message. Been not coding for a month 😅

#

If I try to make it like this:

@discord.slash_command(name="translate message")

I get this error:

ValidationError: Command names and options must follow the regex \"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$\".```
coarse spire
fervent cradle
#

I'll try ty

clear vault
#

What would be the best way to go through the database on a remind command, that if a remind ends exactly at 12:10:10, the bot sends the dm at the second

solemn idol
#

Make a command which adds a time to the database and make a task which does xxx at the time it found in the database

proud mason
#

.rtfm sleep_until

winter condorBOT
proud mason
#

you can use this

#

coupled with asyncio.create_task

#

@clear vault ^ this should be a good solution for a small - medium sized bot

strong bobcat
#

please help i want to execute infinitely asynchronous function with while loop in separate thread but using many asyncio methods and aiomisc function always executed only 1 time ignoring while loop

proud mason
# clear vault and big bots?

in big bots, i assume you will have more than about 5-10k of such reminders simultaneously running

in that case having an asyncio Task for each might cause memory issues. what i would do is run a ext.tasks.loop every minute, and only add the tasks for reminders in the next minute

proud mason
clear vault
#

I never understood how i use asyncio.create_tasl

proud mason
proud mason
# clear vault and how can i use this

so make an async function that accepts the datetime for the reminder and any other args you need.

use utils.sleep_until (or a simple asyncio.sleep if you accept seconds) inside that function. then send a message to the use

inside the reminder command, use asyncio.create_task(my_function(...))

strong bobcat
#

This doesnot work for me

proud mason
# strong bobcat This doesnot work for me

what doesnt work? any errors?

also? why do you want to run in a separate thread if the function is async? asyncio.to_thread(asyncio.run_coroutine_threadsafe, ...) will actually just run in the main thread. it is basically useless

run_coroutine_threadsafe inside asyncio.to_thread will only be useful if you have a blocking function that you want to run in a separate thread, but you want to run some coroutine inside that function

#

i original thought that is what you wanted to do

proud mason
proud mason
clear vault
#
from discord.ext import commands
import sqlite3
import datetime
import asyncio

# Verbindung zur Datenbank herstellen
connection = sqlite3.connect('autodelete.db')
cursor = connection.cursor()

# Tabellen erstellen, falls sie nicht existieren
cursor.execute('''CREATE TABLE IF NOT EXISTS autodelete (
                    channel_id INTEGER,
                    message_id INTEGER,
                    delete_time TEXT,
                    PRIMARY KEY (channel_id, message_id)
                )''')
connection.commit()

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

@bot.event
async def on_ready():
    print('Der Bot ist bereit!')
    bot.loop.create_task(check_autodelete())

@bot.command()
async def autodelete(ctx, duration: int):
    delete_time = datetime.datetime.now() + datetime.timedelta(seconds=duration)
    delete_time = delete_time.replace(microsecond=0)  # Setze die Mikrosekunden auf 0, um auf die Sekunde genau zu löschen
    
    # Autodelete-Dauer in der Datenbank speichern
    cursor.execute('INSERT OR REPLACE INTO autodelete VALUES (?, ?, ?)', (ctx.channel.id, ctx.message.id, delete_time))
    connection.commit()
    
    time_diff = (delete_time - datetime.datetime.now()).total_seconds()
    await ctx.send(f'Die Autodelete-Funktion wurde für diese Nachricht auf {time_diff} Sekunden eingestellt.')

async def check_autodelete():
    while True:
        # Aktuelles Datum und Uhrzeit ohne Mikrosekunden
        now = datetime.datetime.now().replace(microsecond=0)

        # Alle Nachrichten mit abgelaufenen Löschzeiten aus der Datenbank abrufen
        cursor.execute('SELECT channel_id, message_id, delete_time FROM autodelete WHERE delete_time <= ?', (now,))
        result = cursor.fetchall()

        for row in result:
            channel_id, message_id, _ = row
            channel = bot.get_channel(channel_id)

            if channel:
                message = await channel.fetch_message(message_id)
                if message:
                    await message.delete()

            # Entferne den Datensatz aus der Datenbank
            cursor.execute('DELETE FROM autodelete WHERE channel_id = ? AND message_id = ?', (channel_id, message_id))
            connection.commit()

        # Warte bis zur nächsten vollen Sekunde
        await asyncio.sleep(1 - datetime.datetime.now().microsecond / 1_000_000)

@bot.event
async def on_message(message):
    if message.author.bot:
        return

    # Prüfen, ob die Nachricht in der Datenbank mit einer Autodelete-Zeit existiert
    cursor.execute('SELECT delete_time FROM autodelete WHERE channel_id = ? AND message_id = ?', (message.channel.id, message.id))
    result = cursor.fetchone()

    if result:
        delete_time = datetime.datetime.strptime(result[0], '%Y-%m-%d %H:%M:%S')
        if delete_time > datetime.datetime.now():
            duration = (delete_time - datetime.datetime.now()).total_seconds()
            await message.delete(delay=duration)
        else:
            cursor.execute('DELETE FROM autodelete WHERE channel_id = ? AND message_id = ?', (message.channel.id, message.id))
            connection.commit()

    await bot.process_commands(message)

# Den Bot starten ```
frigid crater
#

Is there a way of resizing an image used within an embed with .set_image ?

proud mason
wide crystal
proud mason
#

If you use bot.listen, you don't need it

plucky citrus
#

how do i use cogs

#

im olike dumb

proud mason
#

Check the guide. It has a page for cogs

#

.guide

winter condorBOT
wide crystal
proud mason
# wide crystal what does it do though

Well bot.event overrides the default behaviour of the bot.

By default, the on_message event is used to process any prefix cmds. bot.process_commands does the actual parsing n stuff

plucky citrus
#

and /post aint a thing

grizzled sentinel
#

.tag slashnoshow

winter condorBOT
#

Application Commands Not Showing Up?

  • Uninstall libraries that conflict with the discord namespace (e.g. discord.py).
  • Invite your bot with the application.commands scope.
  • Load cogs before bot.run() (e.g. not in on_ready).
  • Do not override on_connect.
  • Update to the newest version of py-cord (see ?tag install).
  • Turn off User Settings > Accessibility > Chat Input > Use legacy chat input.
  • Share your code and errors.
plucky citrus
#

only that doesnt exist

grizzled sentinel
#

Are you loading the cog?

plucky citrus
#

wait i didnt put await infront of the load e

glossy forum
#

Which listener handles Paginator discord-ui-view-timeout's NotFound exception?

plucky citrus
#

Im like dumb but i have no clue how to load a cog. currently its
@bot.event
async def on_ready():
print(f"{bot.user} is ready and online!")
await bot.add_cog(ButtonRoleCog(bot))

proud mason
plucky citrus
#

idk im prob dumb

grizzled sentinel
#

Load cogs before bot.run() (e.g. not in on_ready).

plucky citrus
#

a

grizzled sentinel
#

And use load_extension

grizzled sentinel
plucky citrus
#

load_extension(name, *, package=None, recursive=False, store=False)

#

this?

grizzled sentinel
#

yeah, where name is the file name that your cog is in

plucky citrus
grizzled sentinel
#

the lines right before bot.run(...)

glossy forum
# grizzled sentinel Im not sure what you mean

crap, I restarted the bot and it reset the system log
partial log looked like this

 Task exception was never retrieved
 future: <Task finished name='discord-ui-view-timeout-0107d004d930bd4d50c73a4d889b88e6' coro=<Paginator.on_timeout() done>
 Traceback (most recent call last):
   File "/root/commission_02_2023/bot/lib/python3.11/site-packages/discord/ext/pages/pagination.py", line 583, in on_time>
     await self.message.edit(
   File "/root/commission_02_2023/bot/lib/python3.11/site-packages/discord/interactions.py", line 1194, in edit
     return await self._state._interaction.edit_original_response(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/root/commission_02_2023/bot/lib/python3.11/site-packages/discord/interactions.py", line 428, in edit_original_r>
     data = await adapter.edit_original_interaction_response(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/root/commission_02_2023/bot/lib/python3.11/site-packages/discord/webhook/async_.py", line 219, in request
     raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message
plucky citrus
#

load_extension(setup, *, package=None, recursive=False, store=False)
^^^^^
SyntaxError: iterable argument unpacking follows keyword argument unpacking

grizzled sentinel
glossy forum
#

gotcha, thanks

grizzled sentinel
plucky citrus
#

File "C:\Users\ethan\PycharmProjects\pythonProject\button_roles.py", line 88, in on_ready
role = guild.get_role(role_id)
AttributeError: 'NoneType' object has no attribute 'get_role'

plucky citrus
#

guild = self.bot.get_guild(...)
for role_id in role_ids:
role = guild.get_role(role_id)
view.add_item(RoleButton(role))

grizzled sentinel
#

?tag get_x

obtuse juncoBOT
#

Any function that starts with get_ in Py-cord is retrieving the related object from your bots cache. If the object is not in the bots cache the get_ method will return None. Because of this behavior you should check if the get_x method is None and if it is use the fetch_x method.

Why Is Using fetch_ Without Using get_ First Bad?
The fetch_ method makes a call to the discord API. This API call is unneeded if you already have the information. It will also make your command take longer because it will have to send and than wait for a response from the discord API. It will also contribute to the discord APIs global rate limit of 50 requests per second.

What Is Cache?
The cache is a temporary storage inside your bot. It holds many objects from members to messages. When you restart your bot the cache will be empty. When the cache is full it will delete older objects to make space for the new objects.

plucky citrus
#

bro i stole this from examples

#

then what should i use?

grizzled sentinel
#

💀 the examples dont have fetch.
You will have to do what the tag says. Check if get_guild is None and if it is use fetch_guild

plucky citrus
#

what

frigid crater
#

My emoji's aren't coming through in my embed, they are literally just typing the text ":emoji1:" instead of the image, am I missing something?

plucky citrus
#

i get the same thing man

young bone
#

that is for custome emojis

plucky citrus
#

what

#

thats how i do it for my bot so idrk

young bone
#

the a is for animated emojis if Im not wrong

plucky citrus
#

then dont put the a..

grizzled sentinel
plucky citrus
#

How do i make a link button

full basin
plucky citrus
full basin
#

Pass url= to the button constructor too

#

.rtfm Butto.url

winter condorBOT
#

Target not found, try again and make sure to check your spelling.

full basin
#

.rtfm Button.link

winter condorBOT
#

Target not found, try again and make sure to check your spelling.

full basin
#

It's either url or link

plucky citrus
#

ok

wet coral
#

.rtfm Button.url

winter condorBOT
clear vault
tender seal
#

how can I make something along the lines of modules, where you can have a piece of code for one task like media manipulation, and commands can access it to do their thing

proud mason
#

what is autodelete?

winged ravine
#

Should I import Cog from the top-level discord package or from discord.ext.commands?

from discord import Cog
from discord.ext.commands import Cog
silver moat
#

both can use event listeners

clear vault
winged ravine
silver moat
#

user context menus are application commands

proud mason
#

commands.Cog just modifies 1 method to handle prefix cmds in cog.walk_commands()

#

thats it

#

rest is the same

winged ravine
#

fabulous, thanks for the help!

silver moat
#

👍

winged ravine
#

sorry, one more thing: Can i then use

from discord import Cog

class MyCog(Cog):
    @Cog.listener()
    async def on_ready(self) -> None:
        ...

instead of

from discord import Cog
from discord.ext import commands

class MyCog(Cog)
    @commands.Cog.listener()
    async def on_ready(self) -> None:
        ...

?

zinc cloak
#

Is there a way to do a persistent view setup with multiple buttons 1 through 10 being the count

zinc cloak
silver moat
#

depends on your use case

zinc cloak
#

alr thx

#

is there a way to get the view just from a message

round rivet
#

huh

#

I coulda sworn that was a rhing

round rivet
zinc cloak
round rivet
#

Not really needed

zinc cloak
#

if all it does it call the discord.ui.View.from_message

round rivet
#

Not really needed, if you want you can

#

View.from_message makes more sense to me, and you can use it with different view classes

versed fern
#

How do I make a view with select menu with dynamic options? The user should be select which field of the embed to remove, thus the options change depending on the embed. I'm currently passing the options to the view:

    @discord.ui.button(label="ᅠRemoveᅠᅠ", style=discord.ButtonStyle.gray, row=1)
    async def remove_field(self, button: discord.ui.Button, interaction: discord.Interaction) -> None:
        fields = interaction.message.embeds[0].fields
        if not fields:
            await interaction.response.send_message(embed=discord.Embed(
                title="Error",
                description="There are no fields to remove.",
                color=discord.Color.red(),
                timestamp=discord.utils.utcnow()
            ), ephemeral=True)
            return
        options = []
        for index, field in enumerate(fields):
            options.append(discord.SelectOption(label=field.name, description=field.value, value=str(index)))
        await interaction.response.send_message(embed=discord.Embed(
            title="Remove a Field",
            description="Select the field you want to remove.",
            color=discord.Color.green(),
            timestamp=discord.utils.utcnow()
        ), view=RemoveFieldView(tutorial_embed=tutorial_embed, options=options))

Then I want to set the options of the select menu as self.options, which doesn't work since self is an unresolved reference:

#

(Image cause I ran out of characters)

proud mason
zinc cloak
#

Can there be multiple custom_id buttons on a view with the same custom_id

#

if they are added later and not instanced when the view is created

proud mason
zinc cloak
proud mason
zinc cloak
#

does the view that I add to the bot have to have all the buttons with the custom ids?

proud mason
zinc cloak
#

idk if that makes sense

proud mason
#

I did not understand anything 💀

prisma flicker
#

Why do you need to add buttons later?

versed fern
#
await interaction.response.edit_message(embed=user_embed)

If been using this to edit the message with the embed for now, which worked fine since the callback was triggered by submitting the modal (which before was triggered by pressing a button below the message with the embed). Now, editing the embed is triggered by the callback of the select menu (appears as a new message after a button below the message with the embed was pressed), thus, interaction.response.edit_message edits the message with the select menu and not the one with the embed and the buttons below.
How would I fix this the easiest? Preferably with editing the embed being the only response (Don't wanna add a edited successfully message)

zinc cloak
#

How do I get the at everyone role

#

to use in a set_permisisions

fervent wing
#

ctx.guild.default_role

zinc cloak
#

I want all the buttons they add to be persistent

#

it's probably a bit more difficult so I'll make a post in #969574202413838426 later

zinc cloak
proud mason
oblique river
#

How can i remove the mention_author in the prefix command with bridge? notlikeduck

proud mason
versed fern
oblique river
proud mason
oblique river
#

Yeah because of mention_author

#
TypeError: send_message() got an unexpected keyword argument 'mention_author'```
#

but i need it for prefix command

young bone
zinc cloak
silver moat
#

with ctx.is_app

#
if ctx.is_app: # is an application command
  await ctx.respond(...)
else:
  await ctx.reply(..., mention_author = True)
versed fern
#
Ignoring exception in view <RemoveFieldView timeout=180.0 children=1> for item <Select type=<ComponentType.string_select: 3> placeholder='Please select a field to remove...' min_values=1 max_values=1 options=[<SelectOption label='Test1' value='0' description='Test field value' emoji=None default=False>] channel_types=[] disabled=False>:
Traceback (most recent call last):
  File "C:\Users\user\Documents\Programming\AIM-Bot\venv\Lib\site-packages\discord\ui\view.py", line 414, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\user\Documents\Programming\AIM-Bot\cogs\messages.py", line 791, in remove_field
    await self.embed_message.edit(embed=user_embed)
  File "C:\Users\user\Documents\Programming\AIM-Bot\venv\Lib\site-packages\discord\message.py", line 1465, in edit
    data = await self._state.http.edit_message(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Documents\Programming\AIM-Bot\venv\Lib\site-packages\discord\http.py", line 367, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

RemoveFieldView Class:

    def __init__(self, *args, embed_message: discord.Message, options: list[discord.SelectOption], **kwargs):
        self.embed_message: discord.Message = embed_message
        super().__init__(*args, **kwargs)
        self.remove_field.options = options

    @discord.ui.string_select(placeholder="Please select a field to remove...")
    async def remove_field(self, select: discord.ui.Select, interaction: discord.Interaction) -> None:
        await interaction.response.defer()
        user_embed: discord.Embed = self.embed_message.embeds[0]
        field_index: int = int(select.values[0])
        user_embed.remove_field(field_index)
        await self.embed_message.edit(embed=user_embed)

oblique river
versed fern
#

Any ideas why the message could be unknown?

silver moat
#

.rtfm bridgecontext

silver moat
#

oh it's an attribute

oblique river
#

hm

versed fern
#

nope, it's still there (the message above containing the embed)

oblique river
#

that means is_app dont work

proud mason
versed fern
#

sure 1 sec

silver moat
#

@versed fern perhaps create a forum post, this could get a bit long

proud mason
#

the fact that this line worked means embed_message is acting a message
user_embed: discord.Embed = self.embed_message.embeds[0]

versed fern
#
    @discord.ui.button(label="ᅠRemoveᅠᅠ", style=discord.ButtonStyle.gray, row=1)
    async def remove_field(self, button: discord.ui.Button, interaction: discord.Interaction) -> None:
        embed_message = interaction.message
        fields = embed_message.embeds[0].fields
        if not fields:
            await interaction.response.send_message(embed=discord.Embed(
                title="Error",
                description="There are no fields to remove.",
                color=discord.Color.red(),
                timestamp=discord.utils.utcnow()
            ), ephemeral=True)
            return
        options = []
        for index, field in enumerate(fields):
            options.append(discord.SelectOption(label=field.name, description=field.value, value=str(index)))
        await interaction.response.send_message(embed=discord.Embed(
            title="Remove a Field",
            description="Select the field you want to remove.",
            color=discord.Color.green(),
            timestamp=discord.utils.utcnow()
        ), view=RemoveFieldView(
            embed_message=embed_message,
            options=options
        ),ephemeral=True)
oblique river
#

does not work

silver moat
#

I said it wasn't a method, it's an attribute. so it would be ctx.is_app

versed fern
#

Ignore this stuff in here, gonna create a post

oblique river
oblique river
#

Thank you

copper pine
#

When ctx.defer is used is not possible to reply as ephemeral

silver moat
zinc cloak
#

How do I get all the perms of a channel

#

I want to change the perms of a specific member that has access to the channel

wet coral
#

.rtfm Channel.permissions

zinc cloak
#

I won't have the user though

wet coral
#

jeah, was just testing, sorry. Thought there was a permissions attribute

zinc cloak
wet coral
#

.rtfm Channel.set_permission

wet coral
#

try this

silver moat
waxen whale
#

time for checkup

#

seems like everyone is behaving 👀

naive remnant
#

The bot sends this after I try to dm someone

full basin
naive remnant
full basin
#

Well yes

#

You cant ask why it doesn't work without providing relevant code

#

My best guess is you're just sending the message object

naive remnant
#

The message is an argument in the command func

full basin
fervent cradle
#

hey guys for some reason i get an error when i do this

 embed1 = discord.Embed(colour=0x00A36C)
                        embed1.title = f"Session Launched!"
                        # TODO Add Web link + APP Link
                        embed1.description = f"Congrats"
                        await ctx.followup.edit(embed=embed1)


#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: edit() got an unexpected keyword argument 'embed'

#

the docs says i can use this

#

Found fix ctx.followup.edit(content='' ,embed=embed1)

zinc cloak
#

If I want the user to choose select options in a modal is there a way to do that

#

if I have an enum or something

fervent cradle
#

Hey so I want the user to press a button, then send a message saying anything (example: Send the info.) and wait for the user to send a message then do something with that message

#

But Im not sure how to do it, I already made the button and everything

#

Just gotta understand how to do the other stuff

full basin
#

.rtfm wait_for

fervent cradle
#

Still dont understand how to do it

full basin
#

There are examples below

#
def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send(f'Hello {msg.author}!')```
fervent cradle
#

how tf do I do it for a button

#

it should start checking once a button is pressed

full basin
#

Then do it in the button callback?

#

The format is the same anywhere

fervent cradle
#

maybe Im dumb or something but how

#

ik how to change the channel part but the client

full basin
#

interaction.client

fervent cradle
#

goddamn

#

alr then Im dumb yes

#

Am I still stupid

#

because it wont do anything when I say hello

#

prolly I did something wrong

#

oh ok, I gotta reply

#

makes sense

#

Ok now what if I need to get that message and get it into my main class

#

To use it there

#

as a variable

#

is that possible?

full basin
#

You already got the message in a var.

fervent cradle
#

in a different class

full basin
#

Then just pass it to the class init?

fervent cradle
#

Multiple users would run it at the same time and its a task that uses that variable every 5 secs

#

so how would I do it so that it wont change for a running command

#

thats the thing that idk

full basin
#

Add it to a list? Make the task get the item and then remove it

#

Some kind of queue

fervent cradle
#

alr Ill try thanks

#

its a bit hard

fervent cradle
#

Thanks now I understand how to do it but Im getting some problems

#
  1. Im not sure how to pass it to the class init
  2. How could I make it wait until the user sent the message and its added to the list and then start checking (Something that is working at the main category)
  3. I was going to write something but I forgot
#

I dont know if that is even possible or if I would need to make the checks at the button part

full basin
#
  1. Pass what
  2. You already wait for the message, just add it to your list
fervent cradle
#

ok nvn I fixed that

#

but how can I make it wait for a message not for a reply

silver moat
#

you need message content intents

fervent cradle
#

ok

#

I have em ye

silver moat
#

so you would need to enable it in the developer portal and add it to your intents kwarg in code.

fervent cradle
#

how would I do that?

#

sorry for asking that much

silver moat
fervent cradle
#

I enabled it in the developer portal

#

How would I make it do what I need, wait for a message and not a reply

silver moat
#

would you like an explanation of the current behavior?

fervent cradle
#

yeah wait

silver moat
#

like why it's being the way it is?

fervent cradle
#

Because that way it gives an error, if I reply it does work

#

or wait until its a reply because it sends that Thanks message even if the user didnt reply

silver moat
#

yeah, but you want to know why that is or just how to fix it

fervent cradle
#

So if someone sends a message it just says the thanks thing

fervent cradle
silver moat
#

how do you define your bot instance?

fervent cradle
#

Its a bit messy

#

maybe Im doing it so wrong

#

never tried coding discord bots with py so Im still learning

silver moat
#

ok, so in __init__ create a self.intents attribute and assign discord.Intents.default() to it

fervent cradle
#

ok

silver moat
#

then do self.intents.message_content = True

fervent cradle
#

ye done

silver moat
#

then pass self.intents to the self.bot in load(), by doing

self.bot = discord.Bot(intents = self.intents)
fervent cradle
#

alr

silver moat
#

and could you show your code again just to make sure that you did what changes I offered were actually interpreted correctly

fervent cradle
#

oh now it does work

#

yep, thanks

silver moat
#

yw

fervent cradle
#

So it works that way because it needs the intents to check for the message content I guess right?

#

and it needs no intent for replies?

silver moat
#

without the intent, the bot can only see messages' contents if they are either:

  1. DMed
  2. mention the bot
  3. sent by the bot
fervent cradle
#

ooh ok

#

alr thanks a lot mate

silver moat
#

no worries

#

happy coding

fervent cradle
#

one more question the silly squid

#

How could I make it check that the id from the message sent (txid) is the same as an id

fervent cradle
#

The user that sends that message, get the id from it

#

the id from that user

silver moat
fervent cradle
#

alr thanks

primal furnace
#

How come

on_member_update```

The bot doesn't seem to detect when a role is removed unless the role was initially added to the user in that same instance. So no bot restarts.
silver moat
#

cache

primal furnace
#

I'm trying to log when a role is removed but it only works if that role is given to the user in the same instance.

silver moat
#

on_raw_member_update try that

primal furnace
#

And that won't chang anything within the function itself?

primal furnace
#

Sorry, rephrase. I meant syntax wise I won't have to change anything?

silver moat
#

huh nvm I thought that existed

primal furnace
#

So on_raw won't work?

silver moat
#

yeah, I thought that was a thing

primal furnace
#

I'm just looking for an event that triggers when a role in general is removed.

silver moat
#

hmm you could try using on_audit_log. Although it is on the master branch.

silver moat
#

?tag install

obtuse juncoBOT
#
  1. Uninstall discord.py or any other forks of discord.py you might have with the namespace discord.
    python -m pip uninstall discord.py discord -y

2a. Install py-cord
python -m pip install py-cord

2b. Update py-cord
python pip install -U py-cord

Installing other builds:
Note: You need to have git installed. Use ?tag git to find out how to install git.

Updating the module to master branch (unstable):
pip install -U git+https://github.com/Pycord-Development/pycord

silver moat
#

I would say that master branch is in/near release-state

primal furnace
#

Thats dumb on_member can't do it.

silver moat
primal furnace
#

Nope

full basin
#

.rtfm on_raw_member_update

winter condorBOT
#

Target not found, try again and make sure to check your spelling.

full basin
#

Yeah no lol

silver moat
#

if it does, it for sure isn't documented

primal furnace
#

Thats sooo dumb

primal furnace
#

But it doesn't change anything.

silver moat
#

Please do not crosspost. I'm not familiar with voice and you will get help when someone does know comes.

frank thistle
#

Whats the best way to handle automatic channel unsetting?

I have a configuration system where channels such as the 'Logs Channel' can be set.

I've got try excepts etc, and on discord.Forbidden errors it unsets the channel, however recently the channel was unset due to a discord.Forbidden error whenever discord itself went down and I was served a cloudflare error instead. The site owner may have set restrictions that prevent you from accessing the site.

What would be the best way to ensure this is actually a channel permission related error rather than anything else?

prisma flicker
#

exponential backoff and if it's still down for 24h or something then assume it's permissions?

frank thistle
#

24h is a long time, it just needs to be right, I guess the best way is to check if the error string actually contains something related to Missing Access / Missing Permissions

prisma flicker
#

that seems reasonable

primal furnace
#

Hey @hexed mural

#

Do you know why on_member_update doesn't work too well for when we remove roles?

bold notch
#
await ctx.channel.create_thread(name=f"{ctx.author.name}'s Chat", message=None, auto_archive_duration=60, type=discord.ChannelType.public_thread)

This works find and creates an public empty thread.

await ctx.channel.create_thread(name=f"{ctx.author.name}'s Chat", message=None, auto_archive_duration=60, type=discord.ChannelType.private_thread)

This appears to do nothing. I would like to auto invite the user of the command and any specified users in the command to the private thread.
Creating a private thread in the server works as normal.

proud mason
#

weird behaviour tho

#

.rtfm create_thread

proud mason
bold notch
#

I’ll try

proud mason
#

does the bot have perms for private thread?

bold notch
#

None is the same. Bot is an Administrator.

#

No errors or any output in console

proud mason
winter condorBOT
# bold notch No errors or any output in console

Not getting an error, but definitely should be?

Do you also have an on_command_error set up?
Please make sure to look at, and implement,** the 3 or so lines starting with 'else'** in the example below. Without this code or similar, your error handler is eating all unhandled errors. As you can imagine, this is bad when you get an unexpected error.
https://gist.github.com/EvieePy/7822af90858ef65012ea500bcecf1612

Do you also use asyncio.run and/or bot.start?
Please make sure logging is setup correctly.
https://docs.pycord.dev/en/stable/logging.html

bold notch
#

Tried in different server as well

proud mason
#

hm

#

let me test one sec

#

worked for me

bold notch
#

Thats odd

#
# TODO: Open thread
@bot.command(description="A test command.")
async def tcmd(ctx):
    await ctx.defer()
    await ctx.channel.create_thread(name=f"{ctx.author.name}'s Private Chat", message=None, auto_archive_duration=60, type=None)

    # await ctx.respond("Pong")

All I have is this. Not sure what the difference is.

tribal girder
#

how do i use ctx.reply() without mentioned? I'm trying to use allowed_mentions parameter (just like send()) and set to False but:

allowed_mentions = allowed_mentions.to_dict() AttributeError: 'bool' object has no attribute 'to_dict'

round rivet
#

.rtfm AllowedMentions

round rivet
#

@tribal girder it needs to be passed this class

fervent cradle
#

Huh, why does it say interaction failed? It didn't even throw any exceptions

class confirmationButtons(discord.ui.View):
    @discord.ui.button(label="Send", style=discord.ButtonStyle.green)
    async def callback(self, button, interaction):
        try:
            await u.send(embed=email_embed)
            self.disable_all_items()
            await interaction.message.edit(content=f"Successfully sent the email to {u.mention}!", view=self)

        except discord.Forbidden as e: 
            self.disable_all_items()
            await interaction.message.edit(content=f"Failed to send message to the user. Raised: `{e}`.", view=self)```
proud mason
fervent cradle
#

o thx

young bone
primal furnace
#
if message.author.id == 155149108183695360:
        embed = message.embeds[0]
        if "removed" in embed.description and "Level 20+" in embed.description:
            # Perform your desired action here
            await message.channel.send("Action triggered!")  # Example action: sending a messag```
#

How would I scan the contents of an embed properly?

#

The embed gets sent with a description having removed and Level 20+ in them but this doesn't trigger

loud sail
#

Which database should I use for my bot? I would have gone with MongoDB (Atlas) as this is free.

spring hare
#

I also recommend to use orm like ponyorm, sqlalchemy or tortoise orm (ponyorm is the easiest, sqlaclhemy the most popular and tortoise is fully async)

loud sail
spring hare
loud sail
#

But I wouldn't like to have it in a single file in my bot, rather in a cloud, if you know what I mean... :d

spring hare
#

Oh

#

Tbh, if you don't need cloud, you don't really need cloud

kindred sail
#

but yes i agree use sqlite, itll give the least latency for your users and is a great way to get started

#

i mean technically you could get better performance by hosting something like postgres or mysql

grizzled sentinel
spring hare
#

aiosqlite

kindred sail
primal furnace
#

I just learned that bots cannot detect message.content of other bots. So how would I bypass this or work around it?

kindred sail
primal furnace
primal furnace
spring hare
#

In discord dev portal and in the bot?

grizzled sentinel
#

in both code an on dev portal?

spring hare
#

bruh

primal furnace
#

Yeah. It'll return nothing.

kindred sail
#

im pretty sure it works

loud sail
primal furnace
kindred sail
primal furnace
#

I have intents = discord.Intents.all() to all.

#

And on_message is set to true in the portal.

#

Yet it's turning nothing.

kindred sail
#

can you send your code with the token omitted?

grizzled sentinel
#

And you add intents to the bot?

primal furnace
#
#Discord Intents
intents = discord.Intents.all()

#defining Client
client = commands.Bot(command_prefix=commands.when_mentioned_or(db["prefix"]),case_insensitive=True,intents=intents)```
#
  @commands.Cog.listener()
  async def on_message(self, message):
    print(message.content)
    print(message.author.name)```
#

When Dyno sends anything even just a blank hi non embed it'll not print it. But it prints whatever I say.

spring hare
kindred sail
#

ja, sqlite wird das tun

primal furnace
kindred sail
primal furnace
#

I have all the intents on. message.content works for normal people.

loud sail
primal furnace
#

Also @kindred sail I found another pyCord bug.

#

on_member_update doesn't trigger if the role is removed before its added. So if I restart my bot and a role is removed, it won't read that until its added.

kindred sail
#

ive never actually heard of a sqlite file (being handled correctly) corrupting

spring hare
loud sail
kindred sail
spring hare
#

Just never heard reasons to use async because irrc even orms doesn't block pool too much

#

To it be noticable

primal furnace
#

welp ig pycord bug forever

kindred sail
#

on a bot like yours, it probably wouldnt be noticable

spring hare
#

Fair

primal furnace
#

How come pycord doesn't just have a on_role_remove ?

#

Seems to be easier than this bs

grizzled sentinel
#

Due to the fact the discord does not send an event for on_role_remove

kindred sail
#

^ this

#

our events are synchronous with discords events

primal furnace
#

So to detect roles being removed we have to run loops every 10 seconds?

kindred sail
grizzled sentinel
#

No, you would need to use on_member_update. And I think it has a bug. But it is being fixed.

primal furnace
#

Smh

kindred sail
#

yes, and as mentioned, it is currently being worked on

primal furnace
#

it's been like this forever

kindred sail
#

Unfortunately I'm not the one working on this issue, so i do not have an ETA

spring hare
#

Wait, is it really bugged?

#

Oh wait, it's outdated?

#

pycord


    Called when a :class:`Member` updates their profile.

    This is called when one or more of the following things change:

    - nickname
    - roles
    - pending
    - communication_disabled_until
    - timed_out

    This requires :attr:`Intents.members` to be enabled.

    :param before: The updated member's old info.
    :type before: :class:`Member`
    :param after: The updated member's updated info.
    :type after: :class:`Member`
#

d.py

.. function:: on_member_update(before, after)

    Called when a :class:`Member` updates their profile.

    This is called when one or more of the following things change:

    - nickname
    - roles
    - pending
    - timeout
    - guild avatar
    - flags

    Due to a Discord limitation, this event is not dispatched when a member's timeout expires.

    This requires :attr:`Intents.members` to be enabled.

    :param before: The updated member's old info.
    :type before: :class:`Member`
    :param after: The updated member's updated info.
    :type after: :class:`Member`
waxen whale
#

Right we missing flags

rigid vale
#

How do I change or delete an already existing scheduled event by event_id in pycord? I have searched through all the pycord documentation, but there is nothing there, only create_scheduled_event and fetch_scheduled_event.

fervent cradle
#

could anyone tell me why this callback isnt editing my buttons?

    async def callback(self, button, interaction):
        if interaction.user.id != self.intid:
            return await interaction.respond(embed=discord.Embed(colour=discord.Colour.red(), title=random_error_msg(), description="These buttons aren't for you, back off!"), ephemeral=True)
        sentence, gain, item_type = handle_place(button.label)
        if item_type == "coin":
            await self.bot.addBalance(interaction.user.id, int(gain))
        else:
            await self.bot.addItem(interaction.user.id, gain, 1)
        for c in self.children:
            if c.label == button.label:
                c.style = discord.ButtonStyle.blurple
            else:
                c.style = discord.ButtonStyle.grey
                c.enabled = False
        await interaction.edit(embed=discord.Embed(colour=discord.Colour.embed_background(), title=f"{interaction.user.global_name} searched through {button.label}", description=sentence))
``` they get edited when it times out tho and to the right colours as well?
young bone
proud mason
proud mason
young bone
#

oh ok

fervent cradle
#

ah thanks okay

fervent cradle
#

disabled = True it is

#

also reading the examples here

    secret_greetings = SlashCommandGroup(
        "secret_greetings",
        "Secret greetings",
        checks=[
            commands.is_owner().predicate
        ],  # Ensures the owner_id user can access this group, and no one else
    )``` how can i do the checks if i have my own check?
novel yacht
#

hello i tried to found inforamtion but nothing how it called
when you use slash command like /coinflip choice:Heads/Tails how mack choice selection menu?

novel yacht
woeful spindle
novel yacht
prisma flicker
novel yacht
#

o yea i founded

#

Thanks +rep

silver moat
errant pewter
#

Hello, my bot has no message content intent (i start it with intents = None) but I'd like to get the message content of messages the bot is mentioned in. How can I do that?

#

message.content returns an empty string

prisma flicker
#

you still need the message intent

errant pewter
errant pewter
#

I can enable the message_content intent there without having it? Let me try that

young bone
errant pewter
#

Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

errant pewter
prisma flicker
errant pewter
#

Yeah, I know how it works

prisma flicker
#

without the intent

errant pewter
errant pewter
young bone
#

You have to add it at the website

prisma flicker
#

    Messages the bot sends
    Messages the bot receives in DMs
    Messages in which the bot is mentioned
#

can you get the bot's own messages @errant pewter

errant pewter
#

let me try that

prisma flicker
#

are you sure the bot is mentioned in the message you're trying to read?

errant pewter
#

Yes, it is. The author is a webhook itself, if that matters?

prisma flicker
#

maybe?

#

idk webhooks are weird

#

if the webhook doesn't allow mentions then I don't think it would work

errant pewter
#

hm no it does not work with me mentioning it too

prisma flicker
#

can you send your code?

errant pewter
#
@client.event
async def on_message(msg):
   print("Content: " + msg.content)```
That's the full on_message event 😂
prisma flicker
#

so it just prints out every message?

#

you sure you're mentioning the bot and not its role?

#

what about replying to a message from the bot

errant pewter
prisma flicker
#

yeah I understand

errant pewter
prisma flicker
#

you try DMs?

errant pewter
#

oh wait, I think I've found the issue

young bone
#

What was it?

errant pewter
#

doggokek accidentally used the wrong token which caused running the wrong bot. Sorry for the trouble then, and intents.messages solved it 🙂

#

thank you 🙂

young bone
#

@prisma flicker sry for that, I just didnt know that x3

rigid vale
proud mason
#

There should be a way to do stuff only based on the id tbh

#

Might need to look into this

silver moat
#

is there a PartialScheduledEvent?

proud mason
#

If not, there should be

#

Or simply guild.edit_scheduled_event(...)

#

Or smth

silver moat
#

but parity?

novel yacht
#

i trying to add options in cleared bot it work when i put code to main bot i dont get chose option
my code

import discord
from discord.ext import commands
import mysql.connector
from config import *
import datetime
import asyncio
from discord import option
from discord.commands import SlashCommandGroup
import random

class fan(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
    fan = SlashCommandGroup("fan")

    @fan.command(name="coinflip")
    @option("choice", description="choice", choices=["Heads", "Tails"])
    # @option("bal", description="bal", min_value=1000)
    async def coinflip(ctx: discord.ApplicationContext, choice: str):
        choice = choice.lower()
        coin = random.choice(['heads', 'tails'])
        await ctx.respond(f"The coin landed on **{coin}**.")
        
        available_options = ["heads", "tails"]
        if choice in available_options:
            if choice == coin and ctx.author != self.bot.user:
                await ctx.send("You win!")
            elif ctx.author == self.bot.user:
                await ctx.send("The bot wins!")
        else:
            await ctx.send("Invalid choice. Please choose 'Heads' or 'Tails'.")

def setup(bot):
    bot.add_cog(fan(bot))```
novel yacht
young bone
#

yea

novel yacht
young bone
#

self, ctx, name

novel yacht
#

ops i lose that

#

trying

#

yea work

#

thanks

silver moat
#

another thing, you're comparing ['heads', 'tails'] with ["Heads", "Tails"]

#

but you lowered the choice, so it works, but it would have been better to set a constant to represent this instead of defining a few instances of the same thing

novel yacht
#

okay

#

is it correct?

import discord
from discord.ext import commands
from discord import option
from discord.commands import SlashCommandGroup
import random

class fan(commands.Cog):
    def __init__(self, client):
        self.client = client
    fan = SlashCommandGroup("fan")
    CHOICES = ["Heads", "Tails"]

    @fan.command(name="coinflip")
    @option("choice", description="choice", choices=CHOICES)
    @option("bal", description="bal", min_value=1000)
    async def coinflip(self, ctx: commands.Context, choice: str, bal: int):
        choice = choice.lower()
        coin = random.choice(['heads', 'tails'])
        await ctx.send(f"The coin landed on **{coin}**.")
        
        if choice in CHOICES:
            if choice == coin and ctx.author != self.bot.user:
                await ctx.send("You win!")
            elif ctx.author == self.bot.user:
                await ctx.send("The bot wins!")
        else:
            await ctx.send("Invalid choice. Please choose 'Heads' or 'Tails'.")

def setup(bot):
    bot.add_cog(fan(bot))
proud mason
novel yacht
#

oh, i dupicate send for The coin landed yea i fixed

novel yacht
# novel yacht is it correct? ```py import discord from discord.ext import commands from discor...
Ignoring exception in command fan coinflip:
Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 978, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "c:\Users\misha\Documents\GitHub\mikis\cmd\main\fan.py", line 21, in coinflip
    if choice in CHOICES:
                 ^^^^^^^
NameError: name 'CHOICES' is not defined

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

Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 1312, in _invoke
    await command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NameError: name 'CHOICES' is not defined
coarse spire
#

Use if choice in self.CHOICES

novel yacht
coarse spire
#

Sorry, Change it to if choice in self.CHOISES.lower():

silver moat
#

just don't use .lower()

novel yacht
#

if i put i getting error in my vscode

silver moat
#
    @fan.command(name="coinflip")
    @option("choice", description="choice", choices=CHOICES)
    @option("bal", description="bal", min_value=1000)
    async def coinflip(self, ctx: commands.Context, choice: str, bal: int):
-       choice = choice.lower()
-       coin = random.choice(['heads', 'tails'])
+       coin = random.choice(self.CHOICES)
-       await ctx.send(f"The coin landed on **{coin}**.")
+       await ctx.respond(f"The coin landed on **{coin.lower()}**.")
       
-       if choice in CHOICES:
+       if choice in self.CHOICES:
            if choice == coin and ctx.author != self.bot.user:
                await ctx.send("You win!")
            elif ctx.author == self.bot.user:
                await ctx.send("The bot wins!")
        else:
            await ctx.send("Invalid choice. Please choose 'Heads' or 'Tails'.")
silver moat
novel yacht
#

redit trying

#

😅

#
Ignoring exception in command fan coinflip:
Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 978, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "c:\Users\misha\Documents\GitHub\mikis\cmd\main\fan.py", line 23, in coinflip
    elif ctx.author == self.bot.user:
                       ^^^^^^^^
AttributeError: 'fan' object has no attribute 'bot'

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

Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 1312, in _invoke
    await command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'fan' object has no attribute 'bot'
Ignoring exception in command fan coinflip:
Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 978, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "c:\Users\misha\Documents\GitHub\mikis\cmd\main\fan.py", line 21, in coinflip
    if choice == coin and ctx.author != self.bot.user:
                                        ^^^^^^^^
AttributeError: 'fan' object has no attribute 'bot'

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

Traceback (most recent call last):
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 1312, in _invoke
    await command.invoke(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\misha\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'fan' object has no attribute 'bot'```
silver moat
#
class fan(commands.Cog):
-   def __init__(self, client):
-       self.client = client
+   def __init__(self, bot):
+       self.bot = bot
novel yacht
#

yea work, Thanks for helping

zenith glacier
#

right knowing that i just started using slash commands and it's things
i need help with this:

async def get_animal_types(ctx: discord.AutocompleteContext):
  """
  Here we will check if 'ctx.options['animal_type']' is a marine or land animal and return respective option choices
  """
  animal_type = ctx.options['animal_type']
  if animal_type == 'Marine':
   print("b")
  else: # is land animal
    print("a")

@bot.slash_command(name="animal")
async def animal_command(
  ctx: discord.ApplicationContext,
  animal_type: discord.Option(str, choices=['Marine', 'Land']),
  animal: discord.Option(str, autocomplete=discord.utils.basic_autocomplete(get_animal_types))
):
  await ctx.respond(f'You picked an animal type of `{animal_type}` that led you to pick `{animal}`!')

i want this to be into 2 choices that you can pick
(Embed and Mobile)
above is the thing ive been trying but nothing came out working.

cheers

somber pelican
zenith glacier
young bone
#

Is the basic example working for you?

silver moat
zenith glacier
#

yeah but i dont want that + after the animal_Type == i need it to be doing the stuff i done

#

OR

#

ill just do this like in a video

young bone
zenith glacier
#

yeah then i can do select menu as well

#

actually no

#

ill just keep it as the options

#

pretty much i want it just this

young bone
#

and what is the problem now?

zenith glacier
#

idk how to explain

silver moat
#

or more importantly, what are you trying to achieve after the user selects an option?

zenith glacier
#

hang on im trying this bit out:

@bot.slash_command(name="test")
async def mycommand(ctx, option):
    if option.lower() == "choice1":
        await ctx.send("You picked choice 1!")
    elif option.lower() == "choice2":
        await ctx.send("You picked choice 2!")
    else:
        await ctx.send("Invalid choice. Please try again.")
silver moat
#

the conditions look right. But the response should be await ctx.respond

#

instead of ctx.send

zenith glacier
silver moat
zenith glacier
#

expect

young bone
#

?

zenith glacier
#

i forgot to add the """ bits whjatever

errant craneBOT
#

Here's the slash options example.

zenith glacier
#

already looked

silver moat
#

note that discord.py and pycord are different things

zenith glacier
#

yeah i know that

#

ill just see tomorrow

#

ill try this tomorrow

winged ravine
#

If I defer an application command response as ephemeral, how do I later send the followup as not ephemeral? ephemeral=False seems to not work?

silver moat
winged ravine
#

oof

winged ravine
#

When I use ctx.user.display_name it ignores capitalisation ? even if they have custom capitaliisation in their display name. Am I using the wrong attribute?

silver moat
winged ravine
winged ravine
#

thank u agaiin for such amazing help for the community

zinc cloak
#

is there a way to get a view by view id

halcyon gorge
#

is it possible to delete just the embed of someone elses message?

silver moat
silver moat
halcyon gorge
silver moat
#

no, there doesn't seem to be one

halcyon gorge
#

oof

zinc cloak
#

but idk what it does

silver moat
woven basin
#

Can you restrict the commands an indiviudla can see?

#

Or rather, restrict who can see a command?

echo cipher
#

Can I have my bot respond to a context menu silently? I want to be able to click apps > kick user for example and have it just kick them without visibly responding at all. I originally thought i could do await ctx.respond() but that still attempts to send an empty message

#

I'd also be okay with the bot responding with one of those Only you can see this - dismiss message type of messages, though i don't know what they're called or anything about them

echo cipher
#

nevermind, i've figured out they're called "ephemeral" messages and i can just add ephemeral=True to the end of ctx.respond, thanks anyway :)

prisma flicker
fervent cradle
#

Can I make a button disabled from everyone except an ID?

#

and change the label, emoji and style

#

I mean I tried but it just says Interaction failed and does nothing

#

Maybe doing it the wrong way

fervent cradle
#

instead of a permission

#

or would have to make a check/error handler

prisma flicker
fervent cradle
#

An example?

fervent cradle
#

and all other ppl that asked that had an example like that or similar

prisma flicker
fervent cradle
#

alr thanks