#Basic Pycord Help (Quick Questions Only)

1 messages Β· Page 41 of 1

silent meadow
#

πŸ’€

cobalt tangle
#

Lol

west vault
#

it is :P

cobalt tangle
west vault
#

but yeah, general

glossy sand
#

Any idea why message isn't ephemeral here?

silent meadow
#

talking random shi in here is an offense

young bone
#

You can ask Lala for a ban stare

silent meadow
#

we forgo- gets banned

cobalt tangle
cobalt tangle
glossy sand
#

Yea

silent meadow
#

okay that was the last one

cobalt tangle
glossy sand
#

It's like a normal message that everyone can see for some reason

silent meadow
young bone
#

like a pc

silent meadow
#

ah

silent meadow
young bone
silent meadow
cobalt tangle
west vault
silent meadow
silent meadow
west vault
#

general, now

silent meadow
#

yes.

#

#general

west vault
#

do you defer the response before executing this code part?

#

you can't change the ephemeral state after the first response

errant craneBOT
#

discord/interactions.py line 595

async def defer(self, *, ephemeral: bool = False, invisible: bool = True) -> None:```
west vault
#

dunno wtf that is tbh

#

important is ephemeral

#

oh

#

that's for buttons and selects

cobalt tangle
#

Hm?

west vault
#

instead of just acking the button, it would send a "response" with thinking

#

it isn't important / used for slash commands

cobalt tangle
#

Ok

fervent cradle
#

can some1 help with modals and select menus?

Im trying to get a modal to open when i click one of my selects

cobalt tangle
#

Refer to the docs or guide

errant craneBOT
#

Here's the modal dialogs example.

fervent cradle
errant craneBOT
#

Here's the dropdown example.

west vault
#

read both of the links

cobalt tangle
spare haven
#

Hi! Quick question!

Question:
How can I pass a user as a parameter of a "slash command"?

What I've tried:

  • on the discord -> /mycommand @mention_to_a_user

What I expect:

  • An object as ctx.author where I can get info from like the nickname

What I got:

  • @252222431411245151 (this is a random number but it is really close to what I got in the python code)
full basin
#

.rtfm discord.Option

spare haven
full basin
#

It's discord built-in

#

The library handles it

woeful spindle
#

I’m pretty sure they get oauth info from their web and use that to check

spare haven
glossy sand
#

1)Override the callback function for the button
2) set self.disable = True
3)self.interaction.edit(view=your_view)

winged zephyr
#

why i think wick verfication is sus

#

the code scanning one

full basin
#

This is pycord help. Not "suspect about other bots code"

fervent cradle
#

quickly need help with a close button a ticket bot, i have select menus to open them but when i close it, its just sends the transcript not deleting the channel

full basin
#

Cant help without code

fervent cradle
#

I repeatedly get this error, discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'str' object has no attribute 'Embed' which I've never encountered before, any possible reasons?

full basin
#

Code

fervent cradle
#

slightly long

import discord
from discord.ext import commands
import aiohttp
import json

class Verify(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.config = json.load(open("config.json", "r"))

    @commands.slash_command(
        name="verify",
        description="Allows you to verify yourself using your Minecraft username."
    )
    async def verify(self, ctx, name: discord.Option(str, "In-Game Name", required=True)):

        await ctx.defer()

        async with aiohttp.ClientSession() as session:
            try:
                mojang_api = await(await session.get(f"https://api.mojang.com/users/profiles/minecraft/{name}")).json()
                hypixel_api = await(await session.get(f"https://api.hypixel.net/player?key={self.config.get('hypixelAPIkey')}&uuid={mojang_api['id']}")).json()
            except:
                embed = discord.Embed(
                    title="An error has occured!", description = "", color=discord.Color.RED()
                )
                await ctx.respond(embed=embed)
                return

        if hypixel_api["success"] != True:
            embed = discord.Embed(
                title="An error has occured!", description = f"The reason for this error was:\n`{hypixel_api['cause']}`", color=discord.Color.RED()
            )
        else:
            try:
                discord = hypixel_api["player"]["socialMedia"]["links"]["DISCORD"]
                if discord == (f"{ctx.author.name}#{ctx.author.discriminator}"):
                    embed = discord.Embed(
                        title="You have been verified!", description = f"Your account has now been linked with `{name}`", color=discord.Color.GREEN()
                    )
                else:
                    embed = discord.Embed(
                        title = f"The linked discord is not you!", description = f"The linked discord is `{discord}`", color=discord.Color.RED()
                    )
            except:
                embed = discord.Embed(
                    title = "Unable to find a linked discord", description = "Please make sure you have linked your discord to your Hypixel account.\nIf this error persues, contact staff.", color=discord.Color.RED()
                )

        await ctx.respond(embed=embed)

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

chat wall W

full basin
#

Which line is it erroring on

#

Nvm

fervent cradle
# full basin Cant help without code
    def __init__(self):
        super().__init__(timeout=None)

    @discord.ui.select(
        custom_id="support",
        placeholder="Choose a Ticket option",
        options=[
            discord.SelectOption(
                label="Premium Purchase",
                emoji="πŸ₯‡",
                value="support3"
            )
        ]
    )
    async def callback(self, select, interaction):
        if "support1" in interaction.data['values']:
            if interaction.channel.id == TICKET_CHANNEL:
                guild = bot.get_guild(GUILD_ID)
                for ticket in guild.channels:
                    if str(interaction.user.id) in ticket.name:
                        embed = discord.Embed(title=f"You can only open one Ticket!", description=f"Here is your opened Ticket --> {ticket.mention}", color=0xff0000)
                        await interaction.response.send_message(embed=embed, ephemeral=True)
                        return
                category = bot.get_channel(CATEGORY_ID1)
                ticket_channel = await guild.create_text_channel(f"ticket-{interaction.user.id}", category=category,
                                                                topic=f"Ticket from {interaction.user} \nUser-ID: {interaction.user.id}")

                await ticket_channel.set_permissions(guild.get_role(TEAM_ROLE1), send_messages=True, read_messages=True, add_reactions=False,
                                                    embed_links=True, attach_files=True, read_message_history=True,
                                                    external_emojis=True)
                await ticket_channel.set_permissions(interaction.user, send_messages=True, read_messages=True, add_reactions=False,
                                                    embed_links=True, attach_files=True, read_message_history=True,
                                                    external_emojis=True)
                await ticket_channel.set_permissions(guild.default_role, send_messages=False, read_messages=False, view_channel=False)
                embed = discord.Embed(description=f'Welcome {interaction.user.mention}!\n'
                                                   'Hello, How can we help you?',
                                                color=0xe800ff)
                await ticket_channel.send(embed=embed, view=TicketClose())


                embed = discord.Embed(description=f'πŸ“¬ Ticket was Created! Look here --> {ticket_channel.mention}',
                                        color=0xe800ff)

                await interaction.response.send_message(embed=embed, ephemeral=True)
        return ``` TICKET PART!
full basin
#

You've named some variable discord

fervent cradle
#
    def __init__(self):
        super().__init__(timeout=None)
        
    @discord.ui.button(label='Close Ticket',
                       style=discord.ButtonStyle.red,
                       emoji='⏳',)
    async def button_callback(self, button, interaction):
        if "ticket-" in interaction.channel.name:
            channel - bot.get_channel(LOG_CHANNEL)
            closed = interaction.channel.name
            
            fileName = f"{interaction.channel.name}.txt"
            with open(fileName, "w") as file:
                async for msg in interaction.channel.history(limit=None, oldest_first=True):
                    file.write(f"{msg.author.display_name}: {msg.clean_content}\n")
                    
            embed = discord.Embed(
                description=f'Ticket closes automatically in 5 seconds!',
                color=0xe800ff)
            embed2 = discord.Embed(title="Ticket Closed!", description=f"Ticket-Name: {closed}\n Closed-From: {ctx.author.display_name}\n Transcript: ", color=discord.colour.Color.orange())
        file = discord.File(fileName)
        await channel.send(embed=embed2)
        await asyncio.sleep(1)
        await channel.send(file=file)       
        await interaction.send(embed=embed)
        await asyncio.sleep(5)
        await interaction.channel.delete()``` close
full basin
#

And that overrides the library import

#

You shouldn't name your variables the same as a library's name

fervent cradle
full basin
#

Most likely you're taking too long to respond

#

I literally answered you

full basin
#

The bot...

#

Your code is taking more than 3 seconds to process

full basin
fervent cradle
spare haven
sonic quiver
#

hi, just want to confirm.. is it possible to create aliases for slash_command?
something like this...
@bot.slash_command(guild_ids=[xxxxx], aliases=['cp', 'close', 'end', 'stop'])

full basin
#

Just like that

full basin
wild sequoia
#

hi i have a question

wild sequoia
#

what is wrong in my code?

class MyModal(discord.ui.Modal):
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        self.add_item(discord.ui.InputText(label="Short Input"))
        self.add_item(discord.ui.InputText(label="Long Input", style=discord.InputTextStyle.long))

    @discord.ui.select(
        custom_id="Propozycje",
        placeholder="Jaka propozycje skladasz?",
        options=[
            discord.SelectOption(
                label="Survival 1.19.2",
                emoji="![VestMC_GrassBlock](https://cdn.discordapp.com/emojis/901816446928187433.webp?size=128 "VestMC_GrassBlock")",
                value="Propozycje"
            )
        ]
    )
    async def callback(self, interaction: discord.Interaction):
        if "Propozycje" in interaction.data['values']:

            embed = discord.Embed(title="Modal Results")
            embed.add_field(name="Short Input", value=self.children[0].value)
            embed.add_field(name="Long Input", value=self.children[1].value)
            await interaction.response.send_modal(MyModal(title="esssa"))

    @propozycje.command(description="Send in a channel the panel for opening tickets.")
    @commands.has_permissions(administrator=True)
    async def panel(self, ctx, channel: Option(discord.TextChannel, "gdzie ma byc wyslane"),
        modal = MyModal()
        await ctx.send_modal(modal)
        await ctx.respond(f"Panel sent in {channel.mention}.", ephemeral=True)```
