#discord-bots

1 messages · Page 287 of 1

buoyant quail
#

You did put that in the timeout argument

#

Not in the check function

harsh orbit
#

Oh

#

Wait

#

Still the same thing as yesterday

#

No errors+ nothing happens

buoyant quail
#

Show screenshot of your chat
Beginning from the buy message

#

Also you can try print out bank and probot to check if they are what you want

#

You are missing await in ctx.send

harsh orbit
#

I've solved it

#

Just changed bank.mention to mentioned_in

#

But thanks a loooot for help

delicate epoch
#

how do i make a command with a limit use so where every member can only use the command 3 times and then it dont work anymore

golden portal
#

app commands or text commands?

#

well tbh, both of them is similar solution, just make a custom check, store how many times they have used the command in a db

ember mango
red nest
#

Can anyone help me with this RuntimeError with discord.py-ipc: It tells me I need to await the Server.start() function even though it isn't async

if __name__ == "__main__":
    bot.ipc_server.start()
    bot.run(TOKEN)
#

I checked everything in the docs and nothing in the code seemed to be wrong even though I still get the error

#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("ready") 
             
bot = TapBot(command_prefix='!',intents=intents)
golden portal
# red nest Can anyone help me with this RuntimeError with discord.py-ipc: It tells me I nee...

it's caused by this https://github.com/Ext-Creators/discord-ext-ipc/issues/47 they never implemented a fix for it since it got abandoned

GitHub

Description It seems like in discord.py 2.0, ever since Client.dispatch uses asyncio.create_task, we can't really start the server before the bot is running. Actual Behavior Traceback (most rec...

red nest
#

Ik but I'm not using this

unkempt canyonBOT
#

discord/ext/ipc/server.py line 275

async def start(self):```
golden portal
#

oh i see

red nest
vocal snow
#

you could start it in the bot's setup_hook

red nest
golden portal
#

poor example i guess, they forked the original

red nest
#

so the bot..ipc_server.start() shouldn't be async

vocal snow
#

the docs also says it's async

red nest
#

yeah but i can't await it either

#

i just get a different error

vocal snow
#

yes, you can only await inside a coroutine. Hence use the bot's setup_hook

red nest
#

So should I delete the on_ready method or how do I start the ipc in the setup_hook

vocal snow
#

override the setup_hook method in your bot class and start the server there

red nest
#

ok

vocal snow
#

yes

red nest
#

ok thanks i'll try that out

#

Now I'm getting a database not callable error (the bot is also connected to mongodb)

vocal snow
#

full traceback and code please

red nest
#

k

#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="secret_key")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("ready")
    async def setup_hook(self):
        print("async def setup_hook")
        bot.ipc_server.start()
        bot.run('token')

def handle_discord():
    print("starting discord")
    global bot      
    bot = TapBot(command_prefix='!',intents=intents)
#
bot = pymongo.MongoClient("mongodb_connection")
#

And the error:

    @bot.hybrid_command(name='help', description='Displays all available commands, both slash commands and prefixed commands.')
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'Database' object is not callable
vocal snow
#

bot = pymongo.MongoClient("mongodb_connection")

#

why are you calling this bot

#

that is overriding bot = TapBot(command_prefix='!',intents=intents)

red nest
#

I deleted that and then 'bot' isn't defined

#

It was the database connection

vocal snow
#

I didn't say delete it

red nest
#

Well I commented it

vocal snow
#

why

red nest
#

just to see what happens lol

kindred vessel
#

I have a question

#

Can somebody help me with

red nest
#

just open your cmd and type that in

kindred vessel
#

I have no clue what to do even tho the steps r right there

#

"Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings "

red nest
#

have you installed python lol

kindred vessel
#

yeah

red nest
#

Then you have to add it to PATH

kindred vessel
vocal snow
#

on windows use py

kindred vessel
#

brb gonna watch a bibio

red nest
#

Quite sure I'm doing something very wrong

vocal snow
#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

vocal snow
#

send your full code

red nest
#

it's basically the same thing

#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("ready")
    async def setup_hook(self):
        print("async def setup_hook")
        bot.ipc_server.start()
        bot.run('')

def handle_discord():
    print("starting discord")
    global bot      
    bot = TapBot(command_prefix='!',intents=intents)
    

handle_discord()
vocal snow
#

why are you calling bot.run in the setup hook

#

that should be in the handle function

red nest
#

oh shoot

#

didn't see that

#

Now it has the exact same runtimeError as before

#

so it didn't change anything

vocal snow
#

then await it...

red nest
#

ok it works now

#

but is there a way for me to connect to mongodb again or should i just use another variable for the connection

vocal snow
#

just connect like you were doing before

#

just change the variable name

red nest
#

Ok thanks

kindred vessel
#

I made a path and I put in the "python -m pip install -r requirements.txt" and it told me to update my pip and I did and now i don't know what to do

#

Do i need to make a config file?

red nest
#

You should put the python directory into the PATH variables

red nest
#

I can't call any commands now even though I didn't change anything

vocal snow
#

what intents do you have

red nest
#

Intents.all()

#

It says the application commands couldn't be found

vocal snow
#

I don'ty see any application command in your code

red nest
#

well in the rest of the code I didn't show you there are over 15 lol

#

Just for example the help command

vocal snow
#

thats why i asked for it

#

you need to sync the commands

#

!d discord.app_commands.CommandTree.sync

unkempt canyonBOT
#

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

Syncs the application commands to Discord.

This also runs the translator to get the translated strings necessary for feeding back into Discord.

This must be called for the application commands to show up.
red nest
#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="
")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("Bot is ready")
    async def setup_hook(self):
        print("async def setup_hook")
        await bot.ipc_server.start()

def handle_discord():
    print("starting discord")
    global bot      
    bot = TapBot(command_prefix='!',intents=intents)
    bot.run(')

handle_discord()

bot.remove_command('help')

@bot.hybrid_command(name='help', description='Displays all available commands, both slash commands and prefixed commands.')
async def help(ctx):
    helpEmbed = discord.Embed(
        title="Command List" ,
        description="Here is a complete list of all usable commands:",
        color=discord.Color.blurple()
    )
    helpEmbed.add_field(name="help", value="Displays this message (Slash/Prefix)", inline=False)
    helpEmbed.add_field(name="kick", value="Kicks a user (Slash/Prefix)", inline=False)
    helpEmbed.add_field(name="ban", value="Bans a user (Slash/Prefix)", inline=False)
    helpEmbed.add_field(name="add_warn", value="Warns a user, warns are stored on a database and can be viewed at all time. (Slash/Prefix)", inline=True)
    helpEmbed.add_field(name="reset_server_warns", value="Resets the number of warns a user has on this server to 0. (Slash/Prefix)", inline=True)
    helpEmbed.add_field(name="get_user_warns/get_global_warns", value="Views the amount of warns a user has on this server or the entire platform. (Slash/Prefix)", inline=True)
    
    await ctx.send(embed=helpEmbed)
vocal snow
#

your bot's tree is accessable through bot.tree

red nest
#

Oh yeah

#

I forgot about that

#

So do I have to do that in the handle_discord?

vocal snow
#

it's a coroutine, so you should do it in the setup hook

red nest
#

ok

harsh orbit
#

How I can check if is the bot in a guild?
I tried

guild = bot.get_guild(1142023460533571635)
  if bot in guild:
    print("yup im in")

But didn't work

vocal snow
#

if get_guild returns a Guild object then the bot is in that guild

#

if it returns None then the bot is not in that guild

harsh orbit
harsh orbit
#

How do I can check if the bot in a guild?

vocal snow
#

reread what i said

#

!d discord.Client.get_guild

unkempt canyonBOT
#

get_guild(id, /)```
Returns a guild with the given ID.

Changed in version 2.0: `id` parameter is now positional-only.
vocal snow
#
Returns

    The guild or None if not found.
Return type

    Optional[Guild]

