hippietrail
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
annoyingly today's café is less laggy/bursty so can't test it so far
9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
i don't fully grok the ramifications. by returning
null
i change the inferred type into a nullable aka InteractionResponse<boolean> | null
and i don't need to care what an InteractionResponse or the boolean
in it mean?9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
i don't
9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
just
let foo = await interaction.deferReply().catch(e => { return null; })
? seems that returns a InteractionResponse<boolean>
9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
I've only used try/catch prior to this problem which I tracked down when I discovered .catch() which I don't yet have a feel for
9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
i'm not quite expert level in js/ts yet. Not sure how to check for returning null from .catch
9 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 2/22/2024 in #djs-questions
How best to handle `unknown interaction` on `deferReply`
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
ah ok i just found that independently and it's working. this text made me wonder if it is a bit heavy handed
Guild-based deployment of commands is best suited for development and testing in your own personal server. Once you're satisfied that it's ready, deploy the command globally to publish it to all guilds that your bot is in.but i guess not as it's basically a private bot for my friends and one server so thanks everyone!
13 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 1/4/2024 in #djs-questions
How to add support for private slash commands
this is the video that was my starting point: https://www.youtube.com/watch?v=AvQcTjB3gPg
and its repo: https://github.com/CodingTrain/Discord-Bot-Examples/tree/main/01-discordjs
13 replies
DIAdiscord.js - Imagine an app
•Created by hippietrail on 1/4/2024 in #djs-questions
How to add support for private slash commands
i modified the
deploy-commands.js
from a Coding Train video to add support for multiple commands per module:
i only dug in and grokked enough to do my mods13 replies
TSDThe Swift Den
•Created by hippietrail on 9/9/2023 in #swift-development
Can progress reporting be added to this style of https transfer?
but it seems to actually be less effort to use the old continuation method and both ways are equally fast. here's the great answer I got on Stack Overflow
https://stackoverflow.com/a/77072098/527702
5 replies
TSDThe Swift Den
•Created by hippietrail on 9/9/2023 in #swift-development
Can progress reporting be added to this style of https transfer?
the answer is yes
instead of
use
then you can read the bytes byte-by-byte or line-by-line or probably other ways
or
then you can report progress either for each one, or keep track of how many calls/bytes/lines/etc or time elapsed to decide how often report progress
5 replies
TSDThe Swift Den
•Created by hippietrail on 9/9/2023 in #swift-development
Can progress reporting be added to this style of https transfer?
I'm assuming i'm going to need a delegate. but so for i've only used those in gui apps and i haven't found an example yet how to make/use one for my case
5 replies
TSDThe Swift Den
•Created by hippietrail on 9/9/2023 in #swift-development
Can progress reporting be added to this style of https transfer?
the code I started with was using a semaphore and I either assumed or read that was the old way and these days I should use
async
/await
. Other examples I can find are for GUI apps (I'm doing commandline); or they used RunLoop
, which I also assumed would be outdated5 replies
TSDThe Swift Den
•Created by iwontchill on 9/4/2023 in #swift-development
How to Rename a Project/App in Xcode
The way I do it is to close the project in Xcode and open it in VSCode where I do a search and replace in files. Carefully.
3 replies
TSDThe Swift Den
•Created by hippietrail on 8/27/2023 in #swift-development
How to position vertical Slider
Thanks. It's just for a toy project to help me learn my way around the UI so not a big deal. I will learn custom controls later.
25 replies
TSDThe Swift Den
•Created by hippietrail on 8/27/2023 in #swift-development
How to position vertical Slider
You can see the bounding box for the slider I want aligned on the right edge of the window does not match the slider itself.
25 replies
TSDThe Swift Den
•Created by hippietrail on 8/27/2023 in #swift-development
How to position vertical Slider
25 replies
TSDThe Swift Den
•Created by hippietrail on 8/27/2023 in #swift-development
How to position vertical Slider
Yes I could also get a vertical slider in the centre of the display, but being able to align it like any normal control was well beyond my abilities as a newcomer.
25 replies
TSDThe Swift Den
•Created by hippietrail on 8/27/2023 in #swift-development
How to position vertical Slider
Yes I found that one. Two answers involve custom slider libraries which will tend to have differences from the standard ones. The other one is much more promising involving swapping horizontal and vertical fields, but unlike native horizontal ones you have to pass the values in for those fields. And the newest comment on it says it doesn't work anymore.
I've concluded there isn't really a native solution and it's intentional. At first I thought they designed it so you would "just" rotate it, but now I can see there is no "just" (-:
25 replies