#

error:

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: __init__() missing 1 required keyword-only argument: 'title'```
#

idk why, i add the title

#

but i think not there

sonic quiver
full basin
wild sequoia
#

like this?

full basin
#

no

#

Not how it works

wild sequoia
#

then how?

#

@full basin

proud mason
wild sequoia
#

aa, thanks

fast badger
#

is there anyway to run a function anytime a slash command is ran?
or do i have to add the function into every slash commands code?

proud mason
#

Who tf pinged GUN

wild sequoia
#

im sorry

#
    @discord.ui.select(
        custom_id="Propozycje",
        placeholder="Jaka propozycje skladasz?",
        options=[
            discord.SelectOption(
                label="Survival 1.19.2",
                emoji="![VestMC_GrassBlock](https://cdn.discordapp.com/emojis/901816446928187433.webp?size=128 "VestMC_GrassBlock")",
                value="Propozycje")])
    async def callback(self, interaction: discord.Interaction):
        if "Propozycje" in interaction.data['values']:

            embed = discord.Embed(title="Modal Results")
            embed.add_field(name="Short Input", value=self.children[0].value)
            embed.add_field(name="Long Input", value=self.children[1].value)
            await interaction.response.send_modal(MyModal(title="esssa"))```
#

can this work?

#

Om

proud mason
#

.rtfm on_application_command

proud mason
#

Add a listener for on_application_command_completion

#

And run your function

#

You can also do it by listening for on_application_command. But don't forget to process the app cmds if using that

west vault
woeful spindle
round rivet
west vault
undone falcon
#

This is more about SQLite, but when you do a remove querry like this, does it lock the database in write while searching for a Guild to delete, or it will only lock the database while removing a Guild that it was found ?

round rivet
#

database is only locked for different connections iirc

#

if the entire bot uses the same connection you're fine

undone falcon
undone falcon
#

Should i just use one connection for the hole bot and not open a new connection for each request in the database ( as I do now )

#

I am doing that for all requests

amber shale
#
    @Cog.listener()
    async def on_raw_reaction_add(self, payload: RawReactionActionEvent):
        if (
            payload.message_id != self.role_message_id
            or payload.user_id == self.bot.user.id
        ):
            return
        try:
            role_id = self.emoji_to_role[payload.emoji]
        except KeyError as e:
            print(e)
            return

        guild = self.bot.get_guild(payload.guild_id)
        role = guild.get_role(role_id)
        if role is None or guild is None:
            print(role, guild)
            return print("ok")

        for role in payload.member.roles:
            print(role.name)
            if role.id == 1045132418836865074:
                return

        try:
            print("adding")
            await payload.member.add_roles(role)
        except Exception as e:
            print(e)```
#

cant figure out why this is not working (reaction roles)

#

that print function is running (last fourth line)

round rivet
#

your for role in ... is overriding the value of role

amber shale
#

thanks

fervent cradle
#

Is there a way you can provide extra blank lines between two fields in an embed?

proud mason
#

Try with a single space too

fervent cradle
#

I was thinking of doing that too, although I thought I'd run into an error saying I need to put some value there lol. Oh well, space should work since it's technically a value (I think). I'll try and let you know.

proud mason
#

Or you can put extra new line characters \n\n at the end in the upper field

fervent cradle
#

That didn't work.

#

I already tried \n.

proud mason
#

Follow new line character with a space or smth

fervent cradle
#

(Also tried with a space)

#

It says there's a value required, space isn't accepted as a value apparently.

#

Is bridge Commands are stable and good for production?

limber urchin
#

If it's in the stable version of pycord, it's of course going to be stable

fervent cradle
west quest
#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'AddToQueueButton' object has no attribute 'to_components'

#

Hi can someone tell me why it says that?

limber urchin
#

Not if you don't show any code

west quest
#
import discord
from libs.discord_assets.modals import WaitlistModal


class AddToQueueButton(discord.ui.Button):
    # def __init__(self):
    #     super().__init__(timeout=None)

    @discord.ui.button(label="Enter Waitlist", style=discord.ButtonStyle.green, emoji="βž•")
    async def button_callback(self, button, interaction):
        await interaction.response.send_modal(WaitlistModal(title="Enter your email/username:"))
limber urchin
#

Why is the super init commented out?

west quest
#
import discord


class WaitlistModal(discord.ui.Modal):
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        self.add_item(discord.ui.InputText(label="Enter your e-Mail:"))

    async def callback(self, interaction: discord.Interaction):
        await interaction.response.send_message(content=f"Successfully added **{self.children[0].value}** to the waitlist.")```
west quest
limber urchin
#

Well your button obviously won't work if you don't initialize the superclass..

west quest
#

oh

#

ok im stupid

#

i forgot how super init works πŸ˜‚

#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'AddToQueueButton' object has no attribute 'to_components'

#

but it still does say it

#

AttributeError: 'AddToQueueButton' object has no attribute 'to_components'

#

doesnt make sense

#

might be cuz of file name

#

doesnt matter

#

im stupid i forgot to use discord.ui.view

proud mason
#

That should always work

fervent cradle
#

Well yeah, I found something alternative.

#

In any case, I appreciate it.

median ridge
#

It tells me I can't have autocomplete with a list bigger than 25, any fixes for that?

wild sequoia
#

how can i send a modal to a specific channel?

#

okey

#

i got this

#

thanks

full basin
#

So there's no fix

wild sequoia
#

why i have in a modal a error, but all work?