harsh orbit
#

So I print guild to check?

vale wing
#

Logic

vocal snow
harsh orbit
swift acorn
#

Is there any way to Verify a Member through your bot?

vale wing
harsh orbit
vale wing
#

Bot being called in guild it is not in is impossible situation

harsh orbit
#

I gonna check if its in or no

harsh orbit
#

And the bot in them both

vale wing
#

theN wHY chECk

harsh orbit
#

@vocal snow
I printed guild and it told me the guild name

vocal snow
#

excellent

#

whats the issue

vale wing
harsh orbit
harsh orbit
vocal snow
#

you aren't reading my messages

harsh orbit
#

I read it

vocal snow
#

ok

#

so whats the issue

harsh orbit
#

But didn't understand and you don't explain

harsh orbit
vocal snow
#

get_guild returns None if the bot is not in that guild

#

it returns a Guild object if it is in that guild

#

I hope you know how to use if statements atleast?

naive briar
#

They said the same thing 10 minutes ago

red nest
#

I am back (again) XD
The slash commands are not showing up in the server even though the commands are synced to the server

swift acorn
naive briar
#

Show your syncing code

red nest
#

yes wait a minute

#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("Bot is ready")
    async def setup_hook(self):
        print("async def setup_hook")
        await bot.ipc_server.start()
        await bot.tree.sync(guild=discord.Object(id=))

def handle_discord():
    print("starting discord")
    global bot      
    bot = TapBot(command_prefix='!',intents=intents)
    bot.run('')

handle_discord()
naive briar
#

I see no slash commands there

timid spade
#

anyone know can a bot create its own activity in a server?

red nest
naive briar
#

Can you show how you define them?

red nest
#
@bot.hybrid_command(name='add_warn', description='Warn a user, if the users warn count reaches 3, they will be tempmuted')
@commands.has_permissions(kick_members=True)
async def add_warn(ctx, msg_id: str):
    msg_id = int(msg_id) # Due to a bug in the discord API, the ID must be passed as a string and then converted to an integer.
    msg = await ctx.fetch_message(msg_id)
    serverId = ctx.message.guild.id
    print(serverId)
    db.server_messages_log.insert_one( #MongoDB Collection Database
        {
            "message": msg.content, #Get content of warned message
            "message_author": msg.author.id, #Get ID of warned user
            "message_server": serverId #Get Server ID
        }
    )
    await ctx.send(f"{msg.author} has been warned, you can see how many warnings they got using */getuserwarns*")
```This one as an example
naive briar
#

Then I got no idea 🤷

red nest
#

oof

#

Is anything wrong with my syncing though?

buoyant quail
#

How do you get bot variable?
It's created inside the function and is runned right after that
You aren't doing something between creating it and running

red nest
#

I know but I don't see an issue there

naive briar
#

Send your full code, maybe?

red nest
#

Because the bot is connecting , it just doesnt sync properly

naive briar
#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

buoyant quail
red nest
#

The full code is over 300 lines long so that wouldn' be a good idea

naive briar
#

Just do it

red nest
#

ok...

#

I won't send the entire code though

naive briar
turbid condor
red nest
naive briar
red nest
#

ooof

#

sorry lol

buoyant quail
#

All your code after line 40 is unreachable

naive briar
#

From what I see there, you're running the bot before defining the slash commnds

red nest
#

so how should it be

naive briar
#

Define them before running your bot?

#

🤷

red nest
#

But they are synced in the setup_hook

naive briar
#

They're not defined, so it doesn't matter

red nest
#

And I got told to sync in the hook

turbid condor
#

Welp all that is ok

red nest
#

should it be in the handle_discord function then?

naive briar
#

No

turbid condor
#

You are syncing at the right place

naive briar
#

Why are you making a function for just creating an instance and running it anyway

red nest
#

Because of the IPC server

#

Otherwise there would be a RuntimeError

naive briar
#

What?

#

I mean the handle_discord function

turbid condor
#

U don't need the handle_discord error as far as i can see you are creating an instance there and running your bot

red nest
#

So could it just be created outside of that?

#

Or how

turbid condor
#

Where as you can just define your bot variable and at the end of your script do bot.run('Token')

naive briar
buoyant quail
#
bot = ...

# commands

bot.run()
naive briar
#

Or instances

delicate epoch
#
@gametime.error
async def gametimeError(self, interaction: discord.Interaction, error: app_commands.AppCommandError):
  if isinstance(error, app_commands.CommandOnCooldown):
    timeRemaining = str(datetime.timedelta(seconds = int(error.retry_after)))
    await interaction.response.send_message(f"Please wait `{timeRemeaning}` to use this command again.", ephemeral=True)```

```py
    await self.on_error(interaction, error)  # type: ignore
TypeError: gametimeError() missing 1 required positional argument: 'error'```

i dont get it
red nest
turbid condor
red nest
#

the it says 'TapBot' object has no attribute 'bot'

#

TapBot is the class

buoyant quail
#

It's already a bot

#

self.tree

red nest
#

Well I still get the error

naive briar
naive briar
red nest
naive briar
#

!traceback

unkempt canyonBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

buoyant quail
red nest
#

You said self.bot.tree

buoyant quail
#

It was not me

red nest
#

oh sorry

buoyant quail
naive briar
red nest
#

it was nobody i ping for reply

#

Still doesn't show the commands

timid spade
naive briar
red nest
#

Bruh

#
class TapBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.ipc_server = ipc.Server(self, secret_key="TAPBOT_DASH")
        
    async def on_ipc_read(self):
        print("IPC is ready")
    async def on_ipc_error(self, endpoint, error):
        print(endpoint, "raised", error)
    async def on_ready(self):
        print("Bot is ready")
    async def setup_hook(self):
        print("async def setup_hook")
        await bot.ipc_server.start()
        await self.tree.sync(guild=discord.Object(id=864807058351194112))

bot = TapBot(command_prefix='!',intents=intents)
naive briar
naive briar
timid spade
red nest
#

The full code is litterally 300 lines long

timid spade
#

that*

naive briar
#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

naive briar
red nest
buoyant quail
#

Looks ok
I am not good at syncing, try to use copy_global_to
Or syncing globally

red nest
#

Still doesn't fix the issue

meager chasm
#

Are you passing a valid guild id

red nest
#

Nevermind, I fixed the issue

red nest
vital nest
#

how can i make one

#

a discord bot

thin raft
vital nest
slate swan
vital nest
slate swan
thin raft
unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

thin raft
slate swan
vital nest
vocal snow
#

Nightmare about turtles

vital nest
buoyant quail
vital nest
#

to make a bot

buoyant quail
vital nest
#

yes

buoyant quail
#

Sad

vital nest
#

it didnt work

slate swan
#

i guess im shadow banned Sadeg

buoyant quail
#

You tried very bad then

#

Interesting where is Down

#

I thought he is here

slate swan
#

cause i am aniblobsweat

vital nest
buoyant quail
#

?

slate swan
#

thats something that OpalMist would say

buoyant quail
#

If you have something then you can show it
We can't know what did you talk about somewhere else

vital nest
slate swan
#

its exceptions==0.1.0

#

eg

pip install pandas==1.3.4

vital nest
slate swan
#

!pypi exceptions

unkempt canyonBOT
slate swan
#

why even need to specify version

#

it its the current one

vital nest
slate swan
#

since when there is no command to copy

vital nest
slate swan
#

how bout pip install py-exceptions

buoyant quail
#

I don't like the fact that they have no working source link tho

#

And the docs :/

#

And last update 8 years ago

slate swan
#

yeah why would you need to install such package

vital nest
vital nest
#

