discord

OAuth2, Using POST and Yet… Method Not Allowed?

纵然是瞬间 提交于 2019-12-08 04:50:02
问题 Basically I'm trying to create a website that requires interfacing with the Discord API to retrieve user information to work. To do this, I am using a library called Simple OAuth (https://github.com/lelylan/simple-oauth2) and cannot get my authorization code to return a token using it. I've looked through some of the source code for the lib. and it is using POST, which appears to be the main issue when getting "Method Not Allowed" errors. I am following the Authorization Code flow example,

How to show roles of user discord.js / userinfo command

本秂侑毒 提交于 2019-12-08 04:29:53
问题 I'm trying to make a 'userinfo' command, and I'm currently stuck on showing roles of the user. Here's my code: const Discord = module.require('discord.js'); const moment = require('moment'); module.exports.run = async (bot, message, args) => { let user = message.mentions.users.first() || message.author; const joinDiscord = moment(user.createdAt).format('llll'); const joinServer = moment(user.joinedAt).format('llll'); let embed = new Discord.RichEmbed() .setAuthor(user.username + '#' + user

Python get all members list from a specific role

你离开我真会死。 提交于 2019-12-08 03:31:20
问题 How to get a members list from a specific role with !getuser command in discord channel. @bot.command(pass_context=True) async def getuser(ctx): bot replys with their ID 1. @user1#123 2. @user2#123 回答1: The rewrite branch provides an attribute Role.members. On the async branch, you'll have to loop through all the members of the server and check their roles. @bot.command(pass_context=True) async def getuser(ctx, role: discord.Role): role = discord.utils.get(ctx.message.server.roles, name="mod"

Discord make channel using bot

百般思念 提交于 2019-12-08 02:43:46
问题 I'm making a discord bot, and I'm trying to make use of the createChannel function shown here in the documentation. For some reason, I am getting the following error: TypeError: bot.createChannel is not a function. My code is within a function which I pass a message to, and I have been able to create roles and add users to roles within the same function. It's just the createChannel function that's not working. Below is the relevant portions of the code. const bot = new Discord.Client();

discord.js send scheduled message

ぐ巨炮叔叔 提交于 2019-12-07 22:08:58
问题 Hi I've just started on Javascript and Node.js, so I don't really know what to do. Please be patient with me.Thanks! So I've hosted a node.js on my physical server. I wanted to create a Discord Bot that sends a daily message on specific timings on my server, for example, I want to send a message to a channel saying "Good Morning" everyday at 8am. How do I do it? Currently, I only have this code to ping the bot(and the server) /* A ping pong bot, whenever you send "ping", it replies "pong". */

How do I get the User ID of a discord user using discord.py

偶尔善良 提交于 2019-12-07 20:31:34
Im using Discord.py and Im trying to get the Discord userid of a user when they type into a channel. The userid can be found when you go into developer mode, and right click on a username, there will be an option "copy id". The current api is not saying how to do this, or I keep missing it The documentation says that the User class have the user's id: http://discordpy.readthedocs.io/en/latest/api.html#user And that Member is a subclass of User : http://discordpy.readthedocs.io/en/latest/api.html#member So if you got a message from a user, you can get the id with message.author.id import

Discord.js Delete Single Message

牧云@^-^@ 提交于 2019-12-07 13:25:55
问题 I am currently working on creating a Discord bot using Discord.js, and I want to have a command that you can tell it ||say Hello or something and it will delete your comment, then say what you told it to. My current code is client.on('message', message => { if (message.content.startsWith("||say ")) { message.delete(1000); //Supposed to delete message message.channel.send(message.content.slice(5, message.content.length)); } }); But this is not working. 回答1: It turns out that I had the correct

Loop through Snowflake array

时光怂恿深爱的人放手 提交于 2019-12-07 07:41:11
问题 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',

OAuth2, Using POST and Yet… Method Not Allowed?

本小妞迷上赌 提交于 2019-12-06 19:56:32
Basically I'm trying to create a website that requires interfacing with the Discord API to retrieve user information to work. To do this, I am using a library called Simple OAuth ( https://github.com/lelylan/simple-oauth2 ) and cannot get my authorization code to return a token using it. I've looked through some of the source code for the lib. and it is using POST, which appears to be the main issue when getting "Method Not Allowed" errors. I am following the Authorization Code flow example, and here is my code: index.js var express = require('express'), request = require('request'); var

discord.js send scheduled message

為{幸葍}努か 提交于 2019-12-06 16:05:28
Hi I've just started on Javascript and Node.js, so I don't really know what to do. Please be patient with me.Thanks! So I've hosted a node.js on my physical server. I wanted to create a Discord Bot that sends a daily message on specific timings on my server, for example, I want to send a message to a channel saying "Good Morning" everyday at 8am. How do I do it? Currently, I only have this code to ping the bot(and the server) /* A ping pong bot, whenever you send "ping", it replies "pong". */ // Import the discord.js module const Discord = require('discord.js'); // Create an instance of a