AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Slash parents4/5/2023 When I print the ctx, the channel is None for the 1st request but isn't for the next ones. I get this error when I start the server. When I run the same code as a regular command, (removing the components parts) it works flawlessly. Not sure what is happening, I have asked for help in several servers and nobody can figure it out. I get this error when I run this code, I even added print("number") after every step and it doesn't print anything. # fetch the emoji asset and read it as bytes.Īwait _custom_emoji(name=emoji_final.name, image=emoji_bytes, roles=emoji_roles)Īwait ctx.send("Created emoji!", ephemeral=True) (User must have this role to use emoji)", OptionType.ROLE)], def steal(self, ctx, emoji, role):Ĭ = commands.EmojiConverter() # create instance Option("role", "A role to lock this emoji to. Opened by yamikaitou def an emoji with an option to lock it to a role", options=[Option("emoji", "an emoji to steal", OptionType.STRING, required=True), Jun 16 02:15:32 python: raise NotFound(r, data) Jun 16 02:15:32 python: File "/home/red/envs/scgc/lib/python3.8/site-packages/discord/http.py", line 250, in request Jun 16 02:15:32 python: File "/mnt/discord/red-data/scgc/cogs/Downloader/lib/dislash/interactions/interaction.py", line 392, in fetch_initial_response Jun 16 02:15:32 python: return await self.fetch_initial_response() Jun 16 02:15:32 python: File "/mnt/discord/red-data/scgc/cogs/Downloader/lib/dislash/interactions/interaction.py", line 204, in reply Jun 16 02:15:32 python: await inter.reply(type=ResponseType.DeferredUpdateMessage) Jun 16 02:15:32 python: File "/mnt/discord/red-data/scgc/cogs/CogManager/cogs/rps/rps.py", line 143, in on_rock Maybe I'm missing something, I haven't fully explored everything yet Jun 16 02:15:32 python: Traceback (most recent call last): The App was originally personal but was moved to a team, so that is likely when it changed. Someone else suggested that it is likely due to the Bot's UserID not being the same as the ApplicationID. I've only messed with Buttons, but I consistently get Unknown Webhook on one bot. I can make a pull request to fix that if it would help, I just needed to know which route would you rather use to fix that (change dislash.py's implementation or adopt discord.py's function instead). If I change dislash's function to use either, or discord.py's implementation of snowflake_time, the problem goes away and the interaction is no longer considered expired on arrival. This differs from discord.py's implementation, which forces the timestamp to be calculated in UTC+0: def snowflake_time(id: int) -> datetime.datetime:Īn aware datetime in UTC representing the creation time of the snowflake. It seems interaction.expired uses interaction.created_at which in turn uses a dislash.py specific implementation of snowflake_time that does not force the timestamp to be created in UTC+0: Result of the logs show that the time being reported by interaction.created_at is not calculated as UTC. Vote | maybe_this_works | 50 | DEBUG | is sent: False Vote | maybe_this_works | 49 | DEBUG | is expired: True Output in logs: vote | maybe_this_works | 47 | DEBUG | snowflake time: T15:21:41.611000 bug("current time: " + dt.datetime.utcnow().isoformat()) bug("snowflake time: " + inter.created_at.isoformat()) The code i'm using to test this: slash commands",Īsync def maybe_this_works(self, inter:Interaction): When testing a simple slash command using dislash, when i get to the callback that handles the slash command, the interaction is already expired. It's assumed that you've already registered the command. You can always edit it if you want, using. You should register a slash-command only once in order to make it work. register_guild_slash_command( test_guild_id, sc) register_guild_slash_command for testing: await slash. # Discord API uploads GLOBAL commands for more than 1 hour # That's why I highly recommend. event async def on_ready():ĭescription = "Returns a random number from the given range",Īwait slash. ext import commands from dislash import slash_commands from dislash.
0 Comments
Read More
Leave a Reply. |