wait what py PS C:\Users\SALAH\Desktop\bot> pip install py-exceptions Downloading py_exceptions-1.2.2-py3-none-any.whl (21 kB) Requirement already satisfied: Werkzeug>=2.0.1 in c:\users\salah\appdata\local\programs\python\python311\lib\site-packages (from py-exceptions) (2.3.6) Requirement already satisfied: Jinja2 in c:\users\salah\appdata\local\programs\python\python311\lib\site-packages (from py-exceptions) (3.1.2) 0.1->py-exceptions) (2.1.3) Installing collected packages: py-exceptions Successfully installed py-exceptions-1.2.2 PS C:\Users\SALAH\Desktop\bot> & C:/Users/SALAH/AppData/Local/Programs/Python/Python311/python.exe c:/Users/SALAH/Desktop/bot/main.py Traceback (most recent call last): File "c:\Users\SALAH\Desktop\bot\main.py", line 22, in <module> import exceptions ModuleNotFoundError: No module named 'exceptions' PS C:\Users\SALAH\Desktop\bot> & C:/Users/SALAH/AppData/Local/Programs/Python/Python311/python.exe c:/Users/SALAH/Desktop/bot/main.py Traceback (most recent call last): File "c:\Users\SALAH\Desktop\bot\main.py", line 22, in <module> import exceptions ModuleNotFoundError: No module named 'exceptions' PS C:\Users\SALAH\Desktop\bot>

buoyant quail
#

import py_exceptions mb

#

again, why are you using it?

slate swan
#

can you show how you use the exceptions module

vital nest
#

online code

buoyant quail
#

it's some dead library that hasn't any info and is maybe a malware

slate swan
#

what for

slate swan
#

🧐

buoyant quail
#

xdd

slate swan
#

bros still trying

vital nest
#

yes !

slate swan
#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

vital nest
#

why is this

slate swan
#

doesnt it tell you in dms?

buoyant quail
#

!pypi py-exceptions

unkempt canyonBOT
buoyant quail
#

py-exceptions page looks a bit better

slate swan
#

nice

vital nest
buoyant quail
#

.vscode in the source 💀 (of the library, i am talking not to you)

#

at least not venv

slate swan
vital nest
#

the code i sent !

buoyant quail
#

exceptions is not a library

vital nest
#

its a folder !

slate swan
#

o i just noticed its krypton template

buoyant quail
#

It wasn't very hard :p

slate swan
#

i never read comments

buoyant quail
slate swan
#

same for me

slate swan
# vital nest its a folder !

fyi such projects always have either poetry set up or requirements.txt file containing all packages needed to install

#

to install them from file you do pip install -r path/to/requirements.txt

unkempt canyonBOT
#

requirements.txt lines 1 to 3

aiohttp
aiosqlite
discord.py```
weak quail
#

Hello, I am getting this error when i run my bot.```
discord.app_commands.errors.CommandSyncFailure: Failed to upload commands to Discord (HTTP status 400, error code 50035)
In description._errors: [{'code': 'BASE_TYPE_REQUIRED', 'message': 'This field is required'}]


The error is stemming from when i try to sync the bot's command tree to my guild. I don't quite understand the error message 😭
buoyant quail
#

Show your code

#

!paste if it's long

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

buoyant quail
#

Show slash commands

weak quail
# buoyant quail Show slash commands

This was the command I was working on when the error happened

@app_commands.command(name="open", description="")
async def open_box(self, interaction: discord.Interaction, box_name: str, quantity: int):
    author = interaction.user
    box_name = "Box"

    embed_desc = ""
    box = next(b for b in BOXES if b.name == box_name)

    for _ in range(quantity):
        prize = box.roll_prize()
        embed_desc += prize + "\n"

    embed = discord.Embed(
        color=colors.default,
        title="Title",
        description=embed_desc
    )
    embed.set_author(name=author.name, icon_url=author.avatar)
    await interaction.response.send_message(embed=embed)
buoyant quail
#

You can make it empty string

#

Just dont set it, or make not empty

slate swan
#

either dont pass it or set it to something

weak quail
#

ohhh omg

#

i understand the error now thanks!!

vital nest
#

were do i find the rest

turbid condor
#

As far as i know it's an int value

vital nest
#

it for me so i dont care am goingt o give it admin

vital nest
turbid condor
#

Which can be obtained by selecting the permissions that are present in the dev portal on page where you reset the token at the bottom
Select the perms your bot needs and then it will show u some int value copy and paste it here

turbid condor
vital nest
#

so it talkes to other ai bots

#

what about prefix

turbid condor
vital nest
#

oh

#

so py 2023-08-19 15:00:25 INFO discord_bot Loaded extension 'fun' 2023-08-19 15:00:25 INFO discord_bot Loaded extension 'general' 2023-08-19 15:00:25 INFO discord_bot Loaded extension 'moderation' 2023-08-19 15:00:25 INFO discord_bot Loaded extension 'owner' 2023-08-19 15:00:25 INFO discord_bot Loaded extension 'template' 2023-08-19 15:00:25 WARNING discord.ext.commands.bot Privileged message content intent is missing, commands may not work as expected. 2023-08-19 15:00:25 INFO discord.client logging in using static token 2023-08-19 15:00:29 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: 41105e3124bf6234dd5e2ac9f70839fd). 2023-08-19 15:00:32 INFO discord_bot Logged in as Slimmy 2023-08-19 15:00:32 INFO discord_bot discord.py API version: 2.3.2 2023-08-19 15:00:32 INFO discord_bot Python version: 3.11.4 2023-08-19 15:00:32 INFO discord_bot Running on: Windows 10 (nt) 2023-08-19 15:00:32 INFO discord_bot -------------------

turbid condor
#

And set the sync commands globally to true

#

So that your slash appear commands on all the servers the bot is in

vital nest
#

41105e3124bf6234dd5e2ac9f70839fd

#

whats this ?

turbid condor
vital nest
#

so how to test the bad boy

turbid condor
#

Welp try using it's help command

vital nest
#

were

turbid condor
#

Wait never mind you don't have message_content intent enabled in your code

#

So prefix commands won't work

#

Enable that first

vital nest
#

were

turbid condor
#

In your main file

#

The file from which u ran the bot

vital nest
#

could you do it pls am confused

fringe void
#

where to ask general py doubts?

vital nest
vital nest
fringe void
#

alr ty

vital nest
vital nest
#

hear

fringe void
#

I am trying to find the channel llol

vital nest
fringe void
#

alr

buoyant quail
turbid condor
vital nest
#

so what do i do?

turbid condor
buoyant quail
#

neeeded to ping him mb

turbid condor
#

Well your bot doesn't have a help command it seems

#

You have removed it

vital nest
#

it still shows old messages

#

i dint touch it how can i turn off the bot and restart

turbid condor
#

Just exit the code from terminal

vital nest
#

i did it it works

turbid condor
#

Welp there u go then

vital nest
#

old turn off turn on

#

reliable

#

so can i ask can i connect chat gpt or an ai to this so the bot can use commands or ect

vital nest
naive briar
#

Why wouldn't it be

turbid condor
vital nest
#

i use ! comands

#

is there a way for you to chow me

#

show

turbid condor
#

Show u what?

vital nest
#

how to send to make the bot answere like chat gpt wait i have something

turbid condor
#

Do u have any experience with coding?

#

If no than i suggest learning that first

vital nest
#

60 to 50 %

#

so yes

#

but new to bot coding

#

this was an ai i made

#

doesnt work now

naive briar
#

I don't see how making a bot in discord.py is more difficult than just Python

vital nest
#

its like python to pygame

naive briar
#

How is that?

harsh orbit
#

Where is the Invaild syntax?

naive briar
harsh orbit
#

Yes I know

#

But I didn't understand why it is Invaild

naive briar
#
server_id = await bot.wait_for("message", check= lambda m: m.channel == ctx.channel and m.author = ctx.author, timeout=300.0)

m.author = ctx.author part is invalid

#

!e

lambda: (a = 0,)
unkempt canyonBOT
#

@naive briar :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     lambda: (a = 0,)
003 |              ^^^^^
004 | SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
naive briar
#

