discord.js

Discord.js Embedded message multiple line value

痞子三分冷 提交于 2020-07-06 11:34:34
问题 The standard way of sending an embedded message is: message.channel.send({embed: { color: 3447003, title: "Test:", fields: [ { name: "Test 1", value="Test"}, { name: "Test 2", value: "TEST"}, { name: "Test 3", value: "TEST"} ] } }); I was wondering if there is any way I could make the messages in block form for example: Test1: Test2: test1 test1 test2 test2 test3 test3 test4 test4 I'm aiming so it goes inline and you can input multiple values/per title. First I thought that \n would do the

I keep getting this error on my discord bot: 'HTTPError [AbortError]: The user aborted a request.'

﹥>﹥吖頭↗ 提交于 2020-06-29 04:11:29
问题 What does this mean, and how do I fix it, I know for a fact my code is correct and nothing is wrong with it, I checked with multiple friends. I have no idea why this is happening and I need my bot to start working soon. 回答1: This is an error happening within the discord.js library if a web request is stuck for a long time, which might happen due to an outage or bad internet connection. Those connections are killed with that error message to free resources. Those errors should not be fatal and

Make admins not kick each other

倾然丶 夕夏残阳落幕 提交于 2020-06-29 03:57:06
问题 Making a kick command. I am trying to make a command so that the admins cannot kick each other. if(message.author.hasPermission('KICK_MEMBER', 'ADMINISTRATOR') && message.member.hasPermission('KICK_MEMBER', 'ADMINISTRATOR')) return ('You cant kick another admin!') But I get an error. TypeError: message.author.hasPermission is not a function 回答1: So basically you are trying to use message.author.hasPermission('permission') . The property author of the message object is a User , which is a

discord.js wait before send message

随声附和 提交于 2020-06-28 05:14:17
问题 My problem is that I want my discordbot wait during the giveaway until the giveway is out Here's my code : const Discord = require('discord.js'); const client = new Discord.Client(); const config = require("./config.json"); var prefix = config.prefix; client.login(config.token); client.on('ready',() => { console.log('I\'m online'); }) client.on('message', message => { const args = message.content.slice(prefix.length).trim().split(/ +/g); const command = args.shift().toLowerCase(); if (command

How does bulkDelete work?

两盒软妹~` 提交于 2020-06-28 04:12:42
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

How does bulkDelete work?

佐手、 提交于 2020-06-28 04:12:23
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

How to get data from online radio?

女生的网名这么多〃 提交于 2020-06-28 03:57:09
问题 I'm making Discord radio bot (In JavaScript) that streams online radios.I want to add now-playing command, but Idk how to recognize that song or where I can find metadata from that radio station. I want to add more than 10000 radio stations, but firstly I have to fix this... Thx for every answer! (Also... Sorry for my english I'm from the Czech republic) 来源: https://stackoverflow.com/questions/62459614/how-to-get-data-from-online-radio

How to get data from online radio?

瘦欲@ 提交于 2020-06-28 03:57:02
问题 I'm making Discord radio bot (In JavaScript) that streams online radios.I want to add now-playing command, but Idk how to recognize that song or where I can find metadata from that radio station. I want to add more than 10000 radio stations, but firstly I have to fix this... Thx for every answer! (Also... Sorry for my english I'm from the Czech republic) 来源: https://stackoverflow.com/questions/62459614/how-to-get-data-from-online-radio

Discord.js How to check if the user does not accept Direct Messages

不问归期 提交于 2020-06-25 05:35:10
问题 I was wondering if it is possible for a Discord bot to be able to check if a specific user the bot is trying to DM accepts direct messages. Right now this is my code: exports.run = (client, message) => { try { message.author.send(`:ok_hand:`); } catch (err) { message.reply('Cannot send Direct Messages to your user!'); } } But I want the code to be able to tell if the user is accepting direct messages before trying to send the user a message. Is this doable? 回答1: Its not possible. The only way

I am getting this “Error: FFmpeg/avconv not found!”

試著忘記壹切 提交于 2020-06-17 13:10:27
问题 I am trying to create a discord bot, however receive this error every time I try to run a youtube link. Error: FFmpeg/avconv not found! at Function.getInfo (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:130:11) at Function.create (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:143:38) at new FFmpeg (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:44:27) at AudioPlayer.playUnknown (C:\Users\-\discord-bot\node_modules\discord.js\src