discord

How can I embed messages using a Discord bot?

佐手、 提交于 2020-12-15 05:01:20
问题 I want to code a bot that will embed a user's sent message in a specific channel. If you know anything about GTA RP servers, it's like a Twitter or Instagram bot. Here's an example: I think it's something about the console.log and the author's name, but I'm not sure so that's why I'm here. How can I embed users' messages like this? 回答1: You can use a MessageEmbed, like programmerRaj said, or use the embed property in MessageOptions: const {MessageEmbed} = require('discord.js') const embed =

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

≡放荡痞女 提交于 2020-12-15 01:55:38
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

試著忘記壹切 提交于 2020-12-15 01:55:26
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

How to use discord python bot with proxy?

谁说胖子不能爱 提交于 2020-12-13 10:49:10
问题 Need to use discord bot with proxy (https or socks). For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass I already try with this example: how to connect a discord bot through proxy but it can't. client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)) 回答1: You need to create a aiohttp.ProxyConnector and pass that as the connector to your Client : from aiohttp import ProxyConnector, BasicAuth basic_auth =

download file to local computer sent attatched to message discord

六月ゝ 毕业季﹏ 提交于 2020-12-13 07:23:45
问题 after looking on the Discord.js docs i can find an answer for the question, does someone know how to do it? theres already a question the page but has no answers or comments. imagine that someone on the chat sentí an image, is there a way of the bot downloading the image or get the url of the image? thanks! 回答1: For starters... You'd need the code to access the attachment. client.on(`message`,function(msg){ if(msg.attachments.first()){//checks if an attachment is sent if(msg.attachments.first

Discord bot can't show emote “sometimes”

北城余情 提交于 2020-12-12 02:38:13
问题 As a french Gwent player, I built a discord bot (using node.js and discord.js) to show the infos of a card when you name it. It uses some custom emotes to show some part of it. It worked well for a few weeks, but recently some cards don't show the emotes when called. I have no clue about what could be wrong. The emotes work if you use it yourself on the channel. Some cards show the emotes, others don't, even if they use the same emotes. And it's always all emotes or none for each card. I

Discord bot can't show emote “sometimes”

女生的网名这么多〃 提交于 2020-12-12 02:36:15
问题 As a french Gwent player, I built a discord bot (using node.js and discord.js) to show the infos of a card when you name it. It uses some custom emotes to show some part of it. It worked well for a few weeks, but recently some cards don't show the emotes when called. I have no clue about what could be wrong. The emotes work if you use it yourself on the channel. Some cards show the emotes, others don't, even if they use the same emotes. And it's always all emotes or none for each card. I

How to make discord python bot react to its own message?

蓝咒 提交于 2020-12-07 15:19:54
问题 Currently working on a small bot which sends an embed and I want it to react to itself but am unsure on how to do that. Any help? 回答1: Get the message you want to react to and use Client.add_reaction() For example, if you're reacting to an embed msg = await bot.send_message(ctx.message.channel,embed=embed) await bot.add_reaction(msg, "😮") 回答2: If you have this in your code if message.author == client.user: return Your bot will not respond to itself, and it shouldn't respond to itself normally

addRole is not a function

断了今生、忘了曾经 提交于 2020-12-06 04:36:00
问题 I am creating a Discord Bot. I am trying create a Mute command, but I always get the same error. What went wrong? Background information: Discord.js version: 12.0.0-dev Klasa with version 0.5.0-dev is used Code: const { Command } = require('klasa'); const { MessageEmbed } = require('discord.js'); module.exports = class extends Command { constructor(...args) { super(...args, { description: 'Mute an user.' }) } async run(msg, args) { if(!msg.member.hasPermission("MANAGE_MEMBERS")) return msg

addRole is not a function

跟風遠走 提交于 2020-12-06 04:35:52
问题 I am creating a Discord Bot. I am trying create a Mute command, but I always get the same error. What went wrong? Background information: Discord.js version: 12.0.0-dev Klasa with version 0.5.0-dev is used Code: const { Command } = require('klasa'); const { MessageEmbed } = require('discord.js'); module.exports = class extends Command { constructor(...args) { super(...args, { description: 'Mute an user.' }) } async run(msg, args) { if(!msg.member.hasPermission("MANAGE_MEMBERS")) return msg