const Discord = require('discord.js'); const { Client, MessageAttachment } = require('discord.js'); const client = new Discord.Client(); client.once('ready', () => { console.log("Ready!") }) client.on(&apos ...
When using the python module html2image to convert html to an image, I encountered an issue with fixed image size causing the html to break or get cut off, leaving a blank space. Is there a Python-based solution to fix this problem? (I am using chat export ...
When Discord devs introduced this feature, I can't seem to wrap my head around how they intended Discord.GuildManager#create to function. How could they possibly have expected it to work with Discord.GuildCreateOptions#channels[0], for instance, { name ...
Currently working on developing a Discord bot focused on moderation tasks. I've compiled a list of inappropriate words in a text file and now need assistance with coding in node.js to parse and remove these words from messages within the Discord platform ...
I'm currently developing a Discord Bot that responds to specific commands. To simplify the process, I was considering implementing a system where the bot asks users for questions, collects their responses, and then provides the appropriate answers bas ...
While working on a basic Discord bot, I encountered an issue when running the -setcaps command. The error message I received was: TypeError: Cannot read property 'id' of undefined. I'm unsure about what might be causing this error. Any a ...
I am facing an issue with my code where the bot is not updating its message after a specific time period defined by time.milliseconds * 1000. How can I make the bot edit its message after that duration? let timeout = 15000; if (author !== null && ...
While integrating Discord OAuth2 into my Next.js application, I encountered an issue when deploying to Amplify. The functionality works smoothly on localhost but fails in production. On the profile page, there is a setup for users to link their Discord acc ...
As a precautionary measure, I've decided to keep my token in a separate file named token.txt. To load the token from the file and run the bot, I'm using the following code: f = open("token.txt", "r") token = f.readline() f.close() bot.r ...
Issue: While updating my Node.js version, I inadvertently broke my Node.js program. The problem is that I can't recall the previous Node.js version that was working fine before this happened. Error: When I try to run my program using node app.js, ...
Currently developing a basic server with a unique feature - responding with "ew" in the chat. Is there a way to automatically delete any message that does not include the word "ew"? Appreciate your help! ...
As I was working on a new music command feature for my Discord bot, I encountered an issue. Whenever I try to use the command -play {url}, I keep getting an error message that says: voice_channel.join is not a function. I searched through various resource ...
module.exports = { name: "mute", description: "This command is used to mute members in a server", execute: async function (msg, arg) { const muteRole = await msg.guild.roles.cache.find((r) => r.name == "Mute ...
While working on developing a Discord bot, I keep encountering an error message stating: "Line 23: no such file or directory, open 'C:\Users\Owner\Desktop\Limited Bot\Items\Valkyrie_Helm.json']" even though the filep ...
Hello fellow programmers! Recently, I've been working on a Discord bot using discordjs sdk. I'm trying to implement a feature where the bot creates an event every week. I went through the discordjs guide and checked the discord api documentati ...
While browsing through the questions of other users, I stumbled upon exactly what I was looking for. My dilemma now is how to make the same bot perform similar tasks on various channels but with different titles, footers, and so on... The primary code sni ...
After dedicating two weeks to developing a discord bot, I recently discovered that commands can be activated in direct messages. I'm concerned that this could potentially enable users with lower roles to interfere with other servers. Does anyone have ...
Recently, I've developed an innovative anti-invite feature for my bot. However, there seems to be a minor glitch where the bot fails to remove any links sent within the enabled guild when the command is triggered. This issue specifically occurs in versio ...
There seems to be an issue with the code where the message is sent instantly instead of waiting for the specified timeout duration. Based on the code, it should wait for the time mentioned in the message. I'm puzzled as to why it's not functioni ...
Every time I attempt to utilize the channel.send() function in discord.py to send a message, I encounter an error stating "'NoneType' object has no attribute 'send'. Can someone please offer assistance? The issue stems from this section of code: channel ...
Currently, I am developing a simple bot. Interestingly, the bot seems to be responding multiple times to a single command. Here is the code snippet: const Discord = require('discord.js'); var bot = new Discord.Client(); const PREFIX = "+"; var fortunes ...
Lately, I've been working on a discord.js bot to refresh my JavaScript skills after a long break. I've been following a tutorial on reloading slash commands and events, but I encountered this error: TypeError: Cannot read properties of undefined (reading ' ...
Essentially, my question is how to extract a value from a variable and input it into a sequence. Being Dutch, I struggle to articulate this query correctly. var channelname = msg.channel.name; "description": `${config.ticketlist.channelname.ticketmessage} ...
In the process of developing a simple script that selects a random code from your Discord 2FA backup code text file, inserts it into the 2fa box, and submits it during login. The bot can already enter your email and password to log in initially and choose ...
After coding with Python for Discord, I decided to switch to JavaScript for its wider functionality. However, I encountered a formatting issue with a specific line of code while testing out a music bot in JS. The bot was sending an embed message, but I wan ...
content: "Congratulations, you have been successfully verified!", ephemeral: true, }); } } else if (interaction.customId === "giverole") { const userPoints = await findUser(interaction.member ...
I built a command to send an embed based on JSON data, and it's working well for the most part. When I input the data correctly, the bot sends it to the channel as expected. However, if someone tries to insert text in a link section, it crashes the bot. I ...
I'm currently developing a bot using discord.js and facing an issue. My objective is to create a reaction collector that collects the reactions of users who want to participate in a tournament when triggered by the command "tournament prepare". Later, when ...
Hey there! I've created a Discord bot that is meant to check the status of a Minecraft server, but I'm encountering an issue with the embed. It's showing this error: UnhandledPromiseRejectionWarning: ReferenceError: execute is not defined. ...
One night while my bot was running on auto-pilot as I drifted off to sleep, a warning popped up out of the blue: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMembersChunk listeners added to [Client]. Use emitter.setMaxLi ...
As I work on a slash command to deliver information about a specific command when users type /help, I encountered an error when trying to add multiple commands: E:\v13\node_modules\discord.js\src\rest\RequestHandler.js:298 ...
Lately, I enhanced my bot's functionality by allowing it to retrieve the color for embeds from a file specified in my config.json. All I need to do is modify something like: "embedcolor": "00A950" to "embedcolor": "0 ...
This is the play command for my bot: @client.tree.command(name="play", description="Play some music") @app_commands.describe(musicname="The name of the music you want to play") async def play(interaction:Interaction, musicname ...
Recently, I started using discord.js to create a simple bot. Whenever I try to change the nickname by calling message.member.setNickname("Another Nickname").then(console.log, console.log); I receive the following error message: { name: 'Disco ...
Whenever I attempt to retrieve the user ID, channel, and other information, I receive a response of undefined instead of the actual data import { VoiceState } from "discord.js"; import { Discord, On } from "discordx"; @Discord() export ...
After discovering that my arguments are no longer being recognized when executing a command, I encountered a strange issue. When args are not included, my console logs undefined, but if args are added, nothing is logged. This is snippet of my command hand ...
I've been developing a Python Discord bot that sends scheduled messages in a server at specific times every day, along with other functionalities. However, after implementing the scheduled messaging feature, the bot commands have stopped working - lea ...
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://discord.com/register'); await page.screenshot({path: 'b.png'}); await page.click(' ...
My setup includes the following code: const fs = require('fs'); client.commands = a new Discord Collection(); const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js')); for(const file of commandFiles){ const command = re ...
I need to retrieve all communication channels and messages sent by a bot. The goal is to access all available channels, including direct message (DM) channels. However, the current method seems to only fetch guild channels. client.channels.cache.entries() ...
In my coding project, I created a map named queue in FILE 1. This map was fully built up with values and keys within FILE 1, and then exported to FILE 2 using module.exports.queue = (queue). Here is the code from FILE 1: let queue = new.Map() let key = &q ...
I'm part of a team of developers in my Discord community who are dedicated to helping others with their problems on Stack Overflow. Is there a way to create a bot that can automatically gather the latest question tagged with a specific keyword and s ...
I recently encountered an issue with my Discord bot that was working perfectly fine yesterday. After attempting to host it on Heroku, I ran into some errors. To find a solution, I followed advice from an online post and executed the command npm cache cle ...
Can anyone help me with setting the highest role of a user? I'm trying to silentban someone by creating a silent role, but it always ends up at the lowest position. Is there a way to make this role the highest one for the user, so that the permissions of t ...
Is there a way to include a custom kick message along with the reason specified in the kick command? I want to ensure that the argument after mentioning the user is grouped correctly, especially for users with spaces in their names. How can I achieve thi ...
Currently, I'm working on implementing a help command that utilizes reactions. The idea is that the bot will add a reaction, prompting the user to react, and once they do, the corresponding help message will be displayed. However, I've hit a road ...
I'm trying to find a way to generate an invite link for users to keep track of invites. The code I have currently is creating the invite for the Bot instead. const channel = client.channels.cache.find(channel => channel.id === config.server.channel ...
I recently started working with node.js and asynchronous programming, and I'm facing a challenge that has me puzzled. My goal is to create a Discord bot that fetches data from a third-party website. While I can successfully retrieve the data and see i ...
Each time I attempt to utilize next auth for creating a discord oauth client and subsequently click sign in, an error occurs: https://next-auth.js.org/errors#get_authorization_url_error client_id is required { message: 'client_id is required', ...
So I've developed this amazing Discord Bot that provides basic responses. For instance: User Input: !Query status Bot Output: Online! These responses are pretty straightforward, but now I want to take it up a notch and enable the bot to search the web an ...
Can anyone assist me with my question? I am using discord v11.5.1 Below is the code: exports.run = async (bot, message) => { const options = [" ...
While working on a Discord bot that accesses routes from Express, I encountered an issue. It seems to function properly when kept on a specific server, but if I try accessing Express on a different server while it's running, I encounter the error "assignme ...
When looking to separate my code into different files, I typically create a bash script to concatenate them together like so: cat first.py second.py third.py > run.py python ./run.py However, using cogs requires adding additional code. Is there a speci ...
I have been developing a Discord Bot to verify Roblox accounts. Although my script is prepared and the command "-verify" can be executed, an error arises: (node:22872) DeprecationWarning: The message event is deprecated. Use messageCreate instead (Use `n ...
I created a Python code using the selenium module to log in to Discord using a token number. The token number needs to be added to localStorage, so I used JavaScript code to add it successfully. However, upon checking Application -> localStorage -> https:/ ...
Looking to create a list admins command for a bot, I'm facing challenges in converting user ids to tags within the command. Take a look at what I have accomplished so far: const { MessageEmbed } = require('discord.js'); const { readFileSync, existsSync } = ...
I've been struggling to get my bot to leave the voice channel despite trying multiple methods. Here's what I've attempted in the source code: Discord.VoiceConnection.disconnect(); Although this is the current code, I have also tested: message.member.voice ...
Running a Discord.js bot and struggling to figure out how to restrict the command! help to only the #commands channel. Already have the channel ID, so what steps should be taken in the command event to achieve this? Appreciate any guidance! ...
I'm facing an issue with fetching specific server members by their user id in order to assign a role to them. I keep getting an undefined response each time. Even though this bot has administrator permission and all required intents are assigned, I a ...
I've been attempting to use flag emojis as reactions on a Discord bot, but they just won't cooperate. Every time I try something like this > ':flag_jp:', I encounter the following error: Error: DiscordAPIError: Unknown Emoji EDIT ...
Every time I initiate the bot and try to execute my "ping" command, an error occurs: js:350 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Missing Access at RequestHandler.execute (C: ...
const joinUserToServer = fetch(`http://discordapp.com/api/guilds/440494010595803136/members/278628366213709824`, { method: 'PUT', headers: { Authorization: `Bearer TOKEN`, }, ...
My current goal is: User inputs !price (item) The bot will look up the item in a JSON file, for example: [ { "hi": 700000, "low": 650000, "name": "football" } ] The bot will then respond with Name: Football High: 6500 ...
Hey everyone, I'm looking for a code snippet that will help me retrieve all the members from a specific voice channel by using its ID. I also need to extract and store the usernames of these members who are currently in that particular voice channel with ...
I am currently working on making this bot function across multiple servers, and I need to retrieve a specific guild ID similar to using message.guild.id. However, since there is no message defined or declared, I am unsure of how to achieve this. Any sugges ...
I'm currently attempting to figure out how to send a message to a channel when the Discord bot is launched. I've experimented with this code: client.on('message', (message) => { client.on('ready', () => { channel = cli ...
While working on a Discord bot, I encountered an issue while trying to register a slash command with options for the ban command. The error message I received was: throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: ...
Apologies for my not-so-great English I am currently learning JavaScript and I am trying to detect an image in a message sent by users from the server, and reply with that image embedded in a bot message. However, message.content is not working for this p ...
Looking for a solution to prevent pinging roles with the echo command? One approach could be to check if the 'content' parameter starts with "@". If it does, you can simply respond with a message indicating that it's not allowed. How would you implement ...
Hey everyone, I'm new to this forum and looking for some help. I am currently working on a ban command for my Discord bot in discord.js, and I was wondering how I can make it so that if no reason is specified, it will use "unspecified reason" and still ban ...
Having some trouble with this code. The bot seems to only respond to stickers and pictures that are sent locally, but not text messages. Here is the code snippet: const Discord = require('discord.js'); const bot = new Discord.Client(); const t ...
Is there a way to retrieve the online status of any user in a guild where the bot is present? Although I can currently access the online status of the message author, I would like to be able to retrieve the online status of any user by using the following ...
I am trying to set up a discord bot that sends a message at regular intervals, like every 10 minutes. However, I keep running into an error. Can someone please assist me with this issue? (Apologies for any language errors in my message) Below is the code ...
I'm having trouble with implementing reaction awaiting as per the guide in discord.js. For some reason, it just doesn't seem to work on my end. No matter what I try, when I click the emoji, it doesn't register. I've scoured numerous Sta ...
Is there a way to search for a user by their unique nickname within a particular server? ...