There

harsh orbit
#

Ah

#

Thx

vital nest
#

here

#

You:: hi
Slimy.exe: Slimy.exe will ruin your day by convincing you to do something that
will make you look foolish or silly in front of your friends. He will try to
manipulate you into doing something embarrassing or outrageous, like singing a
song in public or wearing an outrageous outfit.
You:: hi slimmy.exe long time no see you didnt exist just becaause i dindnt have mto pay for your api
Slimy.exe: why you think money is the only way to exist? I'm here to ruin your day
and make you look foolish in front of your friends. How about this: I challenge
you to a rap battle in the middle of the street. If you win, I'll leave you alone.
But if I win, you have to do whatever I say for the rest of the day! What do you
say?
You:: ehh no!
Slimy.exe: I challenge you to a dance-off in the middle of the street. If you win,
I'll leave you alone. But if I win, you have to do whatever I say for the rest of
the day! What do you say?
You:: stop chalenging me itsbeen 2 years you didnt talk to someone ad that what ySlimy.exe: I'm back and I'm here to ruin your day. How about this: I challenge you
to a rap battle in the middle of the street. If you win, I'll leave you alone. But
if I win, you have to do whatever I say for the rest of the day! What do you say?
You::

vital nest
#

hes so smart

vital nest
#

how can i add it to my discord bot

naive briar
vital nest
# naive briar And?

god what have i made py Slimy.exe: python programers, I'm Slimy.exe and I'm here to ruin your day! Prepare to be cursed and insulted, because that's what I do best! You:: i dont thinck its an big enuff presentation why dont you tell them ... what uld whant to do in discord and stuff Slimy.exe: I'm here to make your life miserable! I'll be trolling in the chat, insulting people, and generally making a nuisance of myself. I'll also be spamming the chat with memes and other nonsense. So if you want to have a good time, stay away from me! You::

naive briar
#

This is off-topic to the channel

vital nest
#

its literaly what i did

harsh orbit
#

..

vital nest
naive briar
#

If the bot isn't in the guild, then None is returned 🤷

turbid condor
naive briar
#

Well, it's also for discussions, but a GPT model isn't appropriate in this channel on its iwn

vital nest
#

i need to send the users input to my ai and the response to discord

harsh orbit
#

Same Id but different answers

naive briar
#

What?

vital nest
naive briar
#

And don't tell me that you're putting a message object into a get_guild method

harsh orbit
#

Only the difference is the first one is from bot.wait_for but the second the Id in the project

harsh orbit
#

So how I get it?

#

I need the content

naive briar
#

Then get it?

harsh orbit
#

I will test

turbid condor
vital nest
#

no the bot is free

vital nest
harsh orbit
naive briar
#

Same what

harsh orbit
#

Same results

#

It's telling me it's None

turbid condor
naive briar
#

Show your code, and just the important related part, not the whole

harsh orbit
#
server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)

  except asyncio.TimeoutError:
    await ctx.send("Time ended")

  else:
     b_guild = bot.get_guild(server_id.content)
     if b_guild == None:
      await ctx.send("you enterd a wrong id please try again")
vital nest
naive briar
#

.content returns a string, get_guild needs an integer

harsh orbit
#

int(server_id.content)?

naive briar
#

Yes?

harsh orbit
#

I will try

turbid condor
#

How will .content return an id I'm confused in first place

naive briar
#

If the content of the message is an ID

turbid condor
#

Oh i get it

hushed galleon
naive briar
#

I mean, that's just Python, isn't it? I don't think discord.py invented functions, asynchronous programming, and OOP

hushed galleon
#

its not that they invented it, but that they're prerequisites to using discord.py effectively

buoyant quail
#

Beginner should start from basics, not discord.py then. If it can't take all of that at once

naive briar
ember mango
#

Hello, how do I select numer
Like this

#

@buoyant quail

hushed galleon
#

those are known as choices, which can either be defined as part of the command or written with an autocomplete callback where the bot responds with choices based on the user's input

#

if you're asking how to write it in python, that depends on what library you're using for your bot

turbid condor
#

Want users to select something from a hard coded list?
Use "choices", three different ways to do it.
View Documentation (has examples)

Option 0: True & False
Need True and False as choices? Simply type the argument with bool and discord will handle it.```py
@...command(...)
async def testephemeral(
interaction: Interaction,
ephemeral: bool
):
print(ephemeral, type(ephemeral))

will print either True or False

**Option 1: typing.Literal**
This is the easiest. Also works for hybrids```py
from typing import Literal
 
@...command(...)
async def choosecolour(
  interaction: Interaction,
  colour: Literal["Red", "Green", "Blue"]
):
  print(colour) # will print either Red, Green or Blue

Option 2: @app_commands.choices```py
from discord import app_commands

@...command(...)

name is shown to the user and value is returned to you.

value can be of type str, int or float.

@app_commands.choices(
colour=[ # param name
app_commands.Choice(name="Red", value="red"),
app_commands.Choice(name="Green", value="green"),
app_commands.Choice(name="Blue", value="blue")
]
)
async def choosecolour(
interaction: Interaction,
colour: Choice[str] # [str] denotes the type, not required.
):
print(colour) # will print the chosen Choice obj

colour.name for the name and colour.value for the value you set

**Option 3: enum**```py
from enum import Enum

class Colours(Enum):
  # format: name - value
  Red = "red"
  Green = "green"
  Blue = "blue"

@...command(...)
async def choosecolour(
  interaction: Interaction,
  colour: Colours
):
  print(colour) # will print our enum. in this case, the Colour class above
  # colour.name for the name and colour.value for the value you set
ember mango
#

Understood

turbid condor
ember mango
#

disnake?

turbid condor
ember mango
#

24 Number?

turbid condor
#

Nah i mean from above examples

ember mango
hushed galleon
naive briar
#

I can't get over the fact that they hard-coded integers

hushed galleon
#

oh yeah min/max value exists, weirdly ive never seen what that looks like

naive briar
#

Discord will tell the user that they exceeded the limit

hushed galleon
#

ah i see

ember mango
#

What error?

buoyant quail
#

It's expecting a dict

ember mango
hushed galleon
hushed galleon
potent mulch
#
Traceback (most recent call last):
  File "C:\Users\simoc\OneDrive\Desktop\Comune di Roveto\DiscordBot\Comune di Roveto, Regione Toscana V2\bot.py", line 6, in <module>
    from discord.ext import commands
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\__init__.py", line 19, in <module>
    from .flags import *
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\flags.py", line 73, in <module>
    @dataclass
     ^^^^^^^^^
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\simoc\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 815, 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

Got this Error after updating Python

#

Someone know what can be wrong? 😭

#

(when i run the command py bot.py)

ember mango
#

@
thegamecracks

#

@hushed galleon ecracks

#

@turbid condor

buoyant quail
#

Here the error is absolutely clear

#

Just read it

ember mango
buoyant quail
#

You can't use empty string as option

ember mango
#

i find

cloud dawn
#

Or even better would be map(str, range(1, 25))

harsh orbit
#
server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)

  except asyncio.TimeoutError:
    await ctx.send("Time ended")

  else:
     b_guild = bot.get_guild(int(server_id.content))

Here if the user send any message not int it's turn into error so I can handle it?

placid hatch
#

