keekztah
keekztah
DIAdiscord.js - Imagine a bot
Created by keekztah on 8/1/2023 in #djs-questions
send a message to random channel on join
if my bot has permissions, how can i make it so that it sends a message to a random channel when joining a server?
22 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 7/4/2023 in #djs-questions
blacklist system not working
const { model, Schema } = require('mongoose');

let blacklist = new Schema({
User: String
});

module.exports = model('blacklist', blacklist);
const { model, Schema } = require('mongoose');

let blacklist = new Schema({
User: String
});

module.exports = model('blacklist', blacklist);
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const blacklist = require('../../models/blacklist');

module.exports = {
data: new SlashCommandBuilder()
.setName('blacklist')
.setDescription('Blacklist a user from using this bot')
.addSubcommand(command => command
.setName('add')
.setDescription('Add a user to the blacklist')
.addStringOption(option => option
.setName('user')
.setDescription('The user ID you want to blacklist')
.setRequired(true)
)
)
.addSubcommand(command => command
.setName('remove')
.setDescription('Remove a user from the blacklist')
.addStringOption(option => option
.setName('user')
.setDescription('The user ID you want to remove from the blacklist')
.setRequired(true)
)
),
async execute(interaction) {

const { options } = interaction;
if(interaction.user.id !== '778992675830759455') return await interaction.reply({ content: `Only cyukizzz can use this command!`, ephemeral: true });

const user = options.getString('user');
const data = await blacklist.findOne({ User: user });
const sub = options.getSubcommand();

switch(sub) {
case 'add':

if(!data) {
await blacklist.create({
User: user,
})



const embed = new EmbedBuilder()
.setColor('Red)
.setDescription(` \`${user}\` has been blacklisted from using my commands.`)
.setTimestamp()

await interaction.reply({ embeds: [embed] });
} else if(data) {
return await interaction.reply({ content: `The user \`${user}\` has already been **blacklisted**`, ephemeral: true })
}

break;
case 'remove':
if(!data) {
return await interaction.reply({ content: `The user \`${user}\` is not on the **blacklist**`, ephemeral: true })
} else if(data) {
await blacklist.deleteMany({ User: user });

const embed = new EmbedBuilder()
.setColor('Green')
.setDescription(`\`${user}\` has been removed from the blacklist.`)
.setTimestamp()

await interaction.reply({ embeds: [embed], ephemeral: true });
}
}
}
}
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const blacklist = require('../../models/blacklist');

module.exports = {
data: new SlashCommandBuilder()
.setName('blacklist')
.setDescription('Blacklist a user from using this bot')
.addSubcommand(command => command
.setName('add')
.setDescription('Add a user to the blacklist')
.addStringOption(option => option
.setName('user')
.setDescription('The user ID you want to blacklist')
.setRequired(true)
)
)
.addSubcommand(command => command
.setName('remove')
.setDescription('Remove a user from the blacklist')
.addStringOption(option => option
.setName('user')
.setDescription('The user ID you want to remove from the blacklist')
.setRequired(true)
)
),
async execute(interaction) {

const { options } = interaction;
if(interaction.user.id !== '778992675830759455') return await interaction.reply({ content: `Only cyukizzz can use this command!`, ephemeral: true });

const user = options.getString('user');
const data = await blacklist.findOne({ User: user });
const sub = options.getSubcommand();

switch(sub) {
case 'add':

if(!data) {
await blacklist.create({
User: user,
})



const embed = new EmbedBuilder()
.setColor('Red)
.setDescription(` \`${user}\` has been blacklisted from using my commands.`)
.setTimestamp()

await interaction.reply({ embeds: [embed] });
} else if(data) {
return await interaction.reply({ content: `The user \`${user}\` has already been **blacklisted**`, ephemeral: true })
}

break;
case 'remove':
if(!data) {
return await interaction.reply({ content: `The user \`${user}\` is not on the **blacklist**`, ephemeral: true })
} else if(data) {
await blacklist.deleteMany({ User: user });

const embed = new EmbedBuilder()
.setColor('Green')
.setDescription(`\`${user}\` has been removed from the blacklist.`)
.setTimestamp()

await interaction.reply({ embeds: [embed], ephemeral: true });
}
}
}
}
client.on(Events.InteractionCreate, async interaction => {
const blacklist = require('./models/blacklist');
const data = await blacklist.findOne({ User: interaction.user.id });

if(data) {
return await interaction.reply({ content: `You have been **blacklisted** from using this bot! This means the developer doesn't want you to use it's commands for any given reason`, ephemeral: true })
}

if (!data)
return;
})
client.on(Events.InteractionCreate, async interaction => {
const blacklist = require('./models/blacklist');
const data = await blacklist.findOne({ User: interaction.user.id });

if(data) {
return await interaction.reply({ content: `You have been **blacklisted** from using this bot! This means the developer doesn't want you to use it's commands for any given reason`, ephemeral: true })
}

if (!data)
return;
})
it says the user is blacklisted but the commands are still running for them
25 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/26/2023 in #djs-questions
DiscordAPIError[40060]: Interaction has already been acknowledged.
DiscordAPIError[40060]: Interaction has already been acknowledged. how can i fix this if the error doesnt give me the file name or line?
5 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/23/2023 in #djs-questions
help with buttons
is it possible for the bot to send another message after clicking a URL style button?
52 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/23/2023 in #djs-questions
bump reminder with discordjs
how can i make a bump reminder for disboard with discordjs?
21 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/22/2023 in #djs-questions
applied Tags
so im trying to make my bot send a message when a certain tag is applied to a thread
client.on(Events.ThreadUpdate, async (oldThread, newThread, channel) => {
console.log(newThread.appliedTags)

if (newThread.appliedTags === '1107649018902884393') channel.send({ content: 'working', ephemeral: true})

})
client.on(Events.ThreadUpdate, async (oldThread, newThread, channel) => {
console.log(newThread.appliedTags)

if (newThread.appliedTags === '1107649018902884393') channel.send({ content: 'working', ephemeral: true})

})
the tags get logged but nothing gets sent to the channel
44 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/21/2023 in #djs-questions
help with function(?)
trying to make an if statement out of the not scrambled word if that makes sense https://sourceb.in/gxwDVtkYvN
3 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/11/2023 in #djs-questions
component collector
can i collect two different components? for example, i am using a button that leads me into a string select menu
7 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/10/2023 in #djs-questions
button question
is it possible for me to make a button where when its clicked i can send a message back to the bot that will make it do something else?
20 replies
DIAdiscord.js - Imagine a bot
Created by keekztah on 6/7/2023 in #djs-questions
djs14 question
is it possible to create a command to set up a 'bot-logs' channel, for every server the bot is in? that way if the bot gets updated the dev can send the updates to the servers bot log channel?
4 replies