#Basic Pycord Help

1 messages · Page 21 of 1

wide jasper
#

yes

#

whats the question?

frail ocean
#

idk it doesnt work if i definie id on somethink like bot.get_guild

#

If i doesnt it dowks?

frail basin
#

returns None?

frail ocean
#
2024-02-21T15:15:19.064457092Z Ignoring exception in on_guild_channel_delete
2024-02-21T15:15:19.064652129Z Traceback (most recent call last):
2024-02-21T15:15:19.064671628Z   File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 378, in _run_event
2024-02-21T15:15:19.064677078Z     await coro(*args, **kwargs)
2024-02-21T15:15:19.064680054Z   File "/data/cogs/autodelete2.py", line 102, in on_guild_channel_delete
2024-02-21T15:15:19.064683460Z     resultcursor = await db.execute('SELECT channel_id FROM autodelete WHERE channel_id = ?', (channel.id))
2024-02-21T15:15:19.064686687Z   File "/usr/local/lib/python3.10/site-packages/aiosqlite/core.py", line 190, in execute
2024-02-21T15:15:19.064690083Z     cursor = await self._execute(self._conn.execute, sql, parameters)
2024-02-21T15:15:19.064692869Z   File "/usr/local/lib/python3.10/site-packages/aiosqlite/core.py", line 133, in _execute
2024-02-21T15:15:19.064695774Z     return await future
2024-02-21T15:15:19.064698439Z   File "/usr/local/lib/python3.10/site-packages/aiosqlite/core.py", line 106, in run
2024-02-21T15:15:19.064701786Z     result = function()
2024-02-21T15:15:19.064705082Z ValueError: parameters are of unsupported type```
#

And what is wrong with that?

frail ocean
#

@frail basin py 2024-02-21T09:04:52.373061763Z TypeError: Client.get_channel() got some positional-only arguments passed as keyword arguments: 'id'

frail basin
#

thats a pretty self explanatory error

lofty parcel
#

get_channel only receives one positional argument, an int

#

Why would you need to pass id=

frail ocean
frail basin
#

no

lofty parcel
#

Thats your sql query returning an error

#

Not pycord

frail ocean
#

2024-02-21T151519.064705082Z ValueError: parameters are of unsupported type

#

Thats pycord ig?

frail basin
#

i think sql would return a ProgrammingError dont quote me on that one tho

lofty parcel
#

The traceback literally shows your sql query line as the error line...

frail ocean
#

Yes but idk whats wrong there

sage tendon
#

hardcode the ID and see if it works
if it does, go from there

frail ocean
#
2024-02-21T09:04:52.373415787Z     user_info = (datetime.datetime.now() - member.created_at).days
2024-02-21T09:04:52.373418784Z TypeError: can't subtract offset-naive and offset-aware datetimes```
How can i get how old in days a account is?
wide jasper
frail ocean
wide jasper
#

the two timestamps shoule be the same type

wide jasper
frail ocean
#

Its grey

wide jasper
frail ocean
wide jasper
#
guild = await bot.fetch_guild(config().guild_id)
members = guild.fetch_members()
print(guild.chunked)
print(guild.members)

why do i get False for chunked? I fetched the members before? and why is guild.members an empty list?

sage tendon
#

you dont have members intents

#

and please dont fetch all members on bot start

#

they get cached by default

#

and dont fetch the guild either

wide jasper
wide jasper
#

and intents = discord.Intents.all()

sage tendon
#

well, shrug then

wide jasper
#

any idea?

sage tendon
#

do it in a normal command and see what happens

wide jasper
#
@tasks.loop(minutes=5)
async def user_count_task():
  print("hi")
  
  
if user_count_task.is_running():
  user_count_task.restart()
  print("user_count_task restarted")
else: 
  print("user_count_task started")

i get "user_count_task started" but not "hi"

sage tendon
#

uh

#

you are only starting it when its already on (?)

wide jasper
sage tendon
#

you are basically doing

if the task is running
    restart it
if the task is not running
    print "it started"
#

unless im reading that wrong

wide jasper
#

yeah

#

uh wait

#

wtf

#

user_count_task.start()

#

just dissapeared

#

im dumb

#

all works now, very weird

little cobalt
wide jasper
oblique sable
#

hey guys, Interaction.edit is not working on my pc, but it was working on my other one
sadly i cant get what version i was using, and i couldnt find anything online
could someone help me please

lofty parcel
#

its either interaction.response.edit_message or interaction.edit_original_response

oblique sable
#

So it never existed ? Then I may be wrong and I was using a different library than py cord because it worked

#

Thank you for helping me out here

lofty parcel
#

.rtfm Interaction.edit

shell radish
#

it's on master

lofty parcel
#

i swear with master

#

why the other bot uses stable

oblique sable
#

Wait what

shell radish
oblique sable
#

Is there any way I can install this version since it seems to be working ?

lofty parcel
#

?tag install

limber wagonBOT
#

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

lofty parcel
#

last line

oblique sable
#

I actually don’t know why Interaction.edit was working before, I didn’t install the master one,
But thanks I will do that

ivory beacon
#

webhook.send(view=btn()) ?
like this ?

shell radish
ivory beacon
ivory beacon
# shell radish i have no idea what `btn` is
class btn(discord.ui.View):
   def __init__(self):
    super().__init__(timeout=None)
    invite = discord.ui.Button(label='Invite Dank Alert!', style=discord.ButtonStyle.gray, url='https://discord.com')
    self.add_item(invite)
shell radish
#

well, it’s bad practice to name something to be something it isn’t

#

and also UpperCamelCase for class names

ivory beacon
#

anyway rename to InviteBot

shell radish
#

should work

ivory beacon
ivory beacon
ivory beacon
#

why ?🙂

shell radish
#

e.g. as a follow-up to an interaction

edgy nest
#

smth like Webhook(..., state=bot._connection) or webhook._state = bot._connection

#

webhooks are jank af

obsidian stratus
#

My message delete log embed has message.attachments[0].url but 9 out of 10 times I see this placeholder image, is there any fix to this?

#

Tried searching docs, it only takes https links so I don’t think I can save attachment and put attachment url

limber wagonBOT
#
f = discord.File("some_file_path", filename="image.png")
e = discord.Embed()
e.set_image(url="attachment://image.png")
await messagable.send(file=f, embed=e)```
obsidian stratus
#

Thank you

oblique sable
little cobalt
oblique sable
#

3.10.12, would that cause any issues?

solid sapphire
#

Can a bot create a linked role?

#

or add a requirement to an existing one to make it linked?

frail ocean
#

How many slash commands and groups can now be registered per app?

lapis dock
frail ocean
lapis dock
#

Fabio, yes

topaz halo
#

how can I tell if a slash command was ran from a VC text channel

lofty parcel
topaz halo
#

how can I make a slash command only appear to users in certain contexts, such as only in a VC, I am making an AutoVC and need some per channel config commands

#

where can I find the list of kwargs for @bot.slash_command

upbeat lintel
#

Is there a way to retrieve the bot's default role? The one that gets created when adding it to a guild

frail ocean
thorny robin
#

can someone help me i need to know if pycord is installed on my pycharm now

#

but i am completely new and idk a shit

lapis dock
lapis dock
thorny robin
#

there is nothing when i run pip list

shell radish
shell radish
#

It should be on the lower left side of your window

thorny robin
shell radish
#

if you see py-cord then it's there

thorny robin
#

yeah it is

terse arrow
#

Heya, I am trying to send an image to a different channel

#

such as a saved image is sent to a announcement channel

shell radish
#

so what is your question

terse arrow
#

So I am making a bot which places a logo on an image saved from a previous message. I want to get the image to be sent back by the bot to a different channel

topaz halo
#

is user_limit=0 infinity for voice channels

finite plover
#

how to send message in the channel on start?

shell radish
#

what type of channel? Is it like the same channel every time?

finite plover
frail ocean
#

What is wrong here

await cursor.execute(
    "SELECT channel_id FROM db WHERE guild_id = ? AND channel_id = ?", 
    (message.guild.id, message.channel.id))
TypeError: not all arguments converted during string formatting```
oblique sable
#

