Skip to content

Instantly share code, notes, and snippets.

View cibere's full-sized avatar
🐕
playing with my dog

cibere cibere

🐕
playing with my dog
  • Planet Earth
View GitHub Profile
@cibere
cibere / defer_resp.md
Created September 10, 2023 16:11
Discord.py defer response

The Defer Response

The defer response, defers the interaction response. This is typically used when the interaction is acknowledged and an optional secondary action will be done later. When deferring, you get up to 15 minutes to respond instead of the normal 3 seconds.

This response is only supported if the interaction is an application command, component/view, or a modal.

Followups

import discord
import random
intents = discord.Intents.default()
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'Logged in as {client.user.name} (ID: {client.user.id})')
@cibere
cibere / dont_auto_sync.md
Last active November 8, 2022 01:08
Don't Auto Sync :D

Auto Syncing (your command tree) Sucks, and here's why:

Syncing your command tree automatically causes extra unnecessary requests to be made, this is because you only need to sync when commands are updated. *see when you should sync for a more enunciated list on when to sync.

What syncing does is send your commands to discord for one guild or globally. If you haven't changed your command's descriptions, added/removed commands, changed names, parameters, etc. you shouldn't sync, since you'd only be updating discord with the commands they already have without doing any changes, which is pointless and a waste of an API request to a limit with an already tight rate limit. *see what syncing is for a more enunciated on what syncing is, and how to do so.

Where should I sync instead? It's better to sync using a nor