#
        embed = discord.Embed(description=f"Wiadomosć: {self.children[0].value}", color=0x428af5)
        embed.set_author(name=interaction.user.display_name, url=f"https://discord.com/users/{interaction.user.id}", icon_url=interaction.user.display_avatar)
        db = sqlite3.connect('main.db')
        cursor = db.cursor()
        cursor.execute(f"SELECT channel_id FROM propozycje WHERE guild_id = {interaction.guild.id}")
        result =  cursor.fetchone()
        channel = interaction.client.get_channel(result[0])
        msg = await channel.send(embeds=[embed])
        await msg.add_reaction("![901400927846662164](https://cdn.discordapp.com/emojis/979001580944760912.webp?size=128 "901400927846662164")")
        await msg.add_reaction("![901400887828836372](https://cdn.discordapp.com/emojis/979001580831514694.webp?size=128 "901400887828836372")")
        await msg.add_reaction("![901400847488004107](https://cdn.discordapp.com/emojis/979001580907020328.webp?size=128 "901400847488004107")")
        await msg.create_thread(name="Komentarz", auto_archive_duration=60)```
full basin
#

Because you never responded to the interaction

wild sequoia
#

a

limber urchin
#

get_member only works if the member is cached, use fetch_member instead

#

fetch_member is a coroutine

#

Yeah, reading the error helps

amber shale
#

so if i am correct

#

i can have unlimited guild commands?

limber urchin
#

It literally says right there

amber shale
limber urchin
#

yes?

#

guild commands are per guild

amber shale
#

like i can have 100 commands in one guild and 100 in another

limber urchin
#

yes

amber shale
#

ok

fervent cradle
#

I'm migrating discord-pyv2.0 to pycord latest version i have over 200 cmds which using hybrid_commands and those are in a cogs so should bridge Commands support cogs? Any example? And can i create bridge cmd using AutoShardedBot ??

fervent cradle
limber urchin
#

Just like you use anything else in a cog

fervent cradle
#

Also what about sharding ??

limber urchin
#

use AutoShardedBot

fervent cradle
limber urchin
#

yes?

fervent cradle
#

There is mentioned that bridge is a extension of pycord

#

And if i create Bridge Bot then i can able to create bridge cmd

#

Or i can include directly bridge cmd ??

limber urchin
#

what?

#

You need to use the bridge extension to make bridge commands, obviously

fervent cradle
#

is bridge have AutoShardedBot?? Its own class

limber urchin
#

Using AutoShardedBot

#

Read the docs

amber shale
#

why did you send a friend request?

fervent cradle
amber shale
#

np

fervent cradle
#

I seen your name it's Indian so i see your profile that's why

amber shale
#

yeah i am πŸ˜…

fervent cradle
#

Iirc ??

limber urchin
fervent cradle
limber urchin
#

And read #help-rules

fervent cradle
#

Thnx

median ridge
# full basin Well its not broken

It is broken

Traceback (most recent call last):
  File "/home/einar/.local/lib/python3.10/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
  File "/home/einar/.local/lib/python3.10/site-packages/discord/bot.py", line 1045, in on_interaction
    await self.process_application_commands(interaction)
  File "/home/einar/.local/lib/python3.10/site-packages/discord/bot.py", line 726, in process_application_commands
    await self.sync_commands()
  File "/home/einar/.local/lib/python3.10/site-packages/discord/bot.py", line 629, in sync_commands
    registered_commands = await self.register_commands(
  File "/home/einar/.local/lib/python3.10/site-packages/discord/bot.py", line 529, in register_commands
    registered = await register("bulk", data, _log=False)
  File "/home/einar/.local/lib/python3.10/site-packages/discord/http.py", line 359, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 1.options.0.choices: Must be 25 or fewer in length.
In 9.options.0.choices: Must be 25 or fewer in length.
In 10.options.0.choices: Must be 25 or fewer in length.
limber urchin
#

The error tells you exactly what's wrong

median ridge
#

Yeah it's too long...

limber urchin
#

So it isn't broken

median ridge
#

I'm aware of that, I want it bigger. How do I make it bigger?

limber urchin
#

You can't

median ridge
#

Alright

full basin
#

So you say its broken because it doesn't work the way you want it to

loud holly
#

It says Must be reading the error message would show that you obv can't do it

median ridge
median ridge
#

Then you used the word broken and I used it as well so it might be more understandable for ya

loud holly
#

There's a limit

median ridge
median ridge
loud holly
median ridge
# loud holly πŸ’€ what logic is that...

The error messages are made by people, it tells you what the error is and why it isn't possible and possibly what you've done wrong.
Sometimes the error message might trigger even though there's no error and similar odd case scenarios where they aren't accurate.

#

That's the logic mate

full basin
#

Tf

limber urchin
#

That is not at all how error messages work

full basin
#

Its literally a Discord limitation. The library works with discords limitations

median ridge
loud holly
#

My soul is crying

median ridge
#

I don't know

#

That's why I asked

limber urchin
#

Library devs don't just give you an error for fun sometimes

full basin
median ridge
limber urchin
median ridge
#

That's bold

#

Could've been idk Β―_(ツ)_/Β―

loud holly
limber urchin
#

If you didn't have more than 25 options and it still gave you the error, then yes, that would've been a bug. But in this case it's very clear that you are using too many options

median ridge
loud holly
#

There's limitations that you must abide by

median ridge
#

Dude I understand that why y'all keep saying it to me

#

I just wondered and y'all be attacking me

full basin
#

Because you want to bypass it at all costs

median ridge
#

I wondered if there was a way to have more, a bypass or something liek that

full basin
#

I mean. It looks like you want to bypass it at all costs because you kept insisting on it.

full basin
#

It was literally "this is broken it doesn't let me have more than 25 options. Can I bypass it? This is broken. Let me bypass it. There could be a bypass or workaround because this is "broken" there must be a fix"

median ridge
median ridge
#

I said I want it bigger, never said "Can I bypass it This is broken. Let me bypass it"

loud holly
median ridge
median ridge
full basin
#

If you ask how, you want to

median ridge
#

If you're going to quote me @full basin do it properly without changing the words and context

full basin
#

You don't ask just to know

median ridge
median ridge
#

Dude y'all gotta read your own messages

loud holly
limber urchin
#

This is a useless argument

#

It's obviously not leading anywhere

median ridge
#

I'm done with this shit, so just stop telling me how I as in ME meant something. You can't put different meanings into someone else's words.

#

fr

silver moat
#

Basic Help (Quick questions only)

fervent cradle
#

Hi there, I wanted to know how slash commands work (the whole path to sort of your bot receiving the request to the API processing it, and finally you getting the desired response from the bot).

I've noticed some bots respond faster to slash commands than others. What does that actually depend on?

limber urchin
#

And the response time of a command typically depends on your latency between Discord's servers and your bot's server

#

Which is mostly dependant on network speed and the location of your server

#

The best location (from what I've seen) is anywhere in US West or US Central

#

And the speed of the command execution itself is also a factor, of course. If you're doing a bunch of heavy operations or network requests in your command, it's obviously going to take longer.

silver moat
#

Discord’s servers are in Virginia

fervent cradle
limber urchin
#

I mean, not entirely. Prefix commands is just your bot reading messages and executing code if the message contains a specific string. Slash commands are a lot more user friendly, and work differently as well since they need to be registered through Discord's API.

#

But if you're talking speed, there isn't going to be a difference

silver moat
#

slash commands rely on Interactions dispatched by Discord while Prefixed are just bots sending messages in response to users.

#

Also using slash commands should theoritically have no problem with ratelimits, while prefixed do run into the ratelimit issue.

fervent cradle
#

Ah, that makes much more sense than what I thought. Thank you for the information, I genuinely appreciate it.

worn void
rare ice
#

Not like prefix commands

silver moat
worthy juniper
#
        class MyView(discord.ui.View):
            def __init__(self):
                super().__init__(timeout=None) # timeout of the view must be set to None
            @discord.ui.select(
                placeholder="Czego dotyczy propozycja?",
                min_values=0,
                max_values=1,
                options=[
                    discord.SelectOption(
                        label="Serwer(dc)", description="ZΕ‚Γ³z propozycje dotyczΔ…ce Naszego Discorda!", emoji=":NearMC_logo:"
                    ),
                    discord.SelectOption(
                        label="Survival 1.19.2", description="ZΕ‚Γ³z propozycje dotyczΔ…ce Survivala!", emoji=":VestMC_GrassBlock:"
                    ),
                ],
            )```
#

why it dont work?

limber urchin
#

"dont work" is useless

#

give some errors or explain how it doesn't work

silver moat
#

.tag idw

winter condorBOT
#

Saying it doesn't work or asking what's wrong with this code is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

worthy juniper
limber urchin
#

Then explain how it doesn't work

worthy juniper
silver moat
#

or what doesn't work. What is your code doing and what is it supposed to do.

silver moat
worthy juniper
#

a wait

#

The app is not responding

silver moat
#

have you checked examples on how select menus are supposed to work?

errant craneBOT
#

Here's the dropdown example.

orchid grotto
#

Why my bot not have the messages contents?

silver moat
#

?tag message-content

obtuse juncoBOT
#

As of Pycord Beta 5, Discord API v10 requires message content intent to receive message content. This affects the traditional commands. Not enabling this intent will result in the messages' content, embeds, and components being empty.

You will need to enable the intent on the developer portal, as well as in your code:

intents = discord.Intents.default()
intents.message_content = True
bot = discord.Bot(intents=intents)

Docs: https://docs.pycord.dev/en/master/api.html#discord.Intents.message_content

orchid grotto
#

But it's already activated

silver moat
#

show code

orchid grotto
#

I set them all to have an idea of ​​which ones have

#

I need the messages contents for a event

silver moat
#

If the messages intent is false, you will not receive any messages

orchid grotto
#

Ahh

#

But i need only guilds

#

And have a intent for this

#

Don`t work

silver moat
#

How is the client class used.

orchid grotto
#

To declare tidier

silver moat
#

I don't know what that means

orchid grotto
#

In 2.0.0 was work

#

I start the bot in a different way so I need it to look like this

#

I'll try the traditional way

#

Agin don`t work

molten kindle
#

Is there a version of discordpy that has the Bot Argument when running the bot?

limber urchin
#

This isn't discordpy

silver moat
silver moat
orchid grotto
#

@silver moat No have content message of members but have the message content of self

limber urchin
#

what

molten kindle
#

I just noticed that

#

discord rejects requests to their api whenever I use a user token

#

but for bots everything works fine

limber urchin
#

Using a user token is against ToS and will get you banned

#

@round rivet

orchid grotto
#

My bot doesn't have the centeude of messages from users only from itself

young bone
molten kindle
#

ok

young bone
round rivet
#

