Yuuki | ユウキ
Yuuki | ユウキ
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 8/21/2023 in #djs-questions
Optimizing Image Processing, Storage, and Strategies to Prevent Alts and Botting: Seeking Advice
Oops wrong forum Sadge
3 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/30/2023 in #djs-questions
[CLOSED] Question regarding Unicode and Custom emojis
Oh yeah. Thanks!
9 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/30/2023 in #djs-questions
[CLOSED] Question regarding Unicode and Custom emojis
I guess I could just do a regex / length check to see if it is a normal unicode emoji or a guild emoji.
9 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/30/2023 in #djs-questions
[CLOSED] Question regarding Unicode and Custom emojis
9 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/30/2023 in #djs-questions
[CLOSED] Question regarding Unicode and Custom emojis
My question is how could I check if an emoji is a valid discord unicode emoji like :fire: :one: and so on?
9 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/30/2023 in #djs-questions
[CLOSED] Question regarding Unicode and Custom emojis
Yeah, I'm sorry. I was talking about guild emojis using the format you mentioned.
9 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
I learned some new things though so thanks again! lovge
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
also, how did I miss this lmao Before I switched to using typescript in this project I was using inter.member.user to get the user since the member property exists on both command types. But now I can just simply use (inter instanceof ChatInputCommandInteraction) ? (inter.user.id ) : inter.author.id; KEKW
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
Yea, well.. it is definitely a crazy idea to handle both type of commands in the block/file, but I didn't want to write separate code for each of them, now I can just set what type of the command is (normal, slash or both) and handle them at the same time. I also thought about merging the types but that would just make me more work.. as you said, replying would be some next level devilish thing pepeChrist
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
Ahh nice! Forgot about the nullish coalescing op or whatever it is called. I also have to check if "inter" is an instance of ChatInputCommandInteraction to use the inChachedGuild typeguard right?
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
(I'm casting the avatar url to a string since the property "iconURL" in the setAuthor() fn only accepts a string | undefined and not string | null)
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
14 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
lmao, since I'm now using the ChatInputCommandInteraction and not CommandInteraction I don't have to handle OptionResolvers like I did when I wrote the post, so you're right. This is the best solution handling them!
const testArg = (inter instanceof ChatInputCommandInteraction) ? inter.options.getString('testarg', true) : args[0];
const testArg = (inter instanceof ChatInputCommandInteraction) ? inter.options.getString('testarg', true) : args[0];
Many thanks!
14 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
Property 'cmds' does not exist on type 'Client<boolean>'
Ohh, someon answered already, my bad ohnocat
9 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
Property 'cmds' does not exist on type 'Client<boolean>'
I can give you the straight up solution as well if you want to.
9 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
Property 'cmds' does not exist on type 'Client<boolean>'
9 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
Property 'cmds' does not exist on type 'Client<boolean>'
You can probably just make your own interface that extends the discord.js Client.
9 replies
DIdiscord.js - Imagine ❄
Created by KaktusgamingYT on 7/29/2023 in #djs-questions
Cannot read properties of undefined (reading 'applicationGuildCommands')
at line
Routs.applicationGuildCommands
Routs.applicationGuildCommands
6 replies
DIdiscord.js - Imagine ❄
Created by KaktusgamingYT on 7/29/2023 in #djs-questions
Cannot read properties of undefined (reading 'applicationGuildCommands')
There is a typo in your code.
6 replies
DIdiscord.js - Imagine ❄
Created by Yuuki | ユウキ on 7/28/2023 in #djs-questions
[CLOSED] A question regarding discord.js with types. (TypeScript)
Hmm.. I could just do it like
const testarg = (<ChatInputCommandInteraction>inter).options.getString('testarg', true) || args[0];
const testarg = (<ChatInputCommandInteraction>inter).options.getString('testarg', true) || args[0];
instead of
const testarg = (<ChatInputCommandInteraction>inter).isChatInputCommand() ? (<ChatInputCommandInteraction>inter).options.getString('testarg', true) : args[0];
const testarg = (<ChatInputCommandInteraction>inter).isChatInputCommand() ? (<ChatInputCommandInteraction>inter).options.getString('testarg', true) : args[0];
is this a bad approach?
14 replies