discord.js

How Find Emojis By Name In Discord.js

♀尐吖头ヾ 提交于 2020-01-06 05:37:08
问题 So I have been utterly frustrated these past few days because I have not been able to find a single resource online which properly documents how to find emojis when writing a discord bot in javascript. I have been referring to this guide whose documentation about emojis seems to be either wrong, or outdated: https://anidiots.guide/coding-guides/using-emojis What I need is simple; to just be able to reference an emoji using the .find() function and store it in a variable. Here is my current

How to use fetchMessages() to fetch a certain amount of messages then send them in a certain way?

≡放荡痞女 提交于 2020-01-06 04:41:06
问题 What I would like to do is to take information from resolving a promise from fetchMessages() and then being able to go through the collection it gives and then being able to send certain pieces. For example, the bot will list 10 messages looking like GalaxyDJx#2462: hi by, if possible, finding the information (e.g. username, discriminator, message content) and then having each piece of information set to its own variable such as var uname , var discrm , and var msgcnt . The information I got

How to make a embed to the user requirments?

笑着哭i 提交于 2020-01-05 06:49:20
问题 So I'm coding a discord bot and wondering how I would do this If the user inputs ~embed Title Description Colour It will output an embed with the requirements. How would I do so? And thanks @André Heres my code : https://ghostbin.com/paste/uetpj 回答1: One way to do it would be with a character that the user needs to use to separate the fields. Like | or ;; . Something the users wont usually type in the messages. Then you can split the message with that character. var arguments = myString.split

How to send a message to a specific channel

为君一笑 提交于 2020-01-05 05:28:06
问题 I'm trying to send a message to a specific channel with my Discord bot, which is in several servers. I want the bot to pick up on a message from one server and send a message to my personal server, in a specific channel, but I can't get it to 'find' the channel. Has the API changed or something? I tried npm install discord.js to update too. Code: if (message.author.id == 'XXXXX' && !mess.includes("Dank") && message.channel.id != 'XXXXX') { bot.channels.get('XXXXX').send('memes'); } I tried a

Send message to specific channel with typescript

六眼飞鱼酱① 提交于 2020-01-02 09:55:15
问题 I want to send a greeting message to an "welcome" text channel, whenever a new user joins the server (guild). The problem I'm facing is that, when I find the wanted channel, I will receive the channel with the type GuildChannel . Since GuildChannel has no send() function, I'm not able to send the message. But I can't find a way to find the TextChannel , so I'm stuck here. How can I get to the TextChannel so that I'm able to use the send() message? Below the code I'm using by now: // Get the

Turn queue list into an embed

偶尔善良 提交于 2019-12-25 01:54:01
问题 Recently made a queue command for my bot and it works, but I'm wanting it to display in a RichEmbed. let resp = `**Now Playing:**\n${nowPlaying.songTitle}\n**Requested By:**\n${nowPlaying.requester}\n\n**Queue**\n` for (var i = 1; i < queue.length; i++) { resp += `${i}. **${queue[i].songTitle}**\n**Requested By:** ${queue[i].requester}\n` } This is the current code I have set to display the queue. Now, my exact problem is resp += . I know that each time a song is added to the queue and the

Getting User profile connections with a bot account

点点圈 提交于 2019-12-25 00:26:45
问题 I'm trying to add a feature to my Discord bot: when my Twitch account gets a new follower, and if the follower's Twitch account is linked to his Discord account, when he gets into my server he's getting automatically a new role. So my question is: can I get the Discord's linked apps of a user, and get the user ID linked to those apps? Like getting the Twitch's user ID of the new follower and compare it with with the Discord's linked Twitch user ID of the users of my channel using Discord.js?

Await reply in private message discord.js

五迷三道 提交于 2019-12-24 23:34:49
问题 So, this works ALMOST as intended. I have the bot private messaging the user who uses the correct command in the correct channel of the server. Instead of clogging up the server with profile creation messages, I have the bot do profile creation privately. I know/think the problem is with the message.channel.awaitMessages, because it only sees the replies in the original channel on the server where the command was put into place. I am not sure what I should replace the message.channel

Change Permissions Of A Channel Just Created

南笙酒味 提交于 2019-12-24 21:53:47
问题 I have the below code which is intended to create a new channel with a name. This works fine. It then needs to set the permissions of the channel to making it VIEW_CHANNEL false for all users. It then needs to overwrite permissions for the message author to grant them VIEW_CHANNEL. Im getting stuck on how to make the permissions apply on the channel just created. const Discord = require("discord.js"); module.exports.run = async (bot, message, args) => { let botIcon = bot.user.displayAvatarURL

Fetch bot messages from bots Discord.js

℡╲_俬逩灬. 提交于 2019-12-24 20:46:01
问题 I am trying to make a bot that fetches previous bot messages in the channel and then deletes them. I have this code currently that deletes all messages in the channel when !clearMessages is entered: if (message.channel.type == 'text') { message.channel.fetchMessages().then(messages => { message.channel.bulkDelete(messages); messagesDeleted = messages.array().length; // number of messages deleted // Logging the number of messages deleted on both the channel and console. message.channel.send(