Astronaut
Astronaut
DIAdiscord.js - Imagine an app
Created by Astronaut on 9/30/2023 in #djs-questions
How to register slash commands in Typescript
I tried to follow this guide but it didn't seem like using Typescript... Maybe I can just make another project with Javascript so I can follow the guide but I'm using Typescript not just because of making a bot to use in discord but also wanted to improve my Typescript skill and comprehension of Javascript and Typescript...
5 replies
DIAdiscord.js - Imagine an app
Created by Astronaut on 9/30/2023 in #djs-questions
How to register slash commands in Typescript
It wasn't like this before I try to apply this(https://stackoverflow.com/questions/68431146/use-slash-commands-in-all-servers-where-have-a-bot-without-guildid-discord-js-v) solution to my code... thats my fault I put the wrong code on my question... Here is the previous one which replies to a certain message without slash command. message.ts
import { event, Events } from '../utils/index.js';

export default event(Events.MessageCreate, ({ log }, msg) => {
if(msg.content == 'ping') {
return msg.reply('pong');
}
})
import { event, Events } from '../utils/index.js';

export default event(Events.MessageCreate, ({ log }, msg) => {
if(msg.content == 'ping') {
return msg.reply('pong');
}
})
5 replies