discord ban command not proceeding

Advertisements I’m trying to implement a ban command in my Discord.js bot, but it doesn’t seem to work. What could be the issue? No errors are in console. client.on(‘message’, message => { if (message.content.startsWith(prefix) && message.content.startsWith(‘ban’)) { const args = message.content.split(‘ ‘); const user = message.mentions.users.first(); if (!args[1]) { return message.channel.send(‘Please mention the user to… Read More discord ban command not proceeding

Discord bot deletes every message

Advertisements Is there any way that I can stop my Discord bot from deleting all messages? I only want to delete messages that include banned words. client.on(‘messageCreate’, async message => { if (message.author.bot || !message.guildId) return; if (message.content.includes(badWords)) await message.reply("Not cool buddy you getting a timeout") message.delete() return; }) Can anyone solve this because I… Read More Discord bot deletes every message

What is causing DiscordAPIError[30034] when trying to deploy 6 commands to a Discord bot?

Advertisements When i added a new /poll command, i started getting this error whenever i tried restarting my discord bot : > node deploy-commands.js && node stolas_bot.js Started refreshing 6 application (/) commands. DiscordAPIError[30034]: Max number of daily application command creates has been reached (200) at handleErrors (/home/Eth22/delivery/Discord Bot/stolas_bot_js/node_modules/@discordjs/rest/dist/index.js:640:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest… Read More What is causing DiscordAPIError[30034] when trying to deploy 6 commands to a Discord bot?

Discord.js 14 – Cant send an image to a specific channel when a member joins

Advertisements I was trying to send an image when a member joins to my server with @napi-rs/canvas in discord.js 14. When the bot tries to send the message this error appears. I was trying to make it with discordjs.guide Cannot read properties of undefined (reading ‘cache’) This is the code of my event: const {… Read More Discord.js 14 – Cant send an image to a specific channel when a member joins

Fetching gifs from the Tenor API

Advertisements I’m having issues fetching any gifs from the Tenor API – I’ve also tried to use tenor.googleapis.com. But so far, I’ve gotten this error over and over again: Sorry, no media found in the search result Here’s the code I’ve worked with: client.on(‘interactionCreate’, async (interaction) => { if (!interaction.isCommand()) return; if (interaction.commandName === ‘cat’)… Read More Fetching gifs from the Tenor API

The "awaitModalSubmit" method does not work properly (Undefined)! || Discord.js V.14

Advertisements This is my code: async function createTicketModal(interaction, ticketType) { if (interaction.deferred || interaction.replied) { // Interaction has already been replied to or deferred return; } const modal = new ModalBuilder() .setCustomId(‘ticketModal’) .setTitle(`${ticketType} – Ticket`); const questionModal = new TextInputBuilder() .setCustomId(‘questionModal’) .setLabel(‘Please describe your problem.’) .setStyle(TextInputStyle.Paragraph); const firstActionRow = new ActionRowBuilder().addComponents(questionModal); modal.addComponents(firstActionRow); const modalMessage =… Read More The "awaitModalSubmit" method does not work properly (Undefined)! || Discord.js V.14

Discord.js How to access the message using messageReactionAdd

Advertisements I currently have this function in my bot that triggers every time a message is reacted to: client.on(‘messageReactionAdd’, (reaction, user) => { if(reaction.emoji.id === "1014887969808711800") { if (user.username !== ‘IteroBetBot’) { console.log(‘Fnatic’); voterArray1.push(user.username); } } else if (reaction.emoji.id === "1065285604578959430") { if (user.username !== ‘IteroBetBot’) { console.log(‘Koi’); voterArray2.push(user.username); } } else if (reaction.emoji.name ===… Read More Discord.js How to access the message using messageReactionAdd

TypeError: Cannot read properties of undefined (reading 'has') Discord.JS V14

Advertisements I’m trying to check permissions for a user, if the user is admin it won’t do anything else it’ll return "No links allowed". I’m having issue with the permission check. My code is: client.on("messageCreate", (message) => { let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/; if (regexp.test(message.content)) { if ( message.author.permissions.has(PermissionFlagsBits.Administrator) ) { return; } else { message.delete().then(()… Read More TypeError: Cannot read properties of undefined (reading 'has') Discord.JS V14