@kindred sail

molten kindle
#

ya

limber urchin
orchid grotto
#

It's already

limber urchin
#

In the developer portal?

orchid grotto
#

Too

limber urchin
#

And your casing on the parameter in your super init is wrong

#

it's not supposed to be capital i on intents=

orchid grotto
#

Now not even the intents it recognizes

limber urchin
#

?

orchid grotto
silver moat
#

what is the "problem" shown by your IDE

orchid grotto
#

This is the problem

#

Don`t shown nothing

silver moat
#

there is a light bulb. what does it say

orchid grotto
#

Ways to change the code

#

I ordered to print the contents of the messages in the console but it prints empty

silver moat
#

on the bottom of your IDE, do you see something like this? Can you click it and show me what pops up?

orchid grotto
#

Not have error in the code

orchid grotto
silver moat
#

What is your current code?

orchid grotto
#

It's only in this bot in this version, because I have another one that is working

silver moat
#

I'm trying to find out what's wrong with your code. :)

orchid grotto
#

Can I send a github link here?

silver moat
#

yes

orchid grotto
#

I'm uploading the latest code

silver moat
#

just ping me after you sent it.

orchid grotto
#

I'm Brazilian and some folders are in Portuguese

#

@silver moat

silver moat
errant craneBOT
#

utils/loader.py line 20

Intents = intents,```
limber urchin
#

bruh, that's literally what I said

silver moat
#

and apparently they didn't change it

#

yay

limber urchin
#

nice

orchid grotto
#

If I leave it with a lowercase "i" it doesn't even recognize the intents

silver moat
#

it will

orchid grotto
silver moat
#

I don't know what error you are experiencing until you show me

orchid grotto
#

I already told you, it doesn't show the content of the deleted message

#

Only when it's from the bot itself

silver moat
#

you still didn't turn on message intent

orchid grotto
#

I'll turn it on and the same thing will happen

silver moat
#

and you didn't construct intents correctly

#

?tag intents

obtuse juncoBOT
#

https://docs.pycord.dev/en/master/intents.html
https://discord.com/developers/docs/topics/gateway#gateway-intents

import discord
from discord.ext import commands

# Get specific intents for fine control
intents = discord.Intents()
intents.emojis = True
intents.guilds = True
intents.messages = True  # Required for prefix commands!
...
# Get all non-priveliged intents; this excludes presences, members and message_content 
intents = discord.Intents.default()

# Set priveliged intents: these must be enabled on dev portal
intents.members = True
intents.presences = True
intents.message_content = True  # Required for prefix commands >= 2.0.0b5

# Get all intents; all intents must be enabled on dev portal.
intents = discord.Intents.all()

# Apply intents when creating your bot
bot = commands.bot(prefix="?", intents=intents)
Discord Developer Portal

Integrate your service with Discord β€” whether it's a bot or a game or whatever your wildest imagination can come up with.

silver moat
#

It should look like:

intents = discord.Intents(
        bans = True,
        guild = True,
        ....
)
``` when you are importing them
orchid grotto
#

I fixed it, the "commands.Bot" is broken

#

I needed to use "from discord import Bot"

#

@silver moat

young bone
silver moat
#

Could you type pip list in terminal and send output.

silver moat
orchid grotto
#

???

silver moat
orchid grotto
#

I have done

young bone
#

@orchid grotto do you know basic python?

orchid grotto
young bone
silver moat
#

yes

#

what Zervyrel said

orchid grotto
#

I've fixed it, you don't have to try to help me anymore

silver moat
#

ok have a good day.

orchid grotto
orchid grotto
limber urchin
#

The way you claim to have "fixed" it is not an issue with PyCord, which means you probably have conflicting libraries or some other issue

atomic wolf
#

How I make it show all the options of an command option? Like this:

errant craneBOT
#

Here's the slash options example.

spare haven
#

Hey! I'm just trying the commands feature on Pycord/Discord and I found that commands that I deleted from my bot can still be executed... How is that possible?

spare haven
#

Is there a way to clean the cache?

silver moat
#

refresh your discord client

spare haven
#

oh so it's on my side

#

Just tried

#

Didn't work

silver moat
#

hmm ig discord api is being stupid again

#

try running an empty bot

#

which should de-register everything

#

and then try running your normal bot

spare haven
#

Just tried... Didn't work either

#

Maybe I should just create a new bot(application)...?

young bone
spare haven
#

So just one question, how do you test your bots?

silver moat
#

hmm. did you refresh your discord client again?

#

do the commands work

spare haven
#

yes that is the problem

#

that they are working hahaha

#

they shouldn't be working... I even deleted the pycache just to be sure

silver moat
#

maybe reset your token

spare haven
#

That was the key

#

Thank you @silver moat !!!

silver moat
#

yw

spare haven
#

such a useful squid

#

:3

silver moat
#

k

sonic quiver
#

hi, I'm trying to call the values defined on a separate file for @commands.has_any_role() but I can't seem to work?

this one works...
@commands.has_any_role('admin', 1234, 5678)

but not:

roles = ['admin', 1234, 5678]
...
@commands.has_any_role(roles)```

is there a way to achieve this?
dapper flare
#

hey this does not give any error also does not work can anyone help me out?

@client.event
async def on_message(message):
    for x in c.staff_roles_name:
        print(x)
        if f"@{x}" in message.content:
            await message.channel.send('You mentioned me!')```
fringe socket
proud mason
#

Send all relevant code

dapper flare
#

it has the role names in a list

proud mason
#

Hmm

#

Print outside the loop

dapper flare
#
@client.event
async def on_message(message):
    if f"@aa" in message.content:
        await message.channel.send('You mentioned me!')```
proud mason
#

And see if the event is even fired

dapper flare
#

tried this aswell

#

does not work and no error

proud mason
#

So the event is not fired

dapper flare
#

prolly

proud mason
#

Hmm

#

?tag intents

obtuse juncoBOT
#

https://docs.pycord.dev/en/master/intents.html
https://discord.com/developers/docs/topics/gateway#gateway-intents

import discord
from discord.ext import commands

# Get specific intents for fine control
intents = discord.Intents()
intents.emojis = True
intents.guilds = True
intents.messages = True  # Required for prefix commands!
...
# Get all non-priveliged intents; this excludes presences, members and message_content 
intents = discord.Intents.default()

# Set priveliged intents: these must be enabled on dev portal
intents.members = True
intents.presences = True
intents.message_content = True  # Required for prefix commands >= 2.0.0b5

# Get all intents; all intents must be enabled on dev portal.
intents = discord.Intents.all()

# Apply intents when creating your bot
bot = commands.bot(prefix="?", intents=intents)
Discord Developer Portal

Integrate your service with Discord β€” whether it's a bot or a game or whatever your wildest imagination can come up with.

proud mason
#

You sure you got the required intents?

dapper flare
#

im not too familer with intents but i got

intents.members = True
intents.message_content = True```
proud mason
#

Try with Intents.all()

dapper flare
#

ok

dapper flare
#

that i need to figure out, i tried with just aa and worked

proud mason
#

Try with the angled braces

dapper flare
#

ok

frail matrix
#

Trying to make a bot that can add roles through a dropdown menu, but I'm getting 403 Forbidden (error code: 50013): Missing Permissions. Is this an intents problem or something else?

sonic quiver
proud mason
proud mason
#

Do you have the app cmds scope

frail matrix
#

I'll try that

proud mason
#

In all the guilds your bot is

frail matrix
#

Still getting the same error unfortunately.

proud mason
frail matrix
#

Nope, I did not. And now it works. Thank you!

dapper flare
#
AttributeError: 'NoneType' object has no attribute 'guild_permissions'```
Getting this error

```py
@client.event
async def on_message(message):
    idd = str(message).split("<")[0].split(">")[0].split("@")
    user = client.get_user(idd[0])
    if user.guild_permissions.manage_messages:
        for x in c.staff_roles_id:
            print(x)
            f = str(f'<@&{x}>')
            g = str(message.content)
            print(f'f: {f}, g: {g}')
            if f in g:
                em = discord.Embed(description=c.staff_ping_msg, color=discord.Colour.red(), timestamp=message.created_at)
                await message.channel.send(message.author.mention, embed=em)```
#

i need to check if the user has manage_messages perms

fluid tusk
#

im getting this error