Hello I am looking for a discord free bot maker (the bot is simple

potent mulch
harsh orbit
buoyant quail
#

You did handle the TimeoutError

#

ValueError is the same thing, just another error

harsh orbit
#

I just wanted the name yert

#

Thx

buoyant quail
#

You get error name when you run it /

potent mulch
buoyant quail
#

sure

harsh orbit
#

And I have another question

potent mulch
#

spent 3 days trying to solve

harsh orbit
#

When this happens (ValueError) how I can make the bot wait another time or still waiting?

potent mulch
#

bruh, if you added the runout is useless that the bot can wait

shrewd fjord
harsh orbit
shrewd fjord
#

You can use while True too imo, but since you only wanna give 2 tries just repeat the same step

harsh orbit
potent mulch
#

you got it

harsh orbit
harsh orbit
#

If a value error happened the bot will never wait anymore

potent mulch
#

because the time will be finished

harsh orbit
#

Nah

potent mulch
#

for the bot

#

what's the message you have to send?

shrewd fjord
#

.... Just while True it no?

#

while True:

wait here

break
except TimeoutError:
break
except ValueError:
continue

#

Something like dat

potent mulch
shrewd fjord
buoyant quail
shrewd fjord
potent mulch
#

every time i run py bot.py i got the same exat error, even with different code

buoyant quail
#

So you get it when you just run the code, bot doesn't run at all?

potent mulch
#

yea and the bot i never checked, i'll try

buoyant quail
#

(asking because it's running fine by me, maybe you get error when calling some command)

potent mulch
#

no the bot doesn't start

naive briar
#

Or maybe a fork and discord.py ducky_sus

potent mulch
# naive briar You might have multiple forks of `discord.py` installed. Do `pip freeze`, see wh...
aiohttp==3.8.3
aiosignal==1.3.1
altgraph==0.17.3
async-generator==1.10
async-timeout==4.0.2
attrs==22.2.0
beautifulsoup4==4.11.1
certifi==2022.9.24
cffi==1.15.1
chardet==5.1.0
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.6
cookies-discord-components==3.0.0
dipy==1.6.0
discord-py-interactions==5.9.2
discord-typings==0.6.0
discord-ui==5.1.6
discord.py==2.3.2
discord.py-message-components==1.7.5.4
distlib==0.3.6
docutils==0.20.1
emoji==2.7.0
filelock==3.12.2
Flask==2.2.2
frozenlist==1.3.3
h11==0.14.0
h5py==3.8.0
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
Kivy==2.2.0
kivy-deps.angle==0.3.3
kivy-deps.glew==0.3.1
kivy-deps.sdl2==0.6.0
Kivy-examples==2.2.0
Kivy-Garden==0.1.5
MarkupSafe==2.1.2
MouseInfo==0.1.3
multidict==6.0.4
nibabel==5.0.0
numpy==1.24.2
outcome==1.2.0
packaging==23.0
pefile==2023.2.7
Pillow==9.4.0
platformdirs==3.5.3
py-cord==2.0.0b1
PyAutoGUI==0.9.53
pybrot==0.0.7
pycparser==2.21
PyGetWindow==0.0.9
Pygments==2.15.1
pyinstaller==5.13.0
pyinstaller-hooks-contrib==2023.5
PyMsgBox==1.0.9
pyperclip==1.8.2
pypiwin32==223
PyRect==0.2.0
PyScreeze==0.1.28
PySocks==1.7.1
python-dotenv==1.0.0
pytweening==1.0.4
pywhatkit==5.4
pywin32==306
pywin32-ctypes==0.2.2
reactionmenu==3.1.3
requests==2.28.1
scipy==1.10.0
selenium==4.8.2
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.3.2.post1
table2ascii==1.1.0
termcolor==2.2.0
thread6==0.2.0
TIME-python==0.0.17
tomli==2.0.1
tqdm==4.64.1
trio==0.22.0
trio-websocket==0.9.2
typing_extensions==4.5.0
urllib3==1.26.12
virtualenv==20.23.0
wcwidth==0.2.5
webdriver-manager==3.8.5
Werkzeug==2.2.2
wikipedia==1.4.0
wsproto==1.2.0
yarl==1.8.2
shrewd fjord
shrewd fjord
#

Py cord is installed lol

potent mulch
#

what the fuck is py-cord, i'm trying to understand it

buoyant quail
#

also discord-ui

shrewd fjord
#

Discord py message components, discord pu interaction

buoyant quail
#

discord.py-message-components=

shrewd fjord
#

💀

buoyant quail
#

a lot of

potent mulch
shrewd fjord
#

If its in venv delete the venv actually and install from scratch

naive briar
shrewd fjord
potent mulch
shrewd fjord
buoyant quail
#
pip uninstall discord-ui
pip uninstall discord.py-message-components
pip uninstall py-cord
pip uninstall discord-ui
pip uninstall discord.py
pip install discord.py -U

like this i guess
but easier will be recreate enviroment if you have it, that's true

shrewd fjord
#

pip install -U discord.py should do the trick of uninstalling it and reinstall it

#

It will uninstall and install the stable and latest version for you

harsh orbit
#

How I can make the bot break the while when a correct ID was sent

while True:
     try:
      server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)
      break
      b_guild = bot.get_guild(int(server_id.content))

     except asyncio.TimeoutError:
       await ctx.send("Time ended")
       break

     except ValueError:
       await ctx.send("Please send a correct Id")
       continue 
#

I tried
else:
Break

potent mulch
#

it works, thank you @shrewd fjord and @buoyant quail

#

that what i thought

potent mulch
#

I have the last question (for today lol), how do i add this to an embed message?

shrewd fjord
#

Add buttons?

potent mulch
#

ye

buoyant quail
shrewd fjord
#

^

potent mulch
#

mh

#

what's that?

shrewd fjord
#

!d discord.ui.View

unkempt canyonBOT
#

class discord.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
shrewd fjord
#

!d discord.ui.Button

unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
buoyant quail
shrewd fjord
#

The link vitness gave is a example

potent mulch
shrewd fjord
#

Nop

buoyant quail
potent mulch
#

alr

vital nest
#

hello can i get help for my bot i whant to add a comand so it talks the the ai in a script and the rest is normal

shrewd fjord
#

discord.py is continued by Danny again if u dont know

buoyant quail
#

again?

#

is there some post?

ember mango
#
        emb = disnake.Embed(color=0xff0000)
        emb.add_field(name='Error', value="Invalid round id")
        await ctx.response.send_message(embed=emb)
    if round_length > 36:
       emb = disnake.Embed(color=0xff0000)
       emb.add_field(name='Error', value="Invalid round id")
       await ctx.response.send_message(embed=emb)```
Wrong?
vital nest
#

a harmless bot

ember mango
#

idk he say error

buoyant quail
#

Show it then

vital nest
buoyant quail
#

no

#

Unknow 404

ember mango
# buoyant quail no

File "C:\python\Lib\site-packages\disnake\ext\commands\slash_core.py", line 737, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: cannot access local variable 'count' where it is not associated with a value

harsh orbit
vital nest
ember mango
harsh orbit
#

@buoyant quail
Can you see my question please

buoyant quail
#

The thing Spooky suggested looks fine

harsh orbit
#
while True:
    try:
      server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)
      b_guild = bot.get_guild(int(server_id.content))
      break
    

    except asyncio.TimeoutError:
      await ctx.send("Time ended")
      break

    except ValueError:
      continue 

#

Didn't work

buoyant quail
#

Did it get the message?

#

Add debug print

harsh orbit
#

For b_guild?

buoyant quail
#

for server_id

#

for b_guild too maybe

harsh orbit
#

It printed them both

buoyant quail
#

Then it surely should exit the loop

#

How do you check that it's still running?

harsh orbit
#

Cause when the Id is sent there another things happens

#

Wanna see the code?

buoyant quail
#

Show it

harsh orbit
#
while True:
    try:
      server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)
      b_guild = bot.get_guild(int(server_id.content))
      print(server_id.content)
      print(b_guild)
      break
    

    except asyncio.TimeoutError:
      await ctx.send("Time ended")
      break

    except ValueError:
      continue 

  else:
     
     if b_guild == None:
      await ctx.send("you enterd a wrong id please try again")
     else:
      guild = bot.get_guild(1142023460533571635)
      probot = guild.get_member(282859044593598464)
      bank_id = 1113386046021963776
      bank = guild.get_member(bank_id)
      price = count*700
      tax = price / 0.95
      tax = ceil(int(tax))
      await ctx.send("لقد قمت بإدخال ايدي صحيح ✅\n يرجى التحويل لإتمام عملية الشراء")
      await ctx.send(f"c {bank_id} {tax}")
      try:
        bot.wait_for("message", check= lambda m: m.author == probot and m.channel == ctx.channel and str(price) in m.content and bank.mentioned_in(m))

      except asyncio.TimeoutError:
        await ctx.send("Time ended")
#

It was working perfectly before add the while

buoyant quail
#

When you break you are exiting it without going into else

#

also there is some strange indentation

harsh orbit
#

Should I add else in while?

harsh orbit
buoyant quail
#
while True:
    try: # 4 spaces
  else: # 2 spaces
buoyant quail
harsh orbit
#

Cause I'm in phone

harsh orbit
buoyant quail
#

I'd replace break to return in TimeoutError
And put everything that goes after the loop outside the else

harsh orbit
#

I will try that

#

When I removed the else it worked but another problem happend

#
  while True:
    try:
      server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)
      b_guild = bot.get_guild(int(server_id.content))
      print(server_id.content)
      print(b_guild)
      break
    

    except asyncio.TimeoutError:
      await ctx.send("Time ended")
      return 

    except ValueError:
      continue 

  
     
  if b_guild == None:
    await ctx.send("you enterd a wrong id please try again")
  else:
    guild = bot.get_guild(1142023460533571635)
    probot = guild.get_member(282859044593598464)
    bank_id = 1113386046021963776
    bank = guild.get_member(bank_id)
    price = count*700
    tax = price / 0.95
    tax = ceil(int(tax))
    await ctx.send("لقد قمت بإدخال ايدي صحيح ✅\n يرجى التحويل لإتمام عملية الشراء")
    await ctx.send(f"c {bank_id} {tax}")
    try:
      bot.wait_for("message", check= lambda m: m.author == probot and m.channel == ctx.channel and str(price) in m.content and bank.mentioned_in(m))

    except asyncio.TimeoutError:
      await ctx.send("Time ended")



    else:
      channel = bot.get_channel(1142023763936940052)
      await channel.send(f"$join {server_id.content} {count}")
#

Look at the last line

#

It should happen only of the bot.wait_for happend

#

But it happen when I send the id

shrewd fjord
#

!d discord.Client.wait_for

unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

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

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError) for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple) containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
shrewd fjord
#

its coroutine

buoyant quail
#

Not awaiting async function = just skipping it

vital nest
vital nest
buoyant quail
#

Your config seems to have nothing

#

Or just missing some keys

vital nest
#

like what ?

buoyant quail
#

bot_token, token, openai_api_key

#

Also it looks like errors from different codes

#

because bot_token and token are in the same place in the error

vital nest
#

yes just look at the last error

buoyant quail
#

ah, the last

vital nest
#

File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 186, in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
sys:1: RuntimeWarning: coroutine 'Client.run.<locals>.runner' was never awaited
PS C:\Users\SALAH\Desktop\bot\bot-main>

buoyant quail
#

If you are running bot from the async function, you need to use bot.start

#

If not, then bot.run

#

!d discord.ext.commands.Bot.start

unkempt canyonBOT
#

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

A shorthand coroutine for [`login()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.login) + [`connect()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.connect).
vital nest
#

how whould the line look like

vital nest
#
async def main():
    await init_db()
    await load_cogs()
    status_task.start()
    bot.start(config["token"])

if __name__ == "__main__":
    asyncio.run(main())```
buoyant quail
#

It's an async function

vital nest
buoyant quail
#

It's not related to bot programming

#

Async function can be used anywhere

vital nest
#

never used async func befor

#

now !

buoyant quail
#

!e

import asyncio


async def some_start():
    ...

async def main():
    some_start()

if __name__ == "__main__":
    asyncio.run(main())
unkempt canyonBOT
#

@buoyant quail :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | /home/main.py:8: RuntimeWarning: coroutine 'some_start' was never awaited
002 |   some_start()
003 | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
buoyant quail
#

Maybe with the warning you will guess what you need?

vital nest
#

it needs to be awited what does that mean

#

awated*

buoyant quail
#

You are "awaiting" 15 times in your code

vital nest
#

inow its bad

#

using chat gpt

buoyant quail
#

Second part of the message is bad
Awaiting is good - with it you can don't wait for some long operations and doing all the thing almost parallel (not parallel tho)

woven dew
#

Does discordpy support running two bots at the same time?

buoyant quail
#

Actually doesn't matters

#

Yes, it does. But it's not what you usually do

woven dew
#

With different api tokens

vital nest
#

so tell me @buoyant quail basicly to fix the code whats the ligne ineed to add/delete

buoyant quail
#

await bot.start(...)

buoyant quail
#

By "it does" i mean that you need to do it by yourself

Maybe threading
Or something like asyncio.gather, i am not sure

vital nest
#

so where :/ sorry for being dum

woven dew
vital nest
#

@buoyant quail ?

vale wing
#

Best way is separate processes for sure

buoyant quail
#

Where you have it without await.

vital nest
buoyant quail
#

await bot.start(config["token"])

vital nest
#

File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 2040, in change_presence
await self.ws.change_presence(activity=activity, status=status_str)
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'change_presence'

buoyant quail
#

@woven dew

import asyncio

import discord
from discord.ext import commands

intents = discord.Intents.all()
bot1 = commands.Bot(".!", intents=intents)
bot2 = commands.Bot(".!", intents=intents)


async def main():
    await asyncio.gather(bot1.start(TOKEN), bot2.start(TOKEN2))


asyncio.run(main())
vital nest
buoyant quail
#

Show full traceback

#

That line is not from your code

vital nest
#
Traceback (most recent call last):
  File "c:\Users\SALAH\Desktop\bot\bot-main\bot.py", line 228, in <module>
    asyncio.run(main())
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "c:\Users\SALAH\Desktop\bot\bot-main\bot.py", line 224, in main
    await status_task.start()
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\tasks\__init__.py", line 264, in _loop
    raise exc
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\tasks\__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
  File "c:\Users\SALAH\Desktop\bot\bot-main\bot.py", line 117, in status_task
    await bot.change_presence(activity=discord.Game(random.choice(statuses)))
  File "C:\Users\SALAH\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 2040, in change_presence
    await self.ws.change_presence(activity=activity, status=status_str)
          ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'change_presence```
cloud dawn
#

The bot isn't connected to Discord yet

#

You need to wait until it is ready

dusk dagger
#

You shouldn’t change presence on_ready though

buoyant quail
#

Also task.start is not a coroutine. Not need to await it

clear lark
#

Anyone know how to make a button add other buttons?

# Tried to remove all the fluff code thats not needed for assistance
class ViewFunction(View):
    @discord.ui.button(label='Button One')
    async def adder_button_callback(self, interaction, button):
        # add other buttons
    
    @discord.ui.button(label='Other Button One')
    async def otherone_button_callback(self, interaction, button):
        # button one stuff

    @discord.ui.button(label='Other Button Two')
    async def othertwo_button_callback(self, interaction, button):
        # button two stuff

class cog_name(commands.Cog):
    def __init__(self, CLIENT):
        self.CLIENT = CLIENT
    @commands.command(hidden=True)
    async def command(self, ctx):
        VIEW = ViewFunction()
        # command stuff
buoyant quail
#

wdym by add other buttons?
like you press the button, message is edited and there are more buttons after that?

vital nest
#

...

clear lark
vital nest
cloud dawn
dusk dagger
clear lark
cloud dawn
clear lark
#

I've never used ChatGPT for this project, I have for when I was messing around with Flask, but not this

dusk dagger
cloud dawn
vital nest
#

i dont now what to how to use anny of this discord bot shenanigan

dusk dagger
vital nest
buoyant quail
#

!d discord.ui.View.add_item

unkempt canyonBOT
#

add_item(item)```
Adds an item to the view.

This function returns the class instance to allow for fluent-style chaining.
buoyant quail
dusk dagger
vital nest
#

python object oreientation programing

dusk dagger
vital nest
#

yeah in the tutorial was like that

vital nest
#

i got this thout

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

# Load configuration from JSON file
with open("config.json", "r") as config_file:
    config = json.load(config_file)

# Discord bot setup
intents = discord.Intents.default()
bot = commands.Bot(command_prefix=config["prefix"], intents=intents)

# OpenAI setup
openai.api_key = config["api_key"]

class Chatbot:
    @staticmethod
    def get_response(prompt):
        response = openai.Completion.create(
            model="text-davinci-003",
            prompt=prompt,
            temperature=2,
            max_tokens=1024,
            top_p=0.3,
            frequency_penalty=0.5,
            presence_penalty=0
        )
        return response.choices[0].text.strip()

@bot.event
async def on_ready():
    print(f'Logged in as {bot.user.name}')

@bot.command()
async def ohslim(ctx, *, user_input):
    prompt = f"User: {user_input}\nSlimy:"
    response = Chatbot.get_response(prompt)

    await ctx.send(response)

# Run the bot
bot.run(config["token"])
vital nest
buoyant quail
#

I made an ai be like: import openai

vital nest
#

oh you havent seen this ai

#

not THIS

vital nest
#

its unhacable

#

for some dam reason

buoyant quail
#

I mean, that you didn't make an ai at all. You just used the ready ai with api

vital nest
#

no i trained it

buoyant quail
#

But you still used a ready one ¯_(ツ)_/¯

dusk dagger
#

You should really never have to use change_presence unless within a command, or maybe an eval. If you want to have a set presence when your bot is online, set the activity and status kwargs in the constructor of these Classes.
bot = commands.Bot(command_prefix="!", activity=..., status=...)
I'm assuming you were maybe trying to change the presence on_ready, which you shouldn't be making api requests on_ready because Discord has a high chance to completely disconnect you during the READY or GUILD_CREATE events (1006 close code) and there is nothing you can do to prevent it.

#

^ if you'd still like to change your presence

vital nest
buoyant quail
#

I don't need it

vital nest
#

ok

#

so back to topic

#

what to add to this ? i have this code that is working to save some sanity ```py
import os
import json
import openai
import discord
from discord.ext import commands

Load configuration from JSON file

with open("config.json", "r") as config_file:
config = json.load(config_file)

Discord bot setup

intents = discord.Intents.default()
bot = commands.Bot(command_prefix=config["prefix"], intents=intents)

OpenAI setup

openai.api_key = config["api_key"]

class Chatbot:
@staticmethod
def get_response(prompt):
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
temperature=2,
max_tokens=1024,
top_p=0.3,
frequency_penalty=0.5,
presence_penalty=0
)
return response.choices[0].text.strip()

