discord

Collecting users who reacted to a message using discord.js

人走茶凉 提交于 2019-12-06 08:09:19
I'm trying to collect all users that have reacted to certain message. My code client.on('messageReactionAdd', (reaction, user) => { if(reaction.emoji.name === "✅") { console.log(reaction.emoji.users); } But it returns undefined. If I use "reaction.emoji" it returns ReactionEmoji { reaction: MessageReaction { message: Message { channel: [Object], id: '371695165498458115', type: 'DEFAULT', content: 'bb', author: [Object], member: [Object], pinned: false, tts: false, nonce: '371695172469129216', system: false, embeds: [], attachments: Collection {}, createdTimestamp: 1508689433217,

How to edit message according to reaction in Discord.js (create a list and switch page)

一个人想着一个人 提交于 2019-12-06 06:34:53
问题 I want my Discord bot to sent a message and then edit it when people react (for example creating a list, and clicking on the right or left arrow will edit the messages and show the next/previous part of the list). Example: before reaction: after reaction: 回答1: How to handle a message reaction? There is 3 ways to react to a message reaction: Using the function awaitReactions (promise based) Using a ReactionCollector Using the messageReactionAdd event The Difference: messageReactionAdd is an

DeprecationWarning: Collection#find: pass a function instead

最后都变了- 提交于 2019-12-05 20:22:52
问题 I'm quite a newbie to node.js and I'm currently using discord.js to make a Discord bot. As soon as any bot command gets used the console prints a DeprecationWarning. for example: (node:15656) DeprecationWarning: Collection#find: pass a function instead (node:15656) sometimes is another number, nearly always changing. This is what my code looks like (only one command, I've got multiple, I get this error with all of them though): const botconfig = require("./botconfig.json") const Discord =

Loop through Snowflake array

允我心安 提交于 2019-12-05 16:32:20
I'm looking for a way to get data from this Collection. The data looks like: '0000000' => GuildMember { guild: Guild { members: [Object], id: '000000', name: 'Zombie', _rawVoiceStates: [Object] }, user: User { id: '0000000', username: 'Orc', _roles: [ '0000' ], nickname: 'Orc', joinedTimestamp: 00000, lastMessageID: null }, '0000000' => GuildMember { guild: Guild { members: [Object], id: '000000', name: 'Zombie', _rawVoiceStates: [Object] }, user: User { id: '0000001', username: 'Orc1', _roles: [ '0000' ], nickname: 'Orc', joinedTimestamp: 00000, lastMessageID: null }, _array: null, _keyArray:

How do I get a bot to mention a channel?

妖精的绣舞 提交于 2019-12-05 14:41:35
I am making a welcome message but I can’t seem to make it say the rule channel. I want the bot to say #rules and make it so you can click it to go to the rules channel. I know you can do this with a normal user, but I want to do it with my bot. Every time I try, it can’t be clicked like a normal player. I’ve tried doing #rules, <#channelID>, and other stuff. None of them are clickable. You need to send a GuildChannel for the channel name to be clickable. You can achieve this by finding the channel in guild.channels This returns a Collection, which you can filter. If you have an ID (easier):

Discord.js - Deleting all channels in a server

巧了我就是萌 提交于 2019-12-05 08:52:39
问题 I'm making a bot that auto-sets up a server, and I was wondering how to delete all channels and categories in a server. Thanks, Codingpro 回答1: The code is very simple: message.guild.channels.forEach(channel => channel.delete()) That should do it. Remember to use this in response of a message, or message will be undefined 回答2: You can run a loop for every single channel in the server (Categories are considered as channels too) //This goes in Client.on('ready', ...); var server = Client.guilds

discord php curl login Fail

坚强是说给别人听的谎言 提交于 2019-12-04 19:43:46
i want to login into discord with php curl but did't work's for me what is the problem in my code i want auto-login into discord and grab data from html ....! cloed There are some advices: 1) If you want to see some responsed information. You have to echo $answer . Otherwise you couldn't see the response even the data were sent correctly. 2) The site used captcha. I tried it with correct email/password and get the following response {"captcha_key": ["captcha-required"]} . I have no idea how to round this. Maybe you should contact the Discord. 3) The site requires json data. Here are the codes

How to get the sum and the names of all the users from all voice channels Disocrd?

烈酒焚心 提交于 2019-12-04 07:17:43
问题 I use : import discord I need to get from each voice channel amount all users and then get their names (usernames). How to do it? 回答1: You need to access the voice channel object. I recommend you use the voice channel's id. The command could look as follows: @client.command(pass_context = True) async def vcmembers(ctx, voice_channel_id): #First getting the voice channel object voice_channel = discord.utils.get(ctx.message.server.channels, id = voice_channel_id) if not voice_channel: return

DiscordAPIError: Unknown Message

为君一笑 提交于 2019-12-04 05:16:15
问题 I have made a freeze command using discord.js and commando, that gives the user a role, and keeps them from talking and chatting. It seems that every time I run it though, it tosses an error: (node:7352) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message I haven't been able to find what it is, but maybe i'm just a nub. Code: async run(message, { user }) { message.delete() const member = message.guild.member(user); if (!message.member.hasPermission("MUTE_MEMBERS")) return

DeprecationWarning: Collection#find: pass a function instead

老子叫甜甜 提交于 2019-12-04 02:49:39
I'm quite a newbie to node.js and I'm currently using discord.js to make a Discord bot. As soon as any bot command gets used the console prints a DeprecationWarning. for example: (node:15656) DeprecationWarning: Collection#find: pass a function instead (node:15656) sometimes is another number, nearly always changing. This is what my code looks like (only one command, I've got multiple, I get this error with all of them though): const botconfig = require("./botconfig.json") const Discord = require("discord.js"); const bot = new Discord.Client(); bot.on("ready", () => { console.log(`Launched $