if not then i maybe forgot i installed it that way, but im pretty sure i did not

smoky steppe
#

I'm having trouble getting slash commands working, they show up in the server settings, but are not available in my text channel, any idea of what might be up, or where to start debugging?

lofty parcel
#

Refresh your client.

frail ocean
#

Is there a way, that a bot can interact with automod in pycord?

torpid cosmos
torpid cosmos
#

No because i don't think its in the guide and it requires a lot of stuff that I don't want to type out at the moment

#

That Guild.create_auto_moderation_rule should be all you need to take a look at though

#

What are you trying to do, just create rules?

smoky steppe
# lofty parcel Refresh your client.

I completely restarted my discord, and that seems to have done the trick – but that doesn't really work when actually deploying the client, do you know if this eventually becomes consistant by itself?

frail ocean
torpid cosmos
#

wdym

#

bots get badges if they interact with the automod?

#

Oh i didn't know that

#

I will not help you with this further, unfortunately. It's misleading for your bot to have an automod badge if it does not, in fact, actively utilize the automod.

frail ocean
umbral musk
#

I have a slash command that asks the user for a channel and I want to send that data over to a button, someone suggested to me that using a custom_id is a good idea to forward that data to the button but I can't figure it out how to set that up. Does anyone have a good example of how they used the custom_id to get data into a button?

torpid cosmos
torpid cosmos
lapis dock
smoky steppe
lapis dock
umbral musk
lapis dock
umbral musk
lapis dock
umbral musk
#

I do not, is it like passing an argument into a function or is it different?

smoky steppe
lethal loom
#

I have created a command group in a cog, can I then use this group in another cog?

lapis dock
#

going to make things easier down the road

umbral musk
#

Alright I'll give it a watch, thanks!

lapis dock
torpid cosmos
lethal loom
torpid cosmos
#

💀

#

May I ask why you are trying to do this? Your code would be easier to read and maintain if you kept groups in one file with each other

lethal loom
torpid cosmos
#

It's just a matter of making a slash command group and importing it in a new file

smoky steppe
edgy girder
#

What's the best way to implement scheduled tasks? I can research it myself, just getting a few contradictory answers online

lapis dock
#

useing the tasks module

dim raptor
#

how do i make a group bridge commands work in guilds only

lofty parcel
#

Your badge hunting thing is really weird. I've seen you in the ddevs server

neat hornet
#
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects
#

wtf is this error

#

solve someone

shell radish
neat hornet
whole needle
#

how do i make a modal

sage tendon
little cobalt
sage tendon
#

i know

#

but its way too much trouble to do so with the current pypi release

little cobalt
#

No

#

Its not x3

sage tendon
#

so installing 5GB worth of stupid vs c++ build tools isnt too mcuh effort?

#

instead of just using the github version or using 3.11?

smoky steppe
#

How do I link users, messages and channels in a slashcommand response?

sage tendon
#

member.mention
channel.mention
message, not sure

smoky steppe
#

These are the permissions the bot currently has, so I don't think that is the problem

#

more likely I'm just not sending the correct data

lofty parcel
# smoky steppe

Whatever you're doing, you're formatting the mention wrong.

#

Can't tell without code.

low solar
#

hello, so i have a command in a cog but the command doesnt show up

import discord
from discord.ext import commands
from discord import option
import json
import base64
from discord import guild_only


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

@commands.slash_command(name = "testcik", description = "test")
async def trolled(interaction):
    for category in interaction.channel_categories:
        for channels in category:
            print (channels)



def setup(bot):
    bot.add_cog(Testujemy(bot)) ```
^ thats the code of the cog

```python
import discord
from discord.ext.commands import CommandNotFound
from discord.ext import commands
from discord import guild_only
import os # default module
from dotenv import load_dotenv
import sys
import requests
from io import BytesIO
import asyncio
import json
intents = discord.Intents.all()
bot = discord.Bot(intents=intents)
import base64


load_dotenv()

for filename in os.listdir("./cogs"):
    if filename.endswith(".py"):
        bot.load_extension(f"cogs.{filename[:-3]}")
        print(f"Loaded {filename}")
#commands...

^ thats how i load the cog

#

(i did everthing in .slashnoshow)

smoky steppe
# lofty parcel Whatever you're doing, you're formatting the mention wrong.

I tried both plain @nick and @<user_id> – what is the correct way of doing it?

@bot.slash_command(
    description="List current status",
    guild_ids=config.get("discord_server_ids", []),
)
async def checkinstatus(ctx: discord.commands.context.ApplicationContext):
    users_in = []
    users_out = []
    with Session(engine) as session:
        for user in session.query(DiscordUser).all():
            if user.checkin.is_in:
                users_in.append(f"@<{user.discord_id}>")
            else:
                users_out.append(f"- @<{user.discord_id}>: {user.checkin.message}")

    outlist = "\n".join(users_out)
    await ctx.respond(
        f"""**In:** {", ".join(users_in)}
**Out:**
{outlist}""",
        ephemeral=True,
        # delete_after=config.get("temporary_message_time", 120),
    )
lofty parcel
#

You placed the @ in the wrong place

smoky steppe
#

so close, yet so far 😅 thanks, I didn't notice the difference when I typed off after my test message

sage tendon
#

or just use member.mention

#

way cleaner and impossible to get wrong

lofty parcel
smoky steppe
# sage tendon or just use member.mention

got details on this?
My intent here is to list a bunch of users based on data from a database, simply to make it easier to send them a message.
I'm not mentioning the user that executed the command, it's basically everyone in the channel

#

That being said, any magic to make them links but not ping people? not that it matters much, as I'm using ephemeral, but it'd look cleaner without

smoky steppe
# low solar bump

I had trouble with my Discord client being slow at loading in the commands last night, try quitting discord completely and starting it again? The commands where visible under the bot in settings, but not when typing in the text channels

sage tendon
sage tendon
sage tendon
smoky steppe
sage tendon
#

Yea

#

not sure what that'd even accomplish

#

you can silence the ping ofc but not sure that's what you intend lol

#

actually hang on

#

well okay there is another way

#

that will insta-open the DMs with that user

#

and it'll be labelled with that persons username

#

that also wouldn't produce a ping if you were to make it non-ephemeral

sage tendon
#

restart your discord and make sure you do /trolled and not /testcik

topaz halo
#

how do I disconnect a user from VC using a bot, assuming the ctx is the VC in question

lofty parcel
boreal sky
#

Where can I get the time a command was sent at for ApplicationContext? I can't exactly do message.created_at

sage tendon
#

time.time()?

boreal sky
#

and that's exactly what I'm trying to measure

shell radish
#

?tag snowflake

boreal sky
#

oh my

steep cliff
shell radish
#

or just discord.Object(id).created_at

dim raptor
#

wait how do i make bridge group commands work in dms only

sage tendon
#

just return if the channeltype is not a dm

shell radish
dim raptor
#

isnt there like a guild_only()

sage tendon
dim raptor
#

but that doesnt work for groups for some reason

shell radish
dim raptor
#

oh

rugged lodgeBOT
dim raptor
#