@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name}')

@bot.command()
async def ohslim(ctx, *, user_input):
prompt = f"User: {user_input}\nSlimy:"
response = Chatbot.get_response(prompt)

await ctx.send(response)

Run the bot

bot.run(config["token"])

dusk dagger
#

What are you looking to add?

#

Also, what's the point of having your prefix in a config file?

vital nest
dusk dagger
#

No point in making a ban command when discord made one for you

vital nest
#

no i mean for swearing

#

interacting with people custum warning thats the stuff

dusk dagger
#

I have no clue what you mean

vital nest
#

got dam it

#

a bot that warns people to not swear and bans after warning idk what do people use bots for

dusk dagger
#

The discord client has a built-in automod

vital nest
#

so why dopeople make discord bots !

vital nest
dusk dagger
vital nest
#

like what

#

oh

vital nest
# dusk dagger there's millions of other reasons other than automod lmao

i see
Moderation: Bots can help moderate servers by enforcing rules, muting or banning users who violate guidelines, deleting inappropriate content, and issuing warnings.

Automated Tasks: Bots can automate routine tasks such as giving users roles, managing server announcements, posting scheduled messages, and organizing events.

Information Retrieval: Bots can fetch information from external sources or APIs, provide weather updates, currency conversion, time zones, Wikipedia summaries, and more.