AttributeError: 'method' object has no attribute '__discord_ui_model_type__'```
when doing this
```py
if "apple" in usable:
            self.apple = discord.ui.button(label="Apple", style=discord.ButtonStyle.green)(self.apple)```
limber urchin
#

Why are you trying to call the button class?

limber urchin
sick quest
#

is there a way to make a message command that only works on specific users' messages?

#

as in, only shows up on their messages, not just checking who sent the message and sending an error if it's the wrong person

dapper flare
# limber urchin use `fetch_user` instead, get_user only works if the user is cached

getting this now if user.guild_permissions.manage_messages: AttributeError: 'User' object has no attribute 'guild_permissions'

@client.event
async def on_message(message):
    idd = str(message.content).removeprefix("<@").removesuffix(">")
    print(message.content)
    print(idd)
    user = await client.fetch_user(idd)
    if user.guild_permissions.manage_messages:
        for x in c.staff_roles_id:
            print(x)
            f = str(f'<@&{x}>')
            g = str(message.content)
            print(f'f: {f}, g: {g}')
            if f in g:
                em = discord.Embed(description=c.staff_ping_msg, color=discord.Colour.red(), timestamp=message.created_at)
                await message.channel.send(message.author.mention, embed=em)```
proud mason
proud mason
dapper flare
proud mason
#

See that

dapper flare
# proud mason https://github.com/Pycord-Development/pycord/tree/master/examples/views/persiste...
AttributeError: 'Interaction' object has no attribute 'send_message'```

getting this error, also is this the right way to sned ephemeral in interaction? 

```py
@client.slash_command(name='faq')
async def prepare(ctx: commands.Context):
    view = View()
    select = Select(
        placeholder='Select faq to get more info!',
        options=[
        discord.SelectOption(label='test', emoji=':CH_Heart:')]) 
    async def callback(interaction: discord.Interaction):
        await interaction.response.defer()
        test_embed = discord.Embed(
            description=f'skmaskmascm',
            colour=discord.Colour.blue()
        )
        if select.values[0] == 'test':
            await interaction.send_message(embed=test_embed, ephemeral=True)
    view.add_item(select)
    select.callback = callback
    normal_embed = discord.Embed(
        description='normal msg here',
        colour=discord.Colour.blue()
    )
    await ctx.respond(embed=normal_embed, view=view)```
fossil mulch
#

Hi guys, somehow i cant get an task loop to work

    @tasks.loop(seconds=5)
    async def work(self):
        print("klappt")

i tried a few things already like

self.work.start() -> in __init__() of the cog
work.start() -> somewhere in the cog
nothing at all, like in the first example https://guide.pycord.dev/extensions/tasks

This is just an poc, because i want to run a different function, but i cant even get this to work - what am i missing?

west vault
#

it tells you. learn to read error messages

fringe socket
#

I have a quick question.

How can you shard a bridge bot?

tough grove
#

Hey, how do we get default discord profile picture of an user because when user has a default discord generated profile picture we get NoneType

#

this ^

west vault
#

.rtfm default_avatar

fossil mulch
#

^member.display_avatar

fossil mulch
winged zephyr
#

whats the diffrence in client n bot

young bone
obtuse juncoBOT
#
discord.Client # just for events
discord.Bot # events + slash/user/msg commands
commands.Bot # above + prefixed commands
tiny hearth
#

any ideas what might be the problem?

already tried removing the reason="..." part but got the same error

west vault
#

seems like a lib bug

tiny hearth
#

great

west vault
tiny hearth
#

πŸ‘

fringe socket
#

Make a new thread in forum

#

Also

#

?tag codeblock

obtuse juncoBOT
#

Please put your code in a code block:
```py
Here is your Code
```

That makes reading code in Discord a lot easier:

print("This is an example.")
west flume
#
Ignoring exception in on_ready
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 743, in _load_from_module_spec
    setup(self)
  File "/home/container/.local/lib/python3.9/site-packages/jishaku/cog.py", line 70, in setup
    bot.add_cog(Jishaku(bot=bot))  # type: ignore[reportUnusedCoroutine]
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 616, in add_cog
    cog = cog._inject(self)
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 527, in _inject
    raise e
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 521, in _inject
    bot.add_command(command)
AttributeError: 'Bot' object has no attribute 'add_command'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/main.py", line 15, in on_ready
    bot.load_extension('jishaku')
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 867, in load_extension
    self._load_from_module_spec(spec, name)
  File "/home/container/.local/lib/python3.9/site-packages/discord/cog.py", line 748, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'jishaku' raised an error: AttributeError: 'Bot' object has no attribute 'add_command'```
#

uhm can someone explain this? I just trying to install https://github.com/Gorialis/jishaku

solemn spire
#

isnt thiss a question for a separate thread?

west vault
#

Basic Pycord Help

fringe socket
#

Ah and @west vault maybe put (Quick questions only) at the end like it said before

west vault
#

Or I just delete this thread. Gosh this is so annoying

rare ice
fervent cradle
#

Hello. I am quite new to Python and Pycord. I am trying to create a command and as part of this command, the bot will need to add two roles. The code I am using is as follows.

await ctx.author.add_roles(1051226883099984002, 1051229654792536096)

However when running the command, it is proving me with the following error.
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'int' object has no attribute 'id'

Full Error:
https://pastebin.com/8gX5uKj4

Help would be apricated.

errant craneBOT
silver moat
#

also please do not cross-post and stay in your thread

young bone
fervent cradle
fervent cradle
fossil mulch
silver moat
#

author.avatar.url

proud mason
limber urchin
#

How are we supposed to know? You're not showing how you define it

spare haven
#

Hi! Quick question:

Is it possible to build a Mention out of a User Id?

E.G: I have a user called Foo#2341, so I store that in my database as a String. How can I get mention Foo in a message?

limber urchin
#

Yes
<@userid> is their mention

spare haven
#

I thought it was more complicated haha

#

But! "Foo#2341" is the user id?

limber urchin
#

No, that is not a user id

#

That is their name + discriminator

spare haven
#

And can I get the UserId from the name+discriminator?

limber urchin
#

Is there a reason you can't just store their ID as well?

spare haven
#

Not at all haha if that's they way then perfect

#

Is there a way to get the discrimator out of the User Id?

spare haven
#

That's... perfect thxblob

limber urchin
#

get_user gets a user directly from the bot's cache, fetch_user gets it from Discord's API, so best practice is to always try get_user first, if that returns None, use fetch_user

silver moat
#

.rtfm get_or_fetch

spare haven
#

Hey! Stupid question incoming. I've recently discovered the amazing Options documentation for slash commands... Is there a way to set up dynamic options as an argument of a slash command?

limber urchin
#

What do you mean by "dynamic" options?

granite crypt
#

I'm having a big headache here.
Trying to figure cogs but the moment i change anything in the sample code, it just stops working and the slash commands stop showing up.

Figured it out

spare haven
limber urchin
eternal wing
#

Is it possible to set just a custom status without the playing/watching? just the text

eternal wing
#

Ok thanks

limber urchin
#

Don't use time.sleep, and don't use requests. These will both block the event loop and your bot won't be able to execute any other commands while it's waiting

silver moat
#

time.sleep can be replaced with asyncio.sleep

fervent cradle
#

how come i cant install it sm

silver moat
fervent cradle
#

oh awesome

fervent cradle
silver moat
#

should be pip3

fervent cradle
#

ah

fervent cradle
limber urchin
#

Show the output of python3 --version and pip3 --version

fervent cradle
#

yo wtf

limber urchin
#

Try python3 -m pip instead of pip3. Your pip installation seems to be broken

#

Or google the error you're getting to see if there's an easy fix πŸ€·β€β™‚οΈ

fervent cradle
#

python3 -m pip throws the same error

#

i have 0 idea what im meant to do icl

#

google is not very helpful either

#

it seems like a python3.11 issue

limber urchin
#

aiohttp or httpx

#

??

#

why would it be?

full basin
#

Well, have you printed the response or read the docs?...

short hearth
#

await ctx.response("test", file=discord.File("tel.png"))

#

'InteractionResponse' object is not callable

#

it is impossible to send photos?

full basin
short hearth
#

yea cuz it's slash command

#

with ctx.send it would look like this

full basin
#

The method is respond

short hearth
#

oh shit i rly need sleep XDD

#

thx

clever lark
#

is there any way to prevent my bot from being shut down using control c? ive tried

try:
    bot.run(TOKEN)
except KeyboardInterrupt:
    print(e)

but the except never gets called

limber urchin
#

Why would you want to prevent that?

clever lark
#

its not exactly that i want to completely prevent it, i just want to make sure everything is saved to the database before exit

limber urchin
#

If you're subclassing, you can just override the close method.

class MyBot(discord.Client):
  # ...
  async def close(self):
    # shutdown logic here
    await super().close() 
#

Just don't forget to call the super.close

fringe socket
silver moat
#

Basic Pycord Help (Quick questions only)

fringe socket
#

Can we just not change the thread name anymore after this?

silver moat
#

Basic Pycord Help (Quick Questions Only)

fringe socket
#

ok that change is ok

limber urchin
#

I don't really see a point in changing it at all, it's not like people are going to read the name anyways. Just like no one reads #help-rules, or #rules, or #how-to-get-help

