mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
Added Interaction integration
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
const { Interaction } = require('../structures/types');
|
||||
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
module.exports = /** @param {Interaction} interaction */ async (interaction) => {
|
||||
interaction.reply({content: "HELLO WORLD", ephemeral: true});
|
||||
await delay(3000);
|
||||
interaction.update({content: "NOOOOOOOOOOOOOOOOOO"});
|
||||
await delay(2000);
|
||||
const response = await interaction.followUp("followup!");
|
||||
await delay(2000);
|
||||
response.delete();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
const {message, Embed, messageChannelTypes} = require('../structures/types');
|
||||
|
||||
module.exports = /** @param {message} message */ async (message) => {
|
||||
if (message.type == messageChannelTypes.DM) {
|
||||
const embd = new Embed()
|
||||
.setTitle("hello world")
|
||||
.setDescription("dkjhfslkjdfhjldsjhfkzdjhflkdsjhfdsjhfkdsjf");
|
||||
|
||||
const response = await message.channel.send({ content: "FDJHKSJDFHLKJDSHFLKJSDHFKDSJHFD", embeds: [embd] });
|
||||
console.log(response);
|
||||
await delay(2000);
|
||||
|
||||
const response2 = await message.reply({content: `You said "${message.content}"!`, embeds: [embd]});
|
||||
console.log(response2);
|
||||
await delay(2000);
|
||||
|
||||
const response3 = await response.edit("KAT");
|
||||
console.log(response3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
const { Client, gateWayIntents, message, Interaction } = require('../structures/types');
|
||||
const { bottoken } = require('../config.json');
|
||||
|
||||
|
||||
var c = new Client({
|
||||
intents: [
|
||||
gateWayIntents.Guilds,
|
||||
gateWayIntents.GuildMessages,
|
||||
gateWayIntents.GuildMessageReactions,
|
||||
gateWayIntents.GuildVoiceStates,
|
||||
gateWayIntents.GuildEmojisAndStickers,
|
||||
gateWayIntents.GuildPresences,
|
||||
gateWayIntents.GuildMembers,
|
||||
gateWayIntents.DirectMessages,
|
||||
gateWayIntents.DirectMessageReactions,
|
||||
gateWayIntents.DirectMessageTyping,
|
||||
gateWayIntents.MessageContent
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
c.login(bottoken);
|
||||
|
||||
|
||||
c.on('messageRecieved', /**@param {message} message*/ async (message) => {
|
||||
require('./messageTests.js')(message);
|
||||
});
|
||||
|
||||
|
||||
c.on('interactionRecieved', /** @param {Interaction} interaction*/ async (interaction) => {
|
||||
require('./interactionTests.js')(interaction);
|
||||
});
|
||||
|
||||
|
||||
c.on('ready', () => {
|
||||
console.log("BOT ONLINE!");
|
||||
});
|
||||
Reference in New Issue
Block a user