Fun and Entertainment: Bots can offer games, quizzes, trivia, and other interactive activities to engage server members and provide entertainment.

Music: Music bots can play music from various sources, create playlists, and manage music-related commands.

Utilities: Bots can provide utilities such as calculators, language translation, URL shortening, and other tools.

Custom Commands: Bots can be programmed to respond to custom commands with specific actions or messages.

Reaction Roles: Bots can assign roles to users based on their reactions to specific messages. This is often used for assigning game roles, language roles, or interest-based roles.

Server Statistics: Bots can provide server statistics, member counts, and other data to help server administrators monitor server activity.

Reminders: Bots can create reminders for users, helping them remember important dates, events, or tasks.

Economy and RPG: Economy bots simulate an in-server economy where users earn and spend virtual currency. RPG bots offer role-playing game elements within the server.

cloud dawn
vital nest
#

😢

cloud dawn
#

@vital nest I meant that this code will never run sicne you need message intents because you are using message commands.

vital nest
cloud dawn
#

Also not sure why you are using a class for only one function.

vital nest
#

for future onse

cloud dawn
vital nest
cloud dawn
#

That makes no sense

vital nest
#

how whould you do it

cloud dawn
#

!intents

unkempt canyonBOT
#
Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.

cloud dawn
#

Like this ```py
intents = Intents.default()
intents.message_content = True

#

Not too sure why yours works but I think you updated it then.

vital nest
#

could you rewrite the code like a humain would or just add it because i lost my code

cloud dawn
#

Well the json stuff isn't something that I would use but I will send the code on how I would write it whit the current code that's there.

cloud dawn
# vital nest could you rewrite the code like a humain would or just add it because i lost my...
import os
import json
import openai
import discord

from discord import Intents
from discord.ext.commands import Bot, Context

# Load configuration from JSON file
with open("config.json", "r") as config_file:
    config = json.load(config_file)

# Discord bot setup
intents = Intents.default()
intents.message_content = True

bot = Bot(command_prefix=config["prefix"], intents=intents)

# OpenAI setup
openai.api_key = config["api_key"]

def get_response(prompt: str) -> None:
  return openai.Completion.create(
      model="text-davinci-003",
      prompt=prompt,
      temperature=2,
      max_tokens=1024,
      top_p=0.3,
      frequency_penalty=0.5,
      presence_penalty=0
  ).choices[0].text.strip()

@bot.event
async def on_ready() -> None:
    print(f'Logged in as {bot.user.name}')

@bot.command()
async def ohslim(ctx: Context, *, user_input: str) -> None:
    prompt = f"User: {user_input}\nSlimy:"
    await ctx.send(get_response(prompt))

# Run the bot
bot.run(config["token"])
#

Scroll up a bit there is an example there.

cloud dawn
naive briar
#

a bit, really

cloud dawn
naive briar
#

That's why you shouldn't watch YouTube tutorials

cloud dawn
#

Could be an older video, in previous version intents wasn't required. Your video is about 1/2 years old then

naive briar
#

Most are outdated for years

cloud dawn
#

Yeah I'd always filter on "last 6 months" at most.

naive briar
#

Mandatory intents argument stuff is 2022 thing

cloud dawn
#

Well you can still just pass 0 and it should work but yeah.

vital nest
cloud dawn
#

Why is that an issue, can't you update it?

cloud dawn
#

Use linux then lol

#

Every pc can run linux.

#

Did you change the boot order?

#

Did you try to remove the OS drive?

#

I had a laptop that also was frisky about the os drive, I just wiped it whit another PC and then inserted the empty drive.

#

So I don't see it beeing an issue.

#

That's uhhh, ancient..

#

Good OS tough

naive briar
#

You just leaked your bot's token

cloud dawn
#

Was boutta say

#

And could you please at least look before posting again since we don't condone any form of nazism here.

#

on_read() not just the event name.

thin raft
#

code?

vital nest
#

can i make this bot exute a comand ```py
@bot.command()
async def ohslim(ctx: Context, *, user_input: str) -> None:
prompt = f'...'
answer = "!ohslim "+"User: "+user_input+" Slimmy: "+ get_response(prompt)
print (str(answer))
await ctx.send(answer)

