discord.js

How to make the bot send personalized emojis?

牧云@^-^@ 提交于 2021-02-10 17:27:35
问题 Well, I'm currently using the emoji :x: , but on my server I have an emoji called :superbotxemoji : I just don't know how I get my bot to use it My code: const Discord = require('discord.js'); module.exports = { name: 'say', description: 'say', execute(message, args) { const { prefix, token } = require('../config.json'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send({ embed: { color: 16777201, description: `:x: | ${message.author}, You are not allowed to use

How to make the bot send personalized emojis?

倾然丶 夕夏残阳落幕 提交于 2021-02-10 17:26:14
问题 Well, I'm currently using the emoji :x: , but on my server I have an emoji called :superbotxemoji : I just don't know how I get my bot to use it My code: const Discord = require('discord.js'); module.exports = { name: 'say', description: 'say', execute(message, args) { const { prefix, token } = require('../config.json'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send({ embed: { color: 16777201, description: `:x: | ${message.author}, You are not allowed to use

How to make the bot send personalized emojis?

こ雲淡風輕ζ 提交于 2021-02-10 17:26:08
问题 Well, I'm currently using the emoji :x: , but on my server I have an emoji called :superbotxemoji : I just don't know how I get my bot to use it My code: const Discord = require('discord.js'); module.exports = { name: 'say', description: 'say', execute(message, args) { const { prefix, token } = require('../config.json'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send({ embed: { color: 16777201, description: `:x: | ${message.author}, You are not allowed to use

How to make the bot send personalized emojis?

不问归期 提交于 2021-02-10 17:26:04
问题 Well, I'm currently using the emoji :x: , but on my server I have an emoji called :superbotxemoji : I just don't know how I get my bot to use it My code: const Discord = require('discord.js'); module.exports = { name: 'say', description: 'say', execute(message, args) { const { prefix, token } = require('../config.json'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send({ embed: { color: 16777201, description: `:x: | ${message.author}, You are not allowed to use

How to make the bot send personalized emojis?

a 夏天 提交于 2021-02-10 17:25:16
问题 Well, I'm currently using the emoji :x: , but on my server I have an emoji called :superbotxemoji : I just don't know how I get my bot to use it My code: const Discord = require('discord.js'); module.exports = { name: 'say', description: 'say', execute(message, args) { const { prefix, token } = require('../config.json'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send({ embed: { color: 16777201, description: `:x: | ${message.author}, You are not allowed to use

How can I make a reactionCollector on a remove event work?

若如初见. 提交于 2021-02-10 14:44:26
问题 So, I am working on a discord bot. Here I start a reactionCollector . When a reaction is collected, it does something, and when the reaction is removed, it should do something else. await message.channel.send(embed) then(async function (message) { await message.react('⚔') const filter = (reaction, user) => { return reaction.emoji.name === '⚔' && user.id != 705462496646922311 }; collector = message.createReactionCollector(filter); collector.on('collect', async (reaction, user) => { // Do

how to save an image from discord using discord bot node js

微笑、不失礼 提交于 2021-02-10 14:41:55
问题 So far I've only been able to get text and links from what other people on my discord channel type, but I want to be able to save posted images/gifs. is there any way I can do this through the bot or is it impossible? I'm using discord.js. 回答1: Images in Discord.js come in the form of MessageAttachments via Message#attachments . By looping through the amount of attachments, we can retrieve the raw file via MessageAttachment#attachment and the file type using MessageAttachment#name. Then, we

Music functionality without the correct package discord.js

爱⌒轻易说出口 提交于 2021-02-10 14:16:32
问题 I started making a Discord Bot without thinking I would like to add music/voice functionality. I would now like to add this, but as the docs state you need to install: Without voice support: npm install discord.js With voice support (@discordjs/opus): npm install discord.js @discordjs/opus With voice support (opusscript): npm install discord.js opusscript I installed the one without voice support when I began, can I just install the voice support ones over or will that mess it up. If so, what

Fetch a message (by ID) and edit it

浪子不回头ぞ 提交于 2021-02-10 14:16:28
问题 I'm trying to edit a message the bot sent, in a different function. const msg = message.channel.fetchMessage(msgId); msg.edit(embed); Didn't work because msg.edit is not a function. message.channel.messages.fetch({around: "352292052538753025", limit: 1}) .then(messages => { messages.first().edit("test"); }); Didn't work because .fetch is not a function. function update(msgId, time, channelid, prize, winnersInt, message) { setTimeout(function(){ let gtime = time/3600000 + " hours remaining!";

Fetch a message (by ID) and edit it

二次信任 提交于 2021-02-10 14:15:19
问题 I'm trying to edit a message the bot sent, in a different function. const msg = message.channel.fetchMessage(msgId); msg.edit(embed); Didn't work because msg.edit is not a function. message.channel.messages.fetch({around: "352292052538753025", limit: 1}) .then(messages => { messages.first().edit("test"); }); Didn't work because .fetch is not a function. function update(msgId, time, channelid, prize, winnersInt, message) { setTimeout(function(){ let gtime = time/3600000 + " hours remaining!";