so what can i put here

#

so that the slash cmd doesnt show up in dms at all

#

like the @guild_only() doesnt work for groups

boreal sky
#

and how often does ctx.bot.latency end up getting updated?

shell radish
dim raptor
#

but like most of my bot is bridge commands

shell radish
dim raptor
#

oh

#

can it be found in the docs?

shell radish
#

can what be found in docs

dim raptor
#

like how to make bridge groups guild only

shell radish
#

don’t think so?

dim raptor
#

oh

shell radish
#

oh you can pass guild_only = True in the group decorator maybe

dim raptor
#

oh ok thx

smoky steppe
sage tendon
#

edit the message

#

send an empty message, then edit the pings in afterwards

atomic fern
#

how to make paginator persistent?

boreal sky
#

Just curious if maybe there's a way to force a latency check or something

#

or at least know what kinda tiem frame it's based on

sage tendon
#

what do you need it for

boreal sky
sage tendon
#

that no one will use? :3

boreal sky
#

that I will use because it's satisfying

sage tendon
#

id assume it gets updated often enough for your purposes

boreal sky
#

not like anyone will be using my bot all that much in the first place, I'm just vibing here

boreal sky
#

or so it seems

#

not that fun having to wait 2.5 minutes just for a single command

boreal sky
sage tendon
#

i highly doubt it takes that log

#

your latency is most likely just really consistent

boreal sky
#

doubtful

#

Even with 32, the 2nd and 3rd always seem to be the exact same for some weird reason

sage tendon
#

that should tell you that its more than 32 seconds

#

according to your logic, that is

boreal sky
#

yes but why is it specifically the 2nd and 3rd

sage tendon
#

if you think about it it makes sense really

boreal sky
sage tendon
#

actually no, its shorter than 32s according to your logic

boreal sky
#

wat

#

you say "your logic" as if it's my fault this is the conclusion I'm arriving at

sage tendon
#

it makes sense in my head but i cant put it into words

#

0 15 30 45 60 75 80
|-------|-------|-------|-------|-------|-------|
U U U U U U
Q1 Q2 Q3 (Overlap) Q4 Q5

here, i asked AI BrainBigger to make a representation of what i mean

Q is your query, and the U is the time of the latency updating that it itself just assumed to be 15

#

idk if that makes sense ill go lmao

frail ocean
#

Is there a way to make a slash command group over more cogs

low solar
#

sorry for the late response but yea it doesnt work

hard kettle
#

How long are buttons active for

low solar
#

every command is from the main file not from any cogs

#

they worked before now itsbroken

sage tendon
#

no clue then, ig you are doing the cog incorrectly then

low solar
#

its in the ./cogs directory

#

so idk what could be wrong

#

it detect the files

#

so i have no clue

sage tendon
#

change the whole for loop that handles the loading to just
bot.load_extensions("cogs")

low solar
#

i fixed it

#

i forgot to add spacing

#

i made it outside the class

#

before

sage tendon
#

lol

low solar
#

im dumb

#

nvm lmao

sage tendon
hard kettle
sage tendon
#

if im not very wrong, 15m by default

frail ocean
#

The toothy my friend

sage tendon
#

what do you think does it mean that i dont respond
A: i dont care
B: i dont know

frail ocean
#

Do you care?

sage tendon
#

i cant care if i dont know

frail ocean
#

Oh

finite plover
#

how to send message in the channel on start?

hard kettle
#

How do i edit a slash command msg

#

msg.edit(f"yay u linked {username}")

lofty parcel
hard kettle
lofty parcel
hard kettle
lofty parcel
#

ApplicationContext already provides an edit method that does it for you.

#

ctx.message will always be None on slash commands.

#

.rtfm ApplicationContext.edit

round heart
#

🤔 Do Files always show before embeds in messages, or did I somehow do something wrong? Are there any sneaky ways of making it come after?

finite plover
sage tendon
#

you can't change it

#

message > files > embeds > buttons

round heart
#

Can't think of any place where a file before an embed makes visual sense, but it is what it is. Thanks for the rundown

sage tendon
#

np

#

it's just because of how embeds work I think

#

they're kind of not part of the message

whole needle
#

how do i make a multiple choice option

west ether
#

Am I right that it takes a while for Context Menus to appear?

lapis dock
rugged lodgeBOT
#

Here's the slash options example.

lapis dock
#

@whole needle ^

frail ocean
#

Is there a way to use the same slash command group in multiple cogs

torpid cosmos
#

you asked this the other day

#

we gave you an answer

#

just like you would any other variable or object

#
# cog1.py
import discord

group = discord.SlashCommandGroup("MyGroup")
...
# cog2.py
import discord
from cogs.cog1 import group

@group.command
async def my_command(ctx):
    ...
#

I'm pretty sure that's how it works

#

fact check me

scarlet shale
#

hey, I'm working on an old bot of mine, and when I launch the bot it spits out this error log. All my previous commands are still working, however any new commands I try to make are just giving me Application did not respond in discord and no log output on the bot.
Error:

Traceback (most recent call last):
  File "/home/[user]/.local/lib/python3.11/site-packages/discord/client.py", line 378, in _run_event
    await coro(*args, **kwargs)
  File "/home/[user]/.local/lib/python3.11/site-packages/discord/bot.py", line 1164, in on_connect
    await self.sync_commands()
  File "/home/[user]/.local/lib/python3.11/site-packages/discord/bot.py", line 738, in sync_commands
    app_cmds = await self.register_commands(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/[user]/.local/lib/python3.11/site-packages/discord/bot.py", line 531, in register_commands
    prefetched_commands = await self._bot.http.get_guild_commands(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/[user]/.local/lib/python3.11/site-packages/discord/http.py", line 365, in request
    raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access```
shell radish
#

One of the ids in guild_ids or debug_guilds does not have your bot in it.

scarlet shale
#

oh smh my head, the person I'm making the bot for removed my bot from their server, that explains it

#

sorry! should've checked that before posting here

hallow copper
#

damn

#

this thread is here for questions like that lmao you’re good

ivory beacon
#

I'm experiencing issues with pinging on certain servers, similar to the images provided. I'm using <@&RoleID> in my bot

torpid cosmos
#

for when you're sending the role mention

ivory beacon
# torpid cosmos show us your code
async def SendMessage(channel_id,role_id,embed,extra_text):
   channel = bot.get_channel(channel_id)
   await channel.send(f'<@&{role_id}> {extra_text}',embed=embed)
ivory beacon
shell radish
#

your bot may not have the permissions to mention roles in those channels

ivory beacon
ivory beacon
#

this ?

#

ig

edgy nest
#

that would work

maiden bloom
#

Is it possible to change the avatar/profile of a bot per server?

lofty parcel
#

No

atomic fern
#

is paginator.send() can only be used with context? i want to send it in an event, howw?

unkempt gorge
#

How can I use @bot.command and the on_interaction Event?

little cobalt
unkempt gorge
#
@bot.command(
    name="leaderboard",
    description="Gibt eine Liste der User, sortiert anhand ihrer Level, zurück",
    guild_ids=[1206310273649217546]
)
async def leaderboard(interaction: discord.Interaction):
    print(interaction)
little cobalt
#

use ctx: discord.ApplicationContext instead of interaction at slash commands

#

And it would be discord.Bot what you have to use

unkempt gorge
#

yes

#

But if I have a on_interaction Event, it don't prints interaction in the console

harsh gust
#

how do i send svg file (as image)

#

this file gets sent like this

#
      . . .
    await msg.edit_original_response(file=discord.File("result.svg"))

this is what im doing currently to send the file

#

btw ping me when u respond to me ( I FIXED IT )

#

just realised discord doesnt have preview for svg

#

ok wtf

#

everytime i convert to png from svg using cairo

#

it tells me i dont have libcairo-2.dll

#

when i download it

#

it says i dont have discord

sage tendon
#

maybe some context or screenshot would help

deft kestrel
#

how to put quantity optional?

little cobalt
deft kestrel
#

that's correct?

little cobalt
#

no

#

you have to use discord.Option() or @discord.option()

rugged lodgeBOT
#

Here's the slash options example.

deft kestrel
#

@option("product", description="Product name") @option("price", description="price") @option( "quantity", description="How many pieces", required=False )

#

like that?

sage tendon
#

try it and see

atomic fern
#

💀💀💀 damn, no one answering

#

whyy

sage tendon
#

that is usually when no one knows

lofty parcel
lofty parcel
unkempt gorge
lofty parcel
#

You don't override events.

rugged lodgeBOT
#

Here's the confirm example.

atomic fern
#
 line 964, in send
    raise TypeError(f"expected Context not {ctx.__class__!r}")
TypeError: expected Context not <class 'discord.channel.TextChannel'>
  paginator = Paginator(
    pages=pages,
    use_default_buttons=False,
    custom_buttons=pages_buttons,
  )
  channel = bot.get_channel(1127166473467600896)
  await paginator.send(channel)

is there a way to send paginator to a specific channels or update the page content?

#

without Context

unkempt gorge
lofty parcel
rugged lodgeBOT
#

Here's the persistent example.

unkempt gorge
#

Thanks

lofty parcel
lapis dock
#

ohh, Oms fixes this

cobalt bone
#

Hello ! blobwhat
What permission do I need to use the soundboards on the doc?

lapis dock
#

what do you mean by "doc"?

light arrow
#

why doesnt this work?
Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'edit'

messageToEdit = None



@bot.slash_command(name='test1', description='test1')
async def host(interaction: discord.Interaction):
  global messageToEdit
  messageToEdit = await interaction.response.send_message("Test")




@bot.slash_command(name='test2', description='test2')
async def host(interaction: discord.Interaction):
  messageToEdit.edit(content="Testttttt")
sage tendon
#

because interactions have no edit method

little cobalt
light arrow
#

Mmm okay ill give it a try

cobalt bone
#

I can't find the exact permission to modify the use of soundboards with a bot

cobalt bone
#

thanks

cobalt bone
# sage tendon USE_SOUNDBOARD

in set_permissions of a voice channel, is there a permission that can be modified to prevent the use of soundboards?

sage tendon
fleet cedar
#

Oh that

#

That might not make it into 2.5 unfortunately

lofty parcel
#

why not 😭

fleet cedar
#

But you can always install my fork

#

Regardless of the version of pycord you are using

lofty hedge
#
Traceback (most recent call last):
  File "/home/container/bot.py", line 3, in <module>
    from src.cogs.economy import setup as setup_economy
  File "/home/container/src/cogs/economy.py", line 1, in <module>
    import discord
ModuleNotFoundError: No module named 'discord'``` im getting this error on my test bot all of a sudden not quite sure why, im using a requirement file py-cord
hard kettle
#

colour= discord.colour.embed_background("dark") This aint working

subtle moth
hard kettle
subtle moth
#

What link

subtle moth
hard kettle
civic lotus
#

Hi! I want to automaticly create post in a forum and send a message but I not find how to do it (Sorry for my bad english)

subtle moth
hard kettle
#
    button = discord.ui.Button(label="Direct Messages", url=msg.jump_url)
    View.add_item(button)```
Missing item in View.add_item
subtle moth
subtle moth
hard kettle
subtle moth
# hard kettle How do i do that

Just like how you make an instance of any class. If you don't know, you should definitely learn about oop first before making a discord bot

subtle moth
#

What

hard kettle
subtle moth
#

That's not what I mean...

#

You should first learn python before making a discord bot

#

You're gonna face lots of basic difficulties like this and it'll make your work harder

subtle moth
#

I think it's this

civic lotus
#

Can you give me an exemple ?

lofty parcel
#

You just get the forum channel and then create the thread.

civic lotus
lofty parcel
#

And provide the traceback

civic lotus
lofty hedge
#

im getting this error

Traceback (most recent call last):
  File "/home/container/bot.py", line 49, in <module>
    class Bot(discord.AutoShardedBot):
AttributeError: module 'discord' has no attribute 'AutoShardedBot'. Did you mean: 'AutoShardedClient'?```
subtle moth
#

Oh wait, I think the error is coming from your host right

#

And not from your local pc I think

lofty hedge
#

it is yeah

#

aiocache==0.12.2
aiohttp==3.8.6
aiomysql==0.2.0
aiosignal==1.3.1
appdirs==1.4.4
async-timeout==4.0.3
attrs==23.2.0
beautifulsoup4==4.12.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
DateTime==5.4
easy-pil==0.3.0
frozendict==2.4.0
frozenlist==1.4.1
gitdb==4.0.11
GitPython==3.1.42
html5lib==1.1
humanize==4.9.0
idna==3.6
loguru==0.7.2
lxml==5.1.0
multidict==6.0.5
multitasking==0.0.11
numpy==1.26.4
pandas==2.2.1
Pillow==9.5.0
psutil==5.9.8
py-cord==2.4.1
pycparser==2.21
pycryptodomex==3.20.0
pygit2==1.14.1
PyMySQL==1.1.0
python-dateutil==2.8.2
python-dotenv==1.0.1
pytz==2024.1
requests==2.31.0
sentry-sdk==1.40.5
six==1.16.0
smmap==5.0.1
soupsieve==2.5
topggpy @ git+https://github.com/top-gg/python-sdk/@c26fed5ef246c51f958a2971adc2e00662f4da53
typing_extensions==4.9.0
tzdata==2024.1
urllib3==2.2.1
webencodings==0.5.1
yarl==1.9.4
yfinance==0.2.25
zope.interface==6.2
``` this is from my vps
#

i also had discord.py so after i un installed that, this is the new error ```py

Traceback (most recent call last):
File "/root/alpha_bot/bot.py", line 11, in <module>
import topgg
File "/root/alpha_bot/venv/lib/python3.10/site-packages/topgg/init.py", line 24, in <module>
from .client import DBLClient
File "/root/alpha_bot/venv/lib/python3.10/site-packages/topgg/client.py", line 36, in <module>
from discord.ext.commands.bot import BotBase
ModuleNotFoundError: No module named 'discord.ext.commands'

subtle moth
lofty hedge
#

nnot all of them i dfont know how all of them got there lol im using a requirement file

subtle moth
lofty hedge
#

will try

subtle moth
whole needle
little cobalt
#

also...

#

?tag requests

limber wagonBOT
#

Why you should not use the requests library for your bot
requests is a popular HTTP library for Python. It is however not a good option for Discord bots, since it is not async and blocking.

This essentially means that your bot will not be able to execute any code at all while a request is happening. Since requests usually take a few seconds to complete, this can have a detrimental effect on your bot's performance. E.g if a user executes a command that performs a request taking 5 seconds to complete, no one else will be able to use your bot for those 5 seconds.

Please look at using a HTTP library that has async support, such as aiohttp or httpx

sage tendon
#

the code is too long so it converts to a txt file automatically

whole needle
#

dont have nitro sad

little cobalt
whole needle
#

why not

whole needle
#

ive had not problems

sage tendon
#

use aiohttp

whole needle
#

still doesnt fix my issue

#

i cant see the showemail option

sage tendon
#

restart your discord so you are getting the latest version of the command, and check your terminal for any errors inside

whole needle
#

thats a string input

little cobalt
little cobalt
sage tendon
#

works fine when i copy your code

#

ignore the command name

#

Also, dont use choices

#

typehint the spuserid argument as bool and it'll work

lapis dock
lofty hedge
#

Ima have to make a minimal bot tomorrow

whole needle
sage tendon
#

and remove the choices

#

also why tf do you ahve pycord installed

lapis dock
sage tendon
#

pycord is not related to py-cord

whole needle
#

oh lol

sage tendon
#

me first

shell radish
#

check the IDs

sage tendon
#

alternatively to typehinting the command argument as bool you can change the option to be @option(name="showemail", bool, description="Do You Want To Show Your Email?")

whole needle
sage tendon
#

spuserid: bool
that is typehinting

shell radish
#

@whole needle try commenting out the command, then running it, uncomment and run it

sage tendon
#

and restart your discord after changing it, or at least ctrl+r

sage tendon
shell radish
sage tendon
#

its not even a python concept its just a programming concept in general

#

yea

whole needle
#

oh typehint mb im trippin 💀

sage tendon
shell radish
sage tendon
#

for what purpose

shell radish
sage tendon
#

just reload your discord lol

#

much faster

shell radish
#

so unregistering and re-registering would fix it

shell radish
sage tendon
#

i never had that happen lol

shell radish
#

i’ve seen that happen quite a lot with students i teach

sage tendon
#

i just edited the same command 3 times in like 20s and it always worked

shell radish
#

¯_(ツ)_/¯

sage tendon
#

whatd you do btw

#

typehint or pass bool as argument to the decorator

whole needle
#

this not working either lmao i reset my discord ive kicked and reinvited the bot and all i get is spuserid

shell radish
whole needle
#

oh like

async def spuserinfo(ctx, blabla

#

@shell radish?

shell radish
#

yes, it should look like the following:

async def spuserinfo(ctx, spuserid: str, showemail: bool):
whole needle
#

then do this?

shell radish
#

it can just be if showemail but yeah

sage tendon
#

long time since i saw == in python lmao

#

nah jk dont overuse is

loud kayak
sage tendon
#

is is weird

loud kayak
#

not really

#

how i learned learned it

sage tendon
#

yes, is is wieird

loud kayak
#

same thing as if x is o

#

which that is similar to actual grammar

uncut swift
#

Hi Pycord people! I am having a hell of a time getting the server nickname for a user that sends a command. I see in the docs that ctx.author.nick is an attribute, but it is always coming up None. Basically, I want to capture the server nickname for a user that executes a command instead of their actual discord username. Also tried ctx.author.display_name, but that is just showing the discord username, too

limber wagonBOT
#

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

shell radish
#

upgrade to master branch

uncut swift
uncut swift
west ether
modern cedar
#

is there any guide where I can make a form like stuff?
Like I want to make a command in my bot where it sends a form and retrieves the information from user

#

and makes predictions using that data

lofty parcel
modern cedar
#

Which the bot will give, like a UI

lofty parcel
#

A modal...

#

Modal dialogs are pop-ups that accept text input.

rugged lodgeBOT
#

Here's the modal dialogs example.

modern cedar
#

when using a the slash command

lofty parcel
#

Yes...

#

That's literally what modals are

modern cedar
#

Like Yes/No

lofty parcel
#

Modals can only receive text input

modern cedar
#

Okk

hard kettle
sage tendon
#

is and == are not interchangeable

little cobalt
frail ocean
little cobalt
frail ocean
little cobalt
frail ocean
lapis dock
hard kettle
civic lotus
# lofty parcel Show your code
@bot.slash_command(name="render", description="render a cape", guild_ids=[ID])
async def render(ctx, cape_url: str, id: str, author: discord.Member):
    if not any(role.name == 'Staff' for role in ctx.author.roles):
        await ctx.respond("> :no: You don't have the required role to use this command.")
        return 
    async with aiohttp.ClientSession() as session:
        await ctx.respond(f"> ⚙ Rendering... ID: {id}", ephemeral=True)
        image_url = f"https://skinrendermc.kiwi.moe/url/image/both?skinUrl={SKIN_URL}&capeUrl={cape_url}&nameTag={PLAYER_NAME}&definition=1.5&transparent=true"
        image_data = await fetch_image(session, image_url)  
        if image_data is None:
            await ctx.send("> :1158039813455351932: I can't find the texture with the link provided.\n:Try using Imgur or something else.")
            return  
        image = Image.open(io.BytesIO(image_data))
        width, height = image.size
        new_height = int(height * 0.8)
        offset_y = int(height * 0.03)
        right_image = image.crop((width // 2, offset_y, width, offset_y + new_height))
        
        buffer = io.BytesIO()
        right_image.save(buffer, format='PNG')
        buffer.seek(0)
        forum_channel = bot.get_channel(1211012472358830132)
        thread = await forum_channel.create_thread(name=f"Cape: {id}", auto_archive_duration=10080)
        await thread.send(f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}", file=discord.File(fp=buffer, filename='right_half.png'))
civic lotus
#

wait i launch

#

Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 174, in render
thread = await forum_channel.create_thread(name=f"Cape: {id}", auto_archive_duration=10080)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1320, in create_thread
data = await state.http.start_forum_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message

lofty parcel
#

Or something for the starter message

civic lotus
#

like?

#

Sorry i am dumb

lofty parcel
#

send content (a string), an embed or something

#

Read the docs

civic lotus
#

I read, but as I said before, I'm stupid

#

And I didn't understand

lofty parcel
#

You pass arguments as if you were sending a message

#

You have to pass arguments for a message. When you create a thread there's a starter message

civic lotus
#

Yes?

lofty parcel
#

Literally use your brain. I'm telling you what to do

civic lotus
lofty parcel
#

If you don't know python basics, that's not my issue.

#

Here we assume you understand python basics and how to read docs.

#

You're literally just missing 1 argument in your method.

civic lotus
#

Oh

#

I think i understand

#

This is easy

#

But @lofty parcel How do I send an image and make it the "thumbnail" of the thread?

#
        await create_thread(name=f"Cape: {id}", content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}", *, embed=None, embeds=None, file=discord.File(fp=buffer, filename='right_half.png'), files=None, stickers=None, delete_message_after=None, nonce=None, allowed_mentions=None, view=None, applied_tags=None, auto_archive_duration=100, slowmode_delay=0, reason=None)

but how do I specify the forum channel? Because there he create it nowhere

civic lotus
#
        forum_channel = bot.get_channel(1211012472358830132)
        await forum_channel.create_thread(
            name=f"Cape: {id}",
            content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
            file=discord.File(fp=buffer, filename='right_half.png'),
            auto_archive_duration=100,
            slowmode_delay=0,
            reason=None
        )
#

File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 174, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1282, in create_thread
data = await state.http.send_files(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

little cobalt
civic lotus
#

ok

#

But why i get this error?

civic lotus
#

Please i am stuck

sage tendon
#

so id double check if that ID is really a text channel

civic lotus
#

Yes

#

And when i type <#id> it sending me to the forum

sage tendon
#

are you sure that is the line in your code the exception comes from? check the line numbers

civic lotus
#

yes

#

here is my code:

@bot.slash_command(name="render", description="render a cape", guild_ids=[ID])
async def render(ctx, cape_url: str, id: str, author: discord.Member):
    if not any(role.name == 'Staff' for role in ctx.author.roles):
        await ctx.respond("> :no: You don't have the required role to use this command.")
        return 
    async with aiohttp.ClientSession() as session:
        await ctx.respond(f"> ⚙ Rendering... ID: {id}", ephemeral=True)
        image_url = f"https://skinrendermc.kiwi.moe/url/image/both?skinUrl={SKIN_URL}&capeUrl={cape_url}&nameTag={PLAYER_NAME}&definition=1.5&transparent=true"
        image_data = await fetch_image(session, image_url)  
        if image_data is None:
            await ctx.send("> :1158039813455351932: I can't find the texture with the link provided.\n:Try using Imgur or something else.")
            return  
        image = Image.open(io.BytesIO(image_data))
        width, height = image.size
        new_height = int(height * 0.8)
        offset_y = int(height * 0.03)
        right_image = image.crop((width // 2, offset_y, width, offset_y + new_height))
        
        buffer = io.BytesIO()
        right_image.save(buffer, format='PNG')
        buffer.seek(0)
        forum_channel = bot.get_guild(1206656710509592617).get_channel(1211012472358830132)
        if forum_channel is not None:
            await forum_channel.create_thread(
            name="Cape: {id}",
            content="> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
            files=[discord.File(fp=buffer, filename='right_half.png')],
            auto_archive_duration=100,
            slowmode_delay=0
        )
        else:
            print("forum_channel not found")

I modified it but it wont work

sage tendon
#

You aren't storing the created thread anywhere so if you are trying to send a message there after the thread creation you have to change that

#

What line is 174

civic lotus
#

if forum_channel is not None:

sage tendon
#

also that can be if forum_channel

sage tendon
civic lotus
#

maybe bc i modified the code

#

here is the new traceback

Ignoring exception in command render:
Traceback (most recent call last):
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
    await self.callback(ctx, **kwargs)
  File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 175, in render
    await forum_channel.create_thread(
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1305, in create_thread
    data = await state.http.send_files(
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel
sage tendon
#

if you print forum_channel, does it output the intended channel

civic lotus
#

let me try

#

Bot is ready.
🔥┃catalog
Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1305, in create_thread
data = await state.http.send_files(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channe

sage tendon
#

also you didn't make your thread strings f strings so your variables wont work

sage tendon
civic lotus
sage tendon
sage tendon
civic lotus
#

oh yes

civic lotus
sage tendon
#

does the bot have permissions to create threads

civic lotus
#

yes

sage tendon
#

then i dont know :/

civic lotus
civic lotus
#

I want to die lol

sage tendon
#

dumb idea but try remove the name= and make it a positional argument

sage tendon
#

just remove the name=

civic lotus
#

but this is the syntax

sage tendon
#

name is a positional argument from what i can see
just try it, if it doesnt work, then shrug

civic lotus
#

like this?

await forum_channel.create_thread(f"Cape: {id}", f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}", [discord.File(fp=buffer, filename='right_half.png')], 100, 0
sage tendon
#

no, just remove name=, nothing else

civic lotus
#
        if forum_channel is not None:
            print(forum_channel)
            await forum_channel.create_thread(
            f"Cape: {id}",
            content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
            files=[discord.File(fp=buffer, filename='right_half.png')],
            auto_archive_duration=100,
            slowmode_delay=0
        )
sage tendon
#

yea

civic lotus
#

no
Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1305, in create_thread
data = await state.http.send_files(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

sage tendon
#

then i dont know

civic lotus
#

:(

sage tendon
#

are you sure its a forum channel and not a regular channel

sage tendon
#

hm

civic lotus
#

hm

sage tendon
#

which py-cord version do you have

#

(desperate btw)

civic lotus
#

2.4.1

sage tendon
#

yea ok i give up for real now

civic lotus
#

It's been 3 hours I have a headache

subtle moth
#

can you show your updated code

civic lotus
#
@bot.slash_command(name="render", description="render a cape", guild_ids=[ID])
async def render(ctx, cape_url: str, id: str, author: discord.Member):
    if not any(role.name == 'Staff' for role in ctx.author.roles):
        await ctx.respond("> :no: You don't have the required role to use this command.")
        return 
    async with aiohttp.ClientSession() as session:
        await ctx.respond(f"> ⚙ Rendering... ID: {id}", ephemeral=True)
        image_url = f"https://skinrendermc.kiwi.moe/url/image/both?skinUrl={SKIN_URL}&capeUrl={cape_url}&nameTag={PLAYER_NAME}&definition=1.5&transparent=true"
        image_data = await fetch_image(session, image_url)  
        if image_data is None:
            await ctx.send("> :1158039813455351932: I can't find the texture with the link provided.\n:Try using Imgur or something else.")
            return  
        image = Image.open(io.BytesIO(image_data))
        width, height = image.size
        new_height = int(height * 0.8)
        offset_y = int(height * 0.03)
        right_image = image.crop((width // 2, offset_y, width, offset_y + new_height))
        
        buffer = io.BytesIO()
        right_image.save(buffer, format='PNG')
        buffer.seek(0)
        forum_channel = bot.get_guild(1206656710509592617).get_channel(1211012472358830132)
        if forum_channel is not None:
            print(forum_channel)
            await forum_channel.create_thread(
            name=f"Cape: {id}",
            content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
            files=[discord.File(fp=buffer, filename='right_half.png')],
            auto_archive_duration=100,
            slowmode_delay=0
        )
        else:
            print("forum_channel not found")
subtle moth
civic lotus
#
Bot is ready.
🔥┃catalog
Ignoring exception in command render:
Traceback (most recent call last):
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
    await self.callback(ctx, **kwargs)
  File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
    await forum_channel.create_thread(
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1305, in create_thread
    data = await state.http.send_files(
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel
subtle moth
#

Can you do print (type(forum_channel)) and show what you get

#

@civic lotus

civic lotus
#

I try

#

Bot is ready.
<class 'discord.channel.ForumChannel'>
Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1305, in create_thread
data = await state.http.send_files(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

#

Truly, I'm cursed

#

@subtle moth

subtle moth
#

hmm

#

@civic lotus try removing the files kwarg and see if it atleast posts the thread

civic lotus
#

kwarg?

#

@subtle moth what is kwarg

#

oh

subtle moth
civic lotus
#

i understand sorry

#

wait

#

Bot is ready.
<class 'discord.channel.ForumChannel'>
Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1320, in create_thread
data = await state.http.start_forum_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In auto_archive_duration: Value "100" is not a valid enum value.

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In auto_archive_duration: Value "100" is not a valid enum value

#

@subtle moth

subtle moth
#

tf

#

can you show your pip freeze

#

do pip freeze in your terminal and show the output

civic lotus
#

Name: py-cord
Version: 2.4.1
Summary: A Python wrapper for the Discord API
Home-page:
Author: Pycord Development
Author-email:
License: MIT
Location: c:\users\litou\appdata\local\programs\python\python310\lib\site-packages
Requires: aiohttp, typing-extensions
Required-by:
i have py-cord

subtle moth
#

ok wait nvm

#

dpy docs explain it well

#

auto_archive_duration (int) –
The duration in minutes before a thread is automatically hidden from the channel list. If not provided, the channel’s default auto archive duration is used.
Must be one of 60, 1440, 4320, or 10080, if provided.

civic lotus
#

oh

subtle moth
#

it should be one of these specified values

civic lotus
#

i am dumb

subtle moth
#

nah pycord docs didnt explain that

#

pycords fault ngl

civic lotus
#

👍

#

BRO

subtle moth
#

cool

#

so it works without the file

civic lotus
#

Now, for the image lol?

little cobalt
#

...

subtle moth
#

means something was wrong with your image the whole time

civic lotus
#

yeah

#

maybe

#

i wrote files with an s

little cobalt
civic lotus
subtle moth
#

💀

little cobalt
#

uninstall all 4

civic lotus
#

no

#

i need discum lol

#

this is for a ||selfbot||

subtle moth
#

discum 💀

civic lotus
little cobalt
#

So you are against the discord TOS and can get banned for it

civic lotus
#

i uninstall, i think i dont need it

little cobalt
#

you have to uninstall all 4 and py-cord and only reinstall py-cord

civic lotus
#

but i need discord to do this
from discord.ext import commands

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

little cobalt
#

@sage tendon that also explains now a lot maybe

sage tendon
#

wow

subtle moth
civic lotus
#

oh okay

little cobalt
sage tendon
lofty parcel
sage tendon
#

crying rn brb

little cobalt
#

and now Dark is also here

subtle moth
#

it was raising httpexception and it was because the file which he was trying to upload was goofy and its a valid reason

#

idk

civic lotus
lofty parcel
civic lotus
subtle moth
#

yeah

#

i forgot about that

#

i just saw httpexception and forgot about the rest

civic lotus
#

i found

sage tendon
civic lotus
#

file (File) – The file to upload.
files (List[File]) – A list of files to upload. Must be a maximum of 10.

sage tendon
#

"Must be a maximum" is such a weird phrasing

subtle moth
civic lotus
#

uh idk

#

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1279, in create_thread
raise InvalidArgument("file parameter must be File")
discord.errors.InvalidArgument: file parameter must be File

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: InvalidArgument: file parameter must be File

subtle moth
#

does it work now?

#

well

civic lotus
#

maybe if i donwload the image

#

bc i use io

sage tendon
#

files are hell in programming

subtle moth
civic lotus
#

with this maybe

@bot.slash_command(name="render", description="render a cape", guild_ids=[ID])
async def render(ctx, cape_url: str, id: str, author: discord.Member):
    if not any(role.name == 'Staff' for role in ctx.author.roles):
        await ctx.respond("> :no: You don't have the required role to use this command.")
        return 
    async with aiohttp.ClientSession() as session:
        await ctx.respond(f"> ⚙ Rendering... ID: {id}", ephemeral=True)
        image_url = f"https://skinrendermc.kiwi.moe/url/image/both?skinUrl={SKIN_URL}&capeUrl={cape_url}&nameTag={PLAYER_NAME}&definition=1.5&transparent=true"
        image_data = await fetch_image(session, image_url)  
        if image_data is None:
            await ctx.send("> :1158039813455351932: I can't find the texture with the link provided.\n:Try using Imgur or something else.")
            return  
        image = Image.open(io.BytesIO(image_data))
        width, height = image.size
        new_height = int(height * 0.8)
        offset_y = int(height * 0.03)
        right_image = image.crop((width // 2, offset_y, width, offset_y + new_height))
        with open('right_half.png', 'wb') as f:
            right_image.save(f, format='PNG')
        with open('right_half.png', 'rb') as f:
            file = discord.File(fp=f, filename='right_half.png')

        forum_channel = bot.get_guild(1206656710509592617).get_channel(1211012472358830132)
        if forum_channel is not None:
            print (type(forum_channel))
            await forum_channel.create_thread(
                name=f"Cape: {id}",
                content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
                file=file,
                auto_archive_duration=1440,
                slowmode_delay=0
            )
        else:
            print("forum_channel not found")
        os.remove('right_half.png')
civic lotus
#

this is what i do

        buffer = io.BytesIO()
        right_image.save(buffer, format='PNG')
        buffer.seek(0)
        forum_channel = bot.get_guild(1206656710509592617).get_channel(1211012472358830132)
        if forum_channel is not None:
            print (type(forum_channel))
            await forum_channel.create_thread(
            name=f"Cape: {id}",
            content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
            file=[discord.File(fp=buffer, filename='right_half.png')],
            auto_archive_duration=1440,
            slowmode_delay=0
        )
#

oh no, not this again
Ignoring exception in command render:
Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\litou\Desktop\GoldenCapes\Bot\bot.py", line 176, in render
await forum_channel.create_thread(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py", line 1282, in create_thread
data = await state.http.send_files(
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 371, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

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

Traceback (most recent call last):
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 375, in invoke
await injected(ctx)
File "C:\Users\litou\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: HTTPException: 400 Bad Request (error code: 50008): Cannot send messages in a non-text channel

#

WHYY

#

I have an idea

#

Dont work :(

#

I'm sick of it

#

I think I'm going to give up

#

@lofty parcel I find this method but how to make the image become the vignette?

        buffer = io.BytesIO()
        right_image.save(buffer, format='PNG')
        buffer.seek(0)
        file = discord.File(fp=buffer, filename='right_half.png')

        forum_channel = bot.get_guild(1206656710509592617).get_channel(1211012472358830132)
        if forum_channel is not None:
            print (type(forum_channel))
            thread = await forum_channel.create_thread(
                name=f"Cape: {id}",
                content=f"> [ ||<@&1208447185117782097>|| ]\n> ID: {id}\n> to set the cape: </set:1208440978768265257>\n> Author: {author.mention}",
                auto_archive_duration=1440,
                slowmode_delay=0
            )
            await thread.send(file=file)
        else:
            print("forum_channel not found")
subtle moth
civic lotus
#

this is not what i want to do

shell radish
#

what is a vignette

civic lotus
#

wait i show you an exemple

#

here and

#

wait

shell radish
#

that’s just a transparent background

civic lotus
#

I dont talk about that

#

the preview if you prefer

#

so how to add the image as the preview?

#

please?

shell radish
#

you send it separate from the embed

civic lotus
shell radish
#

oh you send it as an attachment to the original message

shell radish
#

l was looking at an older version of your code

shell radish
civic lotus
shell radish
#

you can send a link that embeds the image

civic lotus
#

wdym

shell radish
#

a link like https://media.discordapp.net/attachments/1132206148309749830/1211365106101784617/image.png?ex=65edeeab&is=65db79ab&hm=496bdf74221f5f39aae05801d7753a7e9a44cde341e2214aa34936ecafb4b2de&

civic lotus
#

oh

#

so i need to host the files?

shell radish
#

not necessarily

#

you can use discord

civic lotus
deft kestrel
#

How to make the team work through @user_command and @bridge Simultaneously

shell radish
deft kestrel
deft kestrel
subtle moth
#

just import the bridge cog class to your user command cog and use it from there

#

just create an instance of the bridge cog and use the command from there

subtle moth
#

kind of like this

#

but i used slash commands but it should be the same with bridge also ig

deft kestrel
lofty hedge
#

does anyone else use this library here https://github.com/top-gg/python-sdk/ im having a lot of issues with it, ever since the changes was made a week ago its been spittign our errors, ```py
Collecting git+https://github.com/top-gg/python-sdk/ (from -r requirements.txt (line 14))
Cloning https://github.com/top-gg/python-sdk/ to /tmp/pip-req-build-fid7hgk8
Running command git clone --filter=blob:none --quiet https://github.com/top-gg/python-sdk/ /tmp/pip-req-build-fid7hgk8
Resolved https://github.com/top-gg/python-sdk/ to commit 06844706605b2d368d6892933f7f1aae45be5dee
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in topggpy setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Parse error at "'://files'": Expected string_end
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
Traceback (most recent call last):
File "/home/container/bot.py", line 3, in <module>
from src.cogs.economy import setup as setup_economy
File "/home/container/src/cogs/economy.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
container@pterodactyl~ Server marked as offline...```

and i think the whole discord error because i think discord.py is also installed alongside the top.gg library, and im using a requirement file.

GitHub

A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.

subtle moth
#

why not try installing the pypi version instead of the git one

little cobalt
subtle moth
#

oh

frail ocean
#

How can I create a dropdown menu which has all server members in it

shell radish
frail ocean
#

I don’t want a extra class

#

Just saying

subtle moth
frail ocean
#

If u maybe can help me haha

little cobalt
lapis dock
loud kayak
#

In on_message_edit, if the message that was edited isn’t cached, does the event fire? Doesn’t seem to fire if I restart my bot and I edit a message I sent before hand.

lapis dock
#

@lofty hedge @subtle moth I recommend removing that package and making sure the dependencies are gone too, its possibly malware. Last week some person add 4 packages
colorama
base58 - used for formatting things for bitcoin or something
Construct - parser and builder of binary data
DateTime - not the builtin rather a datatype package for communicating with Zope (webserver something) API

After adding the 4 packages they made 19 commits that used the names of other commits and only added/removed spaces like they were trying to cover up their other commit.

lofty parcel
#

But there should me on_raw_message_edit which fires regardless The cache

loud kayak
#

Docs say it’s a payload

lofty parcel
#

Then it doesnt

#

Lolz

hallow copper
#

help

#

i use ljust, it works when i print it, but when i send the same thing in an embed it doesn’t work, i asked lala and she was too tired, i tried making it fill the area in with a letter (to make sure spaces weren’t the problem) and it had the same problem

#

i know a codeblocks would fix it but that doesn’t look as good, please ping me if you have a suggestion

subtle moth
#

Discord strips any extra spaces

hallow copper
subtle moth
hallow copper
#

that would work but that wouldn’t look nearly as good so i think i’d rather deal with this

frail ocean
obsidian stratus
#

How to make a custom status like this?

#

Is this new? Because this bot doesn't have a Playing/Streaming/Watching status

scarlet shale
#

Is there a way to make slash command params look nicer? Right now, discord is showing the internal variable names for each option. For example, this command has 2 string type options that the user can type in. They show as "fromuser" and "aircraftreg" in discord, as those are the names inside my code. However, I want to show a more user-friendly name like "From User" and "Aircraft Registration" instead. I'm looking at documentation for slash commands, and I can't find anything so far on how to do this

little cobalt
scarlet shale
#

damn, was hoping to be able to just make the params look nicer

little cobalt
#

you can use _ - or a space with groups so yea..

scarlet shale
#

Is there a way to limit commands to only being used by people with a specific role? I want to restrict usage of a few commands

#

I'm trying to use @commands.has_permissions() like mentioned in docs, but it's giving an error NameError: name 'commands' is not defined

#

nvm had to add from discord.ext import commands for it to work

little cobalt
#

you would have to use has_role if you want to use roles

scarlet shale
#

yeah that's why I was using it. I found has_role a few min ago after digging through some github commits since it's not documented as far as I can find

little cobalt
#

it is at the py-cord docs

#

;3

frail ocean
#

@little cobaltcan u send me the link again?

little cobalt
frail ocean
little cobalt
#

That will be in like 30 Minutes

lapis dock
lapis dock
hallow copper
lapis dock
frail ocean
#

Is it allowed to have nsfw slas commands listet everywhere? Like /p...gif

little cobalt
frail ocean
#

You know?

little cobalt
#

ye

frail ocean
#

so thats allowed?

little cobalt
#

good question so I gonna say not a yes to it

frail ocean
frail basin
#

you could make a custom paginator which attaches a different dropdown for each page

frail ocean
frail ocean
#

Does someone know if it’s possible to get if a guild has subscribed to a bot

round heart
little cobalt
round heart
#

Oh, I think this is pretty much the same instructions as the tag output

sly karmaBOT
lofty parcel
frail ocean
lofty parcel
# frail ocean and how?

You have to fetch the SKU, then look for the flags to check if its a guild subscription and then ig checking IDs

#

Read the docs

frail ocean
lofty parcel
#

Yes

frail ocean
#

Not with stable?

lofty parcel
#

Your first question and my answer, answer that.

frail ocean
#

Is there in general anything changed?

lapis dock
shell radish
lapis dock
#

Ye but do they respond?

sage tendon
#

lmao

#

i think the only way to get discord's attention AT ALL is to add the word "minor" anywhere in your request

#

i literally have never gotten a proper response to any of my support requests, ever

shell radish
lapis dock
#

Just via support or a special outlet?

shell radish
#

i thought we were just talking about support?

lapis dock
#

Yeah, I just did not know if support answered legal questions or if you had to email them or something. Support does not have the best record of being helpful.

sage tendon
#

lol, nope
I reported the same mod that spams slurs in his server about 10 times now
Nothing ever happened to him
Not even a day ban or something

#

support is pointless to waste your time on

shell radish
#

trust & safety is different from other issues

sage tendon
#

if you dont even take trust and safety seriously then why bother

#

trust and safety is literally dead

#

nothing done by them

shell radish
#

#general

frail ocean
deft kestrel
#

how i can make the bot avatar move? (gif)

little cobalt
deft kestrel
little cobalt
#

Or change it at the Website

outer trout
#

I often got rate limited, for example if my bot sends a few messages behind another. But these rate limits are always under 1 or 2 seconds.
I now coded a part in my bot which renames a few channels iteratively, and after a few channels I get rate limited 5 minutes?!

We are being rate limited. Retrying in 296.14 seconds. Handled under the bucket "1211787820247678996:None:/channels/{channel_id}"

Is this a bug in pycord or does discord have such insane rate limits for renaming channels?

little cobalt
#

They got a ratelimit of 2 every 10 Minutes I think

raven moth
#

how do i add a slash command to a cog?

Should prolly be really easy but i have:

def setup(bot):
    bot.add_cog(origins_mc(bot))

class origins_mc(commands.Cog):

    def __init__(self, bot):
        self.log = logger.file_logger()
        self.log.initialize('origins_mc')
        self.cache = Cache()
        self.bot = bot

    @commands.slash_command(name="command_name", description="Description of the command")
    @commands.has_permissions(administrator=True)
    async def testplease(self, ctx):
        await ctx.send("Command executed!")

But this slash command is not appearing on discord? I manged to get a slash command in my main bot.py file but this wont show up even though it does not give me any errors

sage tendon
#

you have to do /testplease

#

also I'm not that great with cogs but I think the Def setup belongs at the bottom

raven moth
#

in my experience it works both ways

#

but i am aware how to use slash commands. its just that its like the command does not exist

sage tendon
#

did you copy the code over from the working command?

#

and are you loading the cog in bot.py

raven moth
#

i just tried that, but since @bot.slash_command is not an option in the cog im trying to figure out what i am supposed to use instead

#

i used to have commands.Cog for the cogs but if i then do commands.slash_command it doesnt show up, but that does exist i guess? cause otherwise it would error out

sage tendon
#

should work like that

raven moth
#

so im thinking i need to do someting extra when importing a cog with slash commands but i have no idea

sage tendon
#

just make sure you actually load the cog in your main file

lofty parcel
#

Show your main file

sage tendon
#

also class names are pascalcase :>>>

raven moth
raven moth
sage tendon
#

LikeThis

raven moth
#

oh yeh

#

im just kinda coding on 1% brain cause its past midnight for me and i should prolly sleep

#

im just kinda confused by this issue cause it seems so simple

lofty parcel
#

You're supposed to do it before running the bot.

raven moth
#

oh, so just somewhere with the startup code that also connects to the db and stuff?

lofty parcel
#

Yes

#

Also it doesn't look your db is async

raven moth
#

in this file i only use it at boot tho

raven moth
lapis dock
sly karmaBOT
#

Tag not found.