fringe socket
#

Yay! Consistent capitalization!

fervent cradle
#

Is it possible to create different cooldown times for different servers using commands.cooldown, or do I need to create my own cooldown system?

errant craneBOT
#

Here's the cooldown example.

fervent cradle
#

Tysm LoveU

eternal wing
#

I had my first bot coded with all commands in the main file, later i saw how a friend of mine who coded with discord.js had every command in a different file and just called it from the main. I wanted to ask what is a better way to approach coding for a new bot, how would that work with python?

simple canopy
#

There is feature named β€œcogs”, that basically does what you said

#

You can split cogs in separate files or have them all in one

steep bloom
#

Sorry if this question doesn't belong here, id imagine this is a basic enough question where it's not really specific,

However... I can't seem to understand why this presents an ERROR : "UnboundLocalError: local variable 'x' referenced before assignment"

This does not happen in any other programming language that I have used, but it seems Python is unable to handle this ?

steep bloom
# silver moat global x

Thank you, I found a different solution as my application for this was for a class "self.x"

silver moat
#

ok

winged zephyr
#

why dis?

grizzled sentinel
# winged zephyr why dis?

https://stackoverflow.com/questions/64473926/discord-py-oserror-winerror-121-the-semaphore-timeout-period-has-expired
Check this to see if it solves your issue. Is this a one time error or does it constantly happen?

winged zephyr
grizzled sentinel
#

Overall I dont think it is a pycord issue but rather something with permissions or how something is set up on your PC

eternal wing
young bone
#

is_owner()

#

oh wait

#

you could check if the user is admin

astral mist
#

hello i am looking for help async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
^^^^^^^^^^^^^^

thats my error

#

heres my code

young bone
#

?tag codeblock

obtuse juncoBOT
#

Please put your code in a code block:
```py
Here is your Code
```

That makes reading code in Discord a lot easier:

print("This is an example.")
astral mist
#

thanks

astral mist
# astral mist hello i am looking for help async def timeout(ctx, member: Option(discord.Memb...
@bot.slash_command(guild_ids = servers, name = 'timeout', description = "mutes/timeouts a member")
@commands.has_permissions(moderate_members = True)
async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
    if member.id == ctx.author.id:
        await ctx.respond("You can't timeout yourself!")
        return
    if member.guild_permissions.moderate_members:
        await ctx.respond("You can't do this, this person is a moderator!")
        return
    duration = timedelta(days = days, hours = hours, minutes = minutes, seconds = seconds)
    if duration >= timedelta(days = 28): #added to check if time exceeds 28 days
        await ctx.respond("I can't mute someone for more than 28 days!", ephemeral = True) #responds, but only the author can see the response
        return
    if reason == None:
        await member.timeout_for(duration)
        await ctx.respond(f"<@{member.id}> has been timed out for {days} days, {hours} hours, {minutes} minutes, and {seconds} seconds by <@{ctx.author.id}>.")
    else:
        await member.timeout_for(duration, reason = reason)
        await ctx.respond(f"<@{member.id}> has been timed out for {days} days, {hours} hours, {minutes} minutes, and {seconds} seconds by <@{ctx.author.id}> for '{reason}'.")



#

it was working the day before

#

and before in general dose anyone know that problem i am having with my code

dapper notch
#

check to see if the person sending (ctx.user.id) is owner of the guild using ctx.guild.owner_id (havent tested this)

astral mist
#

dose anyone know the problem to my coding error

#

ok

#

i will find somewhere else to ask ig

#

where should i ask tho (person who deleted their message)

west vault
astral mist
#

ok ig

full basin
#

Cause that makes no sense

astral mist
#

wdym by "traceback"

full basin
#

Yes, the error..

astral mist
#

ok

#

thats the error

#

async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
^^^^^^^^^^^^^^

young bone
#

@astral mist do you know basic python?

full basin
#

What you're providing makes no sense

astral mist
#

kinda*

full basin
#

Send the whole error

astral mist
#

line 90, in <module>
async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
^^^^^^^^^^^^^^

young bone
#

send a screenshot from the console

astral mist
#

more clear

young bone
#

that was still not the whole traceback...

astral mist
full basin
#

Ah yes, python throws the error and makes you guess what it is

astral mist
#

line 90, in <module>
async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
^^^^^^^^^^^^^^

this is what i got from debugging the code

#

why dose something work fine and then after a week just not budge

fresh dust
#

Is the moneykpatch allowed? to change status from bot (web to mobile)?

fervent cradle
#

Is there anyway to connect to minecraft? (through some sort of API, main point is i cant find one)

cyan quail
#

also uhh

#

anyone who's installed 2.3.2, what shows when you print discord.__version__ or discord.version_info?

fervent cradle
cyan quail
#

i just searched minecraft api

full basin
#

We don't write code for you. Make an attempt.

fervent cradle
#