buoyant quail
#

Store joined users in that button view

harsh orbit
#

How I can make the bot reply to a message?

thin raft
#

!d discord.Message.reply

unkempt canyonBOT
#

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

A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send) to reply to the [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message).

New in version 1.6.

Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError) or [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) instead of `InvalidArgument`.
harsh orbit
#

How I can get message?

#
  • how I can make. Command work only in a specific server
prisma bluff
buoyant quail
harsh orbit
#

Yup good idea

harsh orbit
#

Is that need to await?

buoyant quail
#

!d discord.TextChannel.fetch_message

unkempt canyonBOT
#

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

Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message) from the destination.
dusk dagger
# harsh orbit Is that need to await?

Typically anything with fetch is awaited because it’s making an API request. get_x and utils.get are not awaited because they simply are getting data from the internal dpy cache.

prisma bluff
#

utils.get is independent to anything client-related and can actually be awaited if it was passed an async iterable

lyric sigil
#

hey gys , i have this part of my embed line that is not working


color=colour.red
#

how do i make it work ?

buoyant quail
#

What is colour variable?

#

!d discord.Colour

unkempt canyonBOT
#

class discord.Colour(value)```
Represents a Discord role colour. This class is similar to a (red, green, blue) [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple).

There is an alias for this called Color...
harsh orbit
#

@guild_only()

prisma bluff
#

it just a decorator u add-on

lyric sigil
buoyant quail
#

guild_only is not what he wants tho

harsh orbit
orchid ridge
#

Hey good evening everyone newbie here

buoyant quail
#

he want to make it work for one single guild

dusk dagger
harsh orbit
harsh orbit
buoyant quail
#

write your custom check

prisma bluff
#

ohh

lyric sigil
#

invalid syntax

prisma bluff
lyric sigil
dusk dagger
lyric sigil
buoyant quail
#

It's the definition
You are not supposed to create a class

lyric sigil
#

bruh

#

wait

buoyant quail
#

you import it
from discord

dusk dagger
lyric sigil
#

i forgot to delete sum in my code

dusk dagger
#

What is this color for?

buoyant quail
dusk dagger
#

An embed

lyric sigil
#

yes

dusk dagger
#

All you had to do was replace it with color=discord.Colour.red()

lyric sigil
#

working thx !

#

But why 1 times on 2 the command is not working

#

like its workingg and when i retry it i have this error

ember mango
#

Hello anyone know command just one channel use>

lyric sigil
#
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\discord\app_commands\tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "C:\Python311\Lib\site-packages\discord\app_commands\commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'status' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
#

@dusk dagger

ember mango
#

for example i cant here use command

lyric sigil
#

in my command

#
@client.tree.command(name="status")
async def status(interaction: discord.Interaction):
        embed=discord.Embed(title="**I'm checking the status...**",description="The server is ON :green_square: \n \n To connect , just go on the #𝗛𝗼𝘄-𝘁𝗼-𝗰𝗼𝗻𝗻𝗲𝗰𝘁 channel." , color=discord.Colour.green())
        await interaction.response.send_message(embed=embed)
dusk dagger
#

alright

lyric sigil
#

bruh

dusk dagger
#

never used this bot mb

lyric sigil
#

so u dk how to ?

ember mango
dusk dagger
ember mango
dusk dagger
#

i don’t understand your question

#

explain a little more

ember mango
#

i create 2 channel one more general chat no one can use command and one more bot command evryone can use

#

@dusk dagger

dusk dagger
#

Are you using slash or prefix commands?

ember mango
#

both

dusk dagger
#

for slash you can just use the integrations tab

dusk dagger
#

And hide the commands from said channel

ember mango
#

But how fix no one can use just one channel?

dusk dagger
#

You want only one channel for commands? Sorry, it’s a bit hard to understand your english

lyric sigil
#

okay perfectly working now thx

ember mango
# lyric sigil okay perfectly working now thx
      await ctx.send(embed=em)
    else:
     response = await ctx.send("You can't use this command in this channel.")
     await asyncio.sleep(5)  # Wait for 5 seconds
     await response.delete()  # Delete the bot's message```
#

Why did not delete?

lyric sigil
dusk dagger
#

It’s much easier imo

ember mango
dusk dagger
#

await ctx.send("…", delete_after=5)

ember mango
humble lily
#

!d discord.Interaction

unkempt canyonBOT
#

class discord.Interaction```
Represents a Discord interaction.

An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.

New in version 2.0.
harsh orbit
#

How I can also set continue when the id is None
I tried to put the if condition in the while but the command didn't work when I did that

#
while True:
      try:
        server_id = await bot.wait_for("message", check=lambda m: m.channel == ctx.channel and m.author == ctx.author, timeout=300.0)
        b_guild = bot.get_guild(int(server_id.content))
        break
    

      except asyncio.TimeoutError:
        await ctx.send("Time ended")
        return 

      except ValueError:
        continue 

      if b_guild == None:
       await ctx.send("you enterd a wrong id please try again")
        
       continue 
       
      else:
       guild = bot.get_guild(1142023460533571635)
       probot = guild.get_member(282859044593598464)
       bank_id = 1113386046021963776
       bank = guild.get_member(bank_id)
       price = count*member_price
       tax = price / 0.95 + 1
       tax = ceil(int(tax))
       await ctx.send("لقد قمت بإدخال ايدي صحيح ✅\n يرجى التحويل لإتمام عملية الشراء")
       await ctx.send(f"c {bank_id} {tax}")
       try:
         await bot.wait_for("message", check= lambda m: m.author == probot and m.channel == ctx.channel and str(price) in m.content and bank.mentioned_in(m))

       except asyncio.TimeoutError:
         await ctx.send("Time ended")

       else:
           channel = bot.get_channel(1142023763936940052)
           await channel.send(f"$join {server_id.content} {count}")
         

Like this the command never working

novel apexBOT
#

This is not a Modmail thread.

harsh orbit
#

؟

final iron
harsh orbit
#

No errors + you can read my first message to know my question what is

final iron
#

Okay, that still doesn't describe what "Like this the command never working" means

#

There could be so many different meanings to that

harsh orbit
#

Broooo

final iron
#

Again, "didn't work when I did that" has many different meanings

#

Explain what actually hapened

harsh orbit
#

You can see in my message what "that" means

harsh orbit
final iron
#

Finally

#

So, remove your error handlers and send the traceback

harsh orbit
#

._.

#

Bro

#

I want

#

When the id is None the bot continue and not break the waiting so I tried to set the if condition in the while but that's broked the command(no errors + I don't have handlers)

#

I said this literally in my first message

final iron
#

You do have error handlers

#

You shared the code

harsh orbit
#

Do wanna to see the full code?

final iron
#

No, you already shared the portion of the code with error handlers

#

Remove the error handlers, send the traceback and send the code with the if statement

harsh orbit
#

Bro the problem is clear

#

The bot are stays in the loop and don't continue

#

I just want to know why this happening

final iron
#

Remove your error handlers and if there's a traceback send it...

harsh orbit
#

Ahhhhhhhhhhhhh

final iron
#

There's a high likelyhood if there's a traceback it'll show the issue

harsh orbit
#

You mean the except?

final iron
#

That is an error handler, yes

harsh orbit
#

Bro you can read the except what do

#

It's time error + value

#

And both not happening

harsh orbit
final iron
#

Alright, if you want to figure it out by yourself, sure

harsh orbit
#

I will remove it just for prove this to you