#Trying to Bulk sync all my commands.
1 messages · Page 1 of 1 (latest)
If you're getting ratelimited, you're doing something wrong
You have too many commands and you're starting the bot too many times
You won't be able to sync a command if you're ratelimited
1 or 200, if you're ratelimited the api will just reject you
thats what i am attempting to figure out, wdym too many commands?, ive seen bots with way more commands.
That's how ratelimits work
You can register like 100 commands per day
If you constantly run and stop the bot, you're syncing commands constantly
So i am likely docked for the day.
all i am told is i got 320 ish sec ratelimited.
Show the error
WARNING:http:333:discord.http: We are being rate limited. Retrying in 432seconds. Handled under the bucket "None:None:/applications/{application_id}/commands"
Discord bot creation is something i just jumped headfirst into, so i am still getting attempting to get the hang of this.
Doesn't look like the daily ratelimit
Well you still got ratelimited for other reason
i have restarted my bot around 24 times today to debug and test.
that might be the issue.
@mint ginkgo could tell what it exactly is
i actually dont really know how to actually properly register my command with my dev server, cant figure out head or tails on the pycord docs
The library syncs the commands for you
on_connect calls bot.sync_commands
You don't have do do anything
If you want to quickly register slash cmds in your dev server for testing, you can pass debug_guilds to the bot init which is a list of ints
i don't suppose you have some samplecode i can fiddle with?, like an old blank piece of code i can test to get the hang of it?
You can try just a normal bot
bot = discord.Bot(debug_guilds=[12345])
@bot.command()
async def hello(ctx)
await ctx.respond("Hello")
bot.run("...")```
this is / command right?
i've been doing
import json
import os
class CharacterCreation(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(name="Testchar", description="Create a new character")
async def character_creation(self, ctx, picture_url: str, first_name: str, last_name: str, age: int, race: str, description: str, backstory: str):
await ctx.defer(ephemeral=True)
folder_path = f"./bot/commands/characters/storage/{ctx.author.id}"
os.makedirs(folder_path, exist_ok=True)
# Save character info
character_info = {
"picture_url": picture_url,
"first_name": first_name,
"last_name": last_name,
"age": age,
"race": race,
"description": description,
"backstory": backstory,
}
with open(f"{folder_path}/{first_name}.json", "w") as f:
json.dump(character_info, f)
await ctx.followup.send(f"Character {first_name} {last_name} created successfully.", ephemeral=True) # Only visible to the user
def setup(bot):
bot.add_cog(CharacterCreation(bot))```
Looks good to me
idk where i am going wrong then because none of my commands are syncing.
Issue has been fixed after i fed it to GPT 4 as well as CI