Could someone help me find something about creating channels (preferably pravite channels in API reference?, The new website is confusing me a bit (v2.3 or whatever)

full basin
#

.rtfm create_invite

quartz thunder
#

Hey πŸ™‚

I'm creating modals and I need to force the user the type a int (number only) in a InputText, can I add input validation ? Am I using the good ui component ?

young bone
full basin
#

You can't validate such input until the user submits the modal

young bone
#

^

quartz thunder
#

But nothing for the type ?

full basin
#

No

quartz thunder
#

😦

full basin
#

Modals are very limited atm

quartz thunder
#

Okey πŸ™‚

young bone
quartz thunder
#

Okey thanks

fervent cradle
# full basin No

could you help me with 1 thing rq, sending my modals in a certain channel?

young bone
fervent cradle
limber urchin
simple canopy
#

?tag codeblock

obtuse juncoBOT
#

Please put your code in a code block:
```py
Here is your Code
```

That makes reading code in Discord a lot easier:

print("This is an example.")
simple canopy
#

including errors^

astral mist
#

Code block?

simple canopy
#

just the way you do it with code, slap it in

#

πŸ₯±

astral mist
#

line 90, in <module>
    async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
                                          ^^^^^^^^^^^^^^

this is what i got from debugging the code

limber urchin
#

There is no way that is the full error you are getting

astral mist
#

It is

simple canopy
#

there is traceback above, send the whole thing

limber urchin
#

Then you either have some weird error handling going on, or you're not sending the entire thing

astral mist
#

Ok the trace back is the error right

limber urchin
#

The traceback is the full output of the error

astral mist
#

wait one sec my code editor is loading

#
Traceback (most recent call last):
 line 90, in <module>
    async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
                                          ^^^^^^^^^^^^^^
AttributeError: 'SlashCommand' object has no attribute 'Member'
astral mist
limber urchin
#

yes

astral mist
#

with it

limber urchin
#

Yes please

astral mist
#

alright

#
@bot.slash_command(guild_ids = servers, name = 'timeout', description = "mutes/timeouts a member")
@commands.has_permissions(moderate_members = True)
async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
    if member.id == ctx.author.id:
        await ctx.respond("You can't timeout yourself!")
        return
    if member.guild_permissions.moderate_members:
        await ctx.respond("You can't do this, this person is a moderator!")
        return
    duration = timedelta(days = days, hours = hours, minutes = minutes, seconds = seconds)
    if duration >= timedelta(days = 28): #added to check if time exceeds 28 days
        await ctx.respond("I can't mute someone for more than 28 days!", ephemeral = True) #responds, but only the author can see the response
        return
    if reason == None:
        await member.timeout_for(duration)
        await ctx.respond(f"<@{member.id}> has been timed out for {days} days, {hours} hours, {minutes} minutes, and {seconds} seconds by <@{ctx.author.id}>.")
    else:
        await member.timeout_for(duration, reason = reason)
        await ctx.respond(f"<@{member.id}> has been timed out for {days} days, {hours} hours, {minutes} minutes, and {seconds} seconds by <@{ctx.author.id}> for '{reason}'.")
astral mist
limber urchin
#

Which version of PyCord are you using?

astral mist
limber urchin
#

Are you using Windows or Linux?

astral mist
limber urchin
#

Run pip3 freeze | findstr py-cord

astral mist
astral mist
astral mist
#

even tho it worked before

limber urchin
#

Well, all of those errors are pretty self-explanatory.

#

Looks like you've done something to mess up the formatting of your file. You probably forgot to close a parenthesis or something

astral mist
limber urchin
#

You must have done something, files don't just change on their own πŸ€·β€β™‚οΈ

astral mist
proud mason
#

You could have checked what the difference between new code and old code is blobpain

sick quest
#

Is there a way to stop recording a voice channel to save the output, while keeping the main voice recording going? So that you can save a certain part of it then move on.

somber frost
#

I made a slash command and it works but it still says the application doesnt react. why?

simple canopy
#

you should use ctx.respond instead of ctx.send

vale heath
#

How to make multiple options required in bridge?

#

Do i have to do discord.options for every individual or can be done in one go.

tired goblet
#

Hi, my bot printed this, what is it about and how can i fix it if it needs fixing

vale heath
#
PS C:\Users\Zalama\OneDrive\Documents\GitHub\Grinder_Co> & C:/Users/Zalama/AppData/Local/Programs/Python/Python310/python.exe c:/Users/Zalama/OneDrive/Documents/GitHub/Grinder_Co/main.py
Traceback (most recent call last):
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 786, in _load_from_module_spec
    setup(self)
  File "c:\Users\Zalama\OneDrive\Documents\GitHub\Grinder_Co\data\cogs\edit.py", line 344, in setup
    bot.add_cog(edits(bot))
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 656, in add_cog
    cog = cog._inject(self)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 548, in _inject
    command._set_cog(self)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 603, in _set_cog
    self.cog = cog
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 830, in cog
    self._validate_parameters()
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 708, in _validate_parameters
    self.options: list[Option] = self._parse_options(params)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 748, in _parse_options
    option = Option(option)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\options.py", line 216, in __init__
    raise exc
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\options.py", line 211, in __init__
    self.input_type = SlashCommandOptionType.from_datatype(input_type)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\enums.py", line 791, in from_datatype
    if issubclass(datatype, str):
TypeError: issubclass() arg 1 must be a class

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

Traceback (most recent call last):
  File "c:\Users\Zalama\OneDrive\Documents\GitHub\Grinder_Co\main.py", line 36, in <module>
    bot.load_extension(f"data.cogs.{filename[:-3]}")
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 910, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\Zalama\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 791, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'data.cogs.edit' raised an error: TypeError: issubclass() arg 1 must be a class
PS C:\Users\Zalama\OneDrive\Documents\GitHub\Grinder_Co> 

getting this error

Code

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

    @commands.slash_command(name="edit",description="Edit Order")
    @commands.has_any_role("Owner", "COO", "Director", "Manager", "Supervisor", "Developer", "Developer")
    async def edit(self, ctx:discord.ApplicationContext, order_id : option("Order ID",str,required=True), action: option("action",str,discription="what you want to change",choices=["priority","cancel","discount","info","amount"],required=True), *, change:option("Change",str,required=False,default=None)):
        if order_id.isnumeric() == False:
solemn idol
#

Is there a way I can avoid global sync by putting my guild id on just 1 place or do I have to put it in every command?

atomic wolf
#

Idk why but every time I want to execute a command it prints:
but I don't have any event that would print this

amber shale
#
class Hello:
  def __init__(self):
    self.message = "Hello, World"
  
  def print_message(self):
    print(self.message)
  
  print_message()

how to give print_message access to self?

atomic wolf
amber shale
#
@slash_command(
        name="ping", description="Get latency of bot.", guilds_ids=get_guilds()
    )```
#

i want to give guild ids as return of after calling a function

#
    def get_guilds(self):
        return self.guilds```
cobalt tangle
#

I don't think you can...

amber shale
#

oh no

cobalt tangle
#

maybe via the cog's command invoke thing.. I have no idea

cobalt tangle
cobalt tangle
#

Pass it in the bot class

solemn idol
cobalt tangle
#

guild_ids in commands

solemn idol
#

thanks

cobalt tangle
#

np

solemn idol
#

you forgot a bracket

#

wait nvm

#

oh okay

cobalt tangle
#

u forgot a : lol

#

any error?

solemn spire
#

?tag codeblock

obtuse juncoBOT
#

Please put your code in a code block:
```py
Here is your Code
```

That makes reading code in Discord a lot easier:

print("This is an example.")
cobalt tangle
#

where in the code did u create a channel...

#

Yes

#

r u sure channel doesnt exist

#

r u sure channel doesnt exist?

#

@fervent cradleprint the type of message.channel

#

if that's discord.DMChannel, try if not message.guild: instead of isinstance

atomic wolf
#

When I execute a command that replies with an ephemeral message the console prints "Error" why is that?

amber shale
#

there could be some even t hat runs on application command

#

or something like that

cobalt tangle
#

"error" doesnt help us to help u

atomic wolf
#

already fixed it, was a mistake on my end sry xd

cobalt tangle
#

Ok

soft quiver
#

hey this was already answered but how do i get the user_id of all members in a channel

pastel merlin
#

I have a small question, move_to to move a person from voice lounge works only with Member and not User ?

full basin
pastel merlin
full basin
#

Because you need a Member object

#

bot.get_user gives you a User object iirc

#

.rtfm Bot.get_user

full basin
#

Indeed.

pastel merlin
full basin
#

.rtfm Guild.get_member

winter condorBOT
pastel merlin
#

thank you very much ^^ it helped me a lot

fervent cradle
#
await interaction.guild.create_text_channel(name="test",category_id = 1052267160724049970 )```,  Im getting error ypeError: Guild.create_text_channel() got an unexpected keyword argument 'category_id', Im unsure of where id decide the cateogory
boreal dust
#

use category.create_text_channel

fervent cradle
#

and should i define catogoery?

boreal dust
#

yes

fervent cradle
#

πŸ‘

#

AttributeError: 'Interaction' object has no attribute 'category' category = "Tickets"
await interaction.category.create_text_channel(name="test")

full basin
#

Definitely not how it works

fervent cradle
#

Yep i relieased

#

I tried category = (id) inside the brackets but that hasnt worked either (like in first msg)

full basin
#

.rtfm Category

young bone
#

Is something with the slash commands? I create a new basic slash command and cannot see the command at the server

fervent cradle
young bone
#

Prefix commands are fine but not slash commands

storm oyster
young bone
storm oyster
#

Oh

#

Damn idk then

fervent cradle
loud holly
#

Get the category via get_channel()

fervent cradle
fervent cradle
loud holly
#

.rtfm Guild.create_text_channel

winter condorBOT
loud holly
fervent cradle
fervent cradle
loud holly
#

category= category object

fervent cradle
#

Okay ty

loud holly
#

Not category_id

fervent cradle
#

Im unfamilar with get channel, would it be something like category = get_channel(id here)

#

Ah wait i might have it

fervent cradle
#

Sorry, I havent done this before

sand siren
#

is there a way to have the bot send a message that only a specific person can see?

silver moat
#

?tag ephemeral

obtuse juncoBOT
#

An 'ephemeral' message is one that's only visible to the person who invoked a command. If you ever got a command error with a blue background, this is an example of one.

To do this, set ephemeral=True when you first use an ApplicationContext. (This includes .defer()ing it; the choice of whether a message is ephemeral or not must be made up front. If you .respond() to a deferred message, setting the ephemeral flag at that time will have no effect.)

This is the equivalent of hidden=True if you're coming from interactions.py

proud mason
#

Dms?

grizzled sentinel
fervent cradle
silver moat
#

use buttons.

#

If you need text-input specifically, use modals.

errant craneBOT
#

Here's the modal dialogs example.

silver moat
#

try it and see.

#

what part do you not understand?

errant craneBOT
#

Here's the confirm example.

#

Here's the ephemeral example.

fervent cradle
quartz thunder
fervent cradle
# quartz thunder async def callback(self, interaction: discord.Interaction) πŸ™‚
    @discord.ui.button(label="General Support",style=discord.ButtonStyle.success, emoji="πŸ“„")
    async def button_callback(self,button, interaction: discord.Interaction):
        
        category = self.get_channel(1052267160724049970)``` 
AttributeError: 'Support' object has no attribute 'get_channel', I presume this is because get channel may be in the wrong place?
quartz thunder
#

interaction.client.get_channel(1052267160724049970) πŸ™‚

fervent cradle
#

Did you figure your issue out?

quartz thunder
#

No I have create a help subject πŸ˜‰

fervent cradle
#

Okay

astral mist
#

is there docs to adding activity satus to ur pycord bot

NVM i found it

full basin
#

@discord.ui.button should be indented at the same indent line as your __init__

#

You didn't even do what I said

#
def __init__()

@discord.ui.button()```
#

Same line as the __init__

#

No

loud holly
#

it should align the indentation of def __init__

full basin
#

That's outside the class now

#

I said same indentation as your init

green hinge
#

Is it possible when I have Autocomplite options to disable the freehand input that you can only select the options?

fervent cradle
#

asking for a friend- how to fix this?

proud mason
fervent cradle
#
class NewButtons(discord.ui.View):
            @discord.ui.button(label="Close Ticket",style=discord.ButtonStyle.red, emoji="❌")
            async def button_callback(self,button, interaction: discord.Interaction):
                await NewChannel.delete(self)
class Support(discord.ui.View):
    @discord.ui.button(label="General Support",style=discord.ButtonStyle.success, emoji="πŸ“„")
    async def button_callback(self,button, interaction: discord.Interaction):
        
        category = interaction.client.get_channel(1052267160724049970)
        NewChannel = await interaction.guild.create_text_channel(name=f"Ticket",category=category)
        await NewChannel.send(embed = StartMsg, view=NewButtons())

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

    @commands.slash_command(name="ticket")
    async def ticket(self,ctx):
        await ctx.respond(embed=SupportTicket, view=Support())
def setup(bot):
    bot.add_cog(ticket(bot))``` What can i do here? It thinks NewChannel isnt defined because its above where its defined, but if i move it it messes up
full basin
#

NewChannel is not defined. Its defined in another class

fervent cradle
#

C:\Users\Administrator\Desktop\BoostBot>python main.py Traceback (most recent call last): File "C:\Users\Administrator\Desktop\BoostBot\main.py", line 11, in <module> from discord.ext import commands File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands__init__.py", line 18, in <module> from .flags import * File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\flags.py", line 71, in <module> @dataclass ^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1221, in dataclass return wrap(cls) ^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1211, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 959, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 816, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory

#

any idea?

fervent cradle
full basin
fervent cradle
#

it is the latest

#

i just updated it before

fervent cradle
full basin
fervent cradle
#

how?

#

"pip list"

#

in powershell/cmd promt

#

C:\Users\Administrator\Desktop\BoostBot>pip list
Package Version


aiohttp 3.8.3
aiosignal 1.3.1
anyio 3.6.2
async-timeout 4.0.2
attrs 22.1.0
certifi 2022.12.7
charset-normalizer 2.1.1
colorama 0.4.6
discord.py 2.1.0
ffmpeg-python 0.2.0
frozenlist 1.3.3
future 0.18.2
h11 0.14.0
httpcore 0.16.2
httpx 0.23.1
idna 3.4
imageio-ffmpeg 0.4.7
multidict 6.0.3
numpy 1.23.5
pip 22.3.1
py-cord 2.1.1
pycord 0.1.1
requests 2.28.1
rfc3986 1.5.0
setuptools 65.5.0
sniffio 1.3.0
urllib3 1.26.13
yarl 1.8.2

full basin
fervent cradle
#

tag install

#

idk it dark?

full basin
soft quiver
#

how do i move users to a different voice channel?

full basin
fervent cradle
#

ok uninstalled

#

@full basin what now?

#

which command

full basin
#

pip install -U py-cord==2.3.2

fervent cradle
#

ok done

#

now retry?

full basin
#

You gotta do a flip

soft quiver
#

but i dont want to await

#

"coroutine 'Member.move_to' was never awaited"

#

but i dont want to end my function yet

#

any other way?

#

right

green hinge
#

Is it possible when I have Autocomplite options to disable the freehand input that you can only select the options?

fervent cradle
#

await interaction.guild.delete(NewChannel) how would i find the channel i've made each time?

#

I could use fetch but how would i find the channel the bots made

peak chasm
#
 404 Not Found (error code: 10062): Unknown interaction

Anyone know what might be happening ?

#

is a modal

peak chasm
#

you can have as many fields as you want

#

oh you mean the selector?

#

or embed ?

#

to paginate embeds you can have as many as you want and use it like this

#

to paginate embeds

#

you are using add_field you must put False to cut the line

#

inline = False

#

the 1st Inline = True
the 2nd Inline =True
the 3rd Inline = False

#

you must identify each time it is the third so that I put it in false

#

I don't know for example

for x in 999
if x == 3:
inline false
else:
inline true
#

it's up to your wits now

#

/ 3 == 0 ΒΏ?

#

%3 == 0 ΒΏ? I don't remember which is the operator to show the rest

#

if when divided by 3 it has remainder 0 inline false

#

to avoid having to repeat it in 3,6,9,12,15 etc

frank yew
#

Hi! I migrated my bot to replit but I have this error

chrome skiff
frank yew
#

I use only slash command

chrome skiff
#

but it says its a required argument

#

so you have to set it

#

doesent matter if you use it or not

frank yew
#

Okay

chrome skiff
#

you can just set it to a random thing

frank yew
#

ty

#

I ty it

chrome skiff
#

and then loading it again?

peak chasm
#

if possible adding an invisible field but it is a with a special character

frank yew
peak chasm
#

There is a page but I don't remember what it is

#

I couldn't tell you I think it was one called zero

#

For the title and another special for the value

chrome skiff
young bone
green hinge
#

Is it possible when I have Autocomplite options to disable the freehand input that you can only select the options?

young bone
#

if its more than 25 you have to use autocomplete

green hinge
proud cargo
#

is like:

@bot.event
async def on_interaction

a thing?

silver moat
#

.rtfm on_interaction

humble ice
#

does anyone have a code example of the select component in ephemeral view

#

pffft

#

nvm im just dumb

proud mason
undone mulch
#
def restart_bot(): 
  os.execv(sys.executable, ['python'] + sys.argv)

class Owner_Only(commands.Cog):

    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def cant(self, ctx): #line 28 (this is not in my main code)
      await ctx.message.delete()
      embed = discord.Embed(description="`-cant` is **deprecated**. Use `/cant`.",color=p84clr)
      await ctx.channel.send(embed=embed,delete_after=5)

    @commands.command()
    async def music(self, ctx):
      await ctx.message.delete()
      embed = discord.Embed(description="`-music` is **deprecated**. Use `/music`.",color=p84clr)
      await ctx.channel.send(embed=embed,delete_after=5)

    @commands.command()
    async def suggest(self, ctx):
      await ctx.message.delete()
      embed = discord.Embed(description="`-suggest` is **deprecated**. Use `/suggest`.",color=p84clr)
      await ctx.channel.send(embed=embed,delete_after=5)
 
    @commands.command()
    @commands.is_owner()
    async def accept(self, ctx, userid):
      await ctx.message.delete()
      embed = discord.Embed(description=f":tada: Congratulations! Your application was accepted and you were automatically whitelisted on our SMP. If you forgot how to join you can check out #990498479384199168.",color=0x22e63c)
      await ctx.channel.send(f"@undone mulch **accepted** <@{userid}>'s application.",embed=embed)

    @commands.command()
    @commands.is_owner()
    async def joinsmp(self, ctx, userid):
      await ctx.message.delete()
      embed = discord.Embed(title="#MendingArmy SMP",description=f":one: Enter anything into the server name field.\n:two: Enter IP **smp.minermends.com**.\n:three: Leave the port as default.\n:four: Apply in #990499151076790303.\n:five: Join when your application gets accepted.",color=p84clr)
      embed.set_image(url="https://media.discordapp.net/attachments/1040478994308550676/1044521716161970254/image.png?width=998&height=593")
      await ctx.channel.send(embed=embed)

    @commands.command()
    @commands.is_owner()
    async def vadelia(self, ctx, userid):
      await ctx.message.delete()
      embed = discord.Embed(title="Vadelia Factions",description=f"This channel is for our official Minecraft server. **Vadelia** is a server that works for both Bedrock & Java. You can use the thread below for any questions you might have regarding the server. Enjoy!",color=p84clr)
      embed.add_field(name="Basic Help",value=f"Factions is an intense combat gamemode where you're up against every other player to compete for the top. Each player is capable of creating their own faction and inviting members into it. The ultimate goal is to establish a base and fend off any intruders! Players can resort to any means possible to take out another faction (besides hacking or cheating). Type `/f help` for a list of faction commands. Good luck!",inline=False)
      embed.add_field(name="Join Vadelia",value="**IP**: `vadelia.net`\n**PORT**: `Default`\n**Version**: `Latest | Bedrock / Java`",inline=False)
      embed.set_image(url="https://media.discordapp.net/attachments/1040478994308550676/1046294996430626957/V-01_1.png?width=839&height=593")
      await ctx.channel.send(embed=embed)

    @commands.command()
    @commands.is_owner()
    async def topthread(self, ctx, userid):
      await ctx.message.delete()
      embed = discord.Embed(title="Welcome to the Thread!",description=f":one: Use this channel for any questions you might have.\n\n:two: Trades, recruitment, and all other faction stuff only.\n\n:warning: This channel is not for general chatting. Please go to #1039556175181647992 for that.",color=p84clr)
      await ctx.channel.send(embed=embed)```
#

Why is it saying that my synax is invalid at line 28

silver moat
#

what is line 28

full basin
silver moat
undone mulch
#

no not the entire

#

This is entire

full basin
#

Can you provide the traceback @undone mulch

undone mulch
#
Extension 'cogs.miner_only' raised an error: IndentationError: unindent does not match any outer indentation level (miner_only.py, line 47)```
**Traceback** ^
limber urchin
#

Your indentation is wrong

#

In your init you have 4 spaces, but only 2 in all your methods

undone mulch
#

One more question