vekizxo
DIAdiscord.js - Imagine an app
•Created by vekizxo on 6/9/2024 in #djs-questions
timestamp
how can I get the current time and add a certain number of milliseconds to it to get a timestamp?
13 replies
DIAdiscord.js - Imagine an app
•Created by vekizxo on 6/9/2024 in #djs-questions
commands isnt work
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.execute (c:\Users\artem\Desktop\bot\commands\ban\ban.js:16:57)
at Client.<anonymous> (c:\Users\artem\Desktop\bot\index.js:40:17)
at Client.emit (node:events:519:28)
at InteractionCreateAction.handle (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (c:\Users\artem\Desktop\bot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at WebSocketShard.<anonymous> (c:\Users\artem\Desktop\bot\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (c:\Users\artem\Desktop\bot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.execute (c:\Users\artem\Desktop\bot\commands\ban\ban.js:16:57)
at Client.<anonymous> (c:\Users\artem\Desktop\bot\index.js:40:17)
at Client.emit (node:events:519:28)
at InteractionCreateAction.handle (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (c:\Users\artem\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (c:\Users\artem\Desktop\bot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at WebSocketShard.<anonymous> (c:\Users\artem\Desktop\bot\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (c:\Users\artem\Desktop\bot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
21 replies
DIAdiscord.js - Imagine an app
•Created by vekizxo on 3/24/2024 in #djs-questions
error
const { SlashCommandBuilder, PermissionFlagsBits, Client } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
const { intersection } = require('lodash');
let time = 'time1'
module.exports = {
data: new SlashCommandBuilder()
.setName('mute')
.setDescription('mute user'),
async execute(interaction) {
const permission = interaction.roles.cache.has('1221367123889094708');
if (!permission) {
await interaction.reply({ content: ':x: | No perms', ephemeral: true });
} else {
const muteEmbed = new EmbedBuilder()
.setColor('#37393d')
.setTitle(`Mute`)
.addUserOption(option => option.setName('user').setDescription('User'))
.addStringOption(option => option.setName('reason').setDescription('Reason'))
.addFields({name: 'user', value: `<@${user}>\n`})
.addFields({name: 'moderator', value: `<@${interaction.user.id}>\n`})
.addFields({name: 'time', value: `<@${time}>\n`})
.addFields({name: 'reason', value: `<@${reason}>\n`})
.setTimestamp()
await interaction.reply({ embeds: [muteEmbed] });
}
}
}
const { SlashCommandBuilder, PermissionFlagsBits, Client } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
const { intersection } = require('lodash');
let time = 'time1'
module.exports = {
data: new SlashCommandBuilder()
.setName('mute')
.setDescription('mute user'),
async execute(interaction) {
const permission = interaction.roles.cache.has('1221367123889094708');
if (!permission) {
await interaction.reply({ content: ':x: | No perms', ephemeral: true });
} else {
const muteEmbed = new EmbedBuilder()
.setColor('#37393d')
.setTitle(`Mute`)
.addUserOption(option => option.setName('user').setDescription('User'))
.addStringOption(option => option.setName('reason').setDescription('Reason'))
.addFields({name: 'user', value: `<@${user}>\n`})
.addFields({name: 'moderator', value: `<@${interaction.user.id}>\n`})
.addFields({name: 'time', value: `<@${time}>\n`})
.addFields({name: 'reason', value: `<@${reason}>\n`})
.setTimestamp()
await interaction.reply({ embeds: [muteEmbed] });
}
}
}
24 replies
DIAdiscord.js - Imagine an app
•Created by vekizxo on 3/24/2024 in #djs-questions
where is the error
const { SlashCommandBuilder, PermissionFlagsBits, Client } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ban')
.setDescription('Ban user'),
async execute(interaction) {
new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${interaction.user.username}`)
.setDescription(`Ban: ...`)
.setImage(`${interaction.user.avatar}`)
.setTimestamp()
await interaction.reply({embed});
}
}
const { SlashCommandBuilder, PermissionFlagsBits, Client } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ban')
.setDescription('Ban user'),
async execute(interaction) {
new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${interaction.user.username}`)
.setDescription(`Ban: ...`)
.setImage(`${interaction.user.avatar}`)
.setTimestamp()
await interaction.reply({embed});
}
}
71 replies