hippietrail
hippietrail
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
Nomadding in Southeast Asia. My bot was working fine in Thailand but gets intermittent unknown interaction errors a lot here in Laos. Chased it for a couple of days looking at the usual reasons it occurs but it seems I'm getting it at the beginning of my handler where I do deferReply which does not seem to be among the usual causes. Internet here is a bit laggy/bursty I suppose. Is there a way to check whether my interaction is still valid or can I only catch the exception when I try to use it? If exception is the only way, what's the elegant way? I can't return from .catch() since it's a closure. Putting it all in try/catch would lump this expected exception in with random exceptions which doesn't feel right. I don't think I can put the rest of the handler inside .then()
9 replies
DIAdiscord.js - Imagine an app
Created by hippietrail on 1/4/2024 in #djs-questions
How to add support for private slash commands
Not a big Discord user so lots of common stuff I don't know. But I've made a bot for use just in one channel with a couple of friends. I have slash commands working and I've experimented enough to send and receive DMs. But now I want to add support slash commands in DMs. I can't seem to find the next step via Google, the official docs, Stack Overflow, searching this discord, or asking AI chatbots. Do I have to modify some stuff on my bot's dev page? Pass some more settings in new Client() in my bot code? Or both?
13 replies