#development
1 messages Β· Page 479 of 1
what data?
const data = loadImage(body);
data from the image
I mean
body
const { body } = await request.get(image);
is image a url?
of so, you dont need request
or nvm
it should be something with img = new Image; img.src = data;
module.exports.run = async (client, message, args) => {
var user = message.mentions.users.first() || message.author
var msg = message.author.displayAvatarURL || user.displayAvatarURL
var image = msg
try{
const { body } = await request.get(image);
const data = loadImage(body);
const canvas = new Canvas(data.width, data.height);
ctx = canvas.getContext('2d');
ctx.drawImage(data, 0, 0);
distort(ctx, 20, 0, 0, data.width, data.height, 5);
const attachment = canvas.toBuffer();
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
return msg.say({ files: [{ attachment, name: 'glitch.png' }] });
} catch (err){
console.log(err)
}
}
I have image defined
I need it to be that
you dont need image = msg
Why not
Ok
regardless its much easier (and probably better) to manually define the canvas size
instead of waiting for an image
its better to work with a defined and constant size
you can get it after
i mean, if you're copying the entire command like that, you could also just use canvas 2.0
but if you prefer to adapt to 1.6
the solution would be something like canvas = new Canvas(400,400); ctx = canvas.getContext("2d"); img = new Image; img.src = data; ctx.drawImage(img,0,0)
but im not sure about how node-superfetch treats images, so data might not work directly like that
data here is body from your code
what you get from request
Ok
I will figure it out one day
rn not in the mood
I may just use
the 2nd version or something
canvas 2.0
i use canvas 2.0
never had any problem with it, even tho they say its in alpha version
its in their github page
whatever is before .run is undefined
Ye
We can't help if you provide zero code
const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command));
} else {
cmd.run(client, message, args);
}
well, cmd is undefined
yea
so you have to review why
And how do I do that?
^
console.log(cmd)
console.log client.commands and command
to see if they contain an expected value
hm?
Anywa
Tim I am trying to make a setchannel command
so it will set whatever channel the command is used in
as logging channel
My friend
started it
const Discord = require("discord.js")
const storage = require('node-persist');
/**
* @param {Discord.Client} bot
* @param {Discord.Message} message
* @param {Array<string>} args
*/
module.exports.run = async (bot, message, args) => {
switch(args[0]){
case "channel":
var chan = message.mentions.channels.first();
if (chan.guild.id != message.guild.id) await message.channel.send("nice try");
else {
storage.setItemSync();
}
}
}
module.exports.help = {
names: ["logging"]
}
Now I need help with the rest cause
idk what he was trying to do
he just said ima try something
I know what he was doing with the first part
that code is horrid
This is my config thingy lol https://gyazo.com/dff4b383c82f8ecdf3b6c05910a24819
My config file is a JS not JSON btw
ew swear filter
its not really a problem if its opt in
How would I do like a case number?
So everytime the command is used
the case number goes up 1
db
Like for a kick command
Kick report | Case#1
Kick report | Case#2
Ah ok
could I use
quick.db?
then learn
I know
or be a fucking meme, use json and cry when all your data gets corrupted
sql a bit
Um
Ok
Whatever
Wasn't going to use a json
What would go inside creating the table
nvm
Anyone want to help me handle some errors?
I have an API that handles grabbing currency exchange rates.
When a user uses !command usd
it will show rates from usd
but you know how it is
Im using parse so if they type in a nonexistent thing it gives me errors
any ideas how to fix?
to start with you could do a simple validation and make sure it follows the currency ISO (https://en.wikipedia.org/wiki/ISO_4217 - basically 3 chars, only letters)
furthermore you could validate the input and compare it against a list of currencies, if you don't want to go in the trouble of doing that you can just do the requests, catch the w/e error that API throws (probably it will throw something related to unknown / invalid currency) - check for that and respond accordingly
I have something like this
let USD = parseusd
Of course it actually has the code
My point is
If they do !check usd
USD won't be on the api to parse
So how would I go about throwing it?
People, hello.
I may be retarded, but how does one list the roles of a user in a guild? (discord.js)
how would I add my own css to the discordbots website for my bot?
oh, gotcha, do you know what I need to target for the background off the top of your head
guess I could try body
yeah
yall like stupid data porn right?
wut
just collected some neat data from my bots users showing how methodical people can get
we're programmers not data analysts
yea but like
yea
basically it was a graph of the players movement and colonization efforts through space and pretty much ever player followed a pattern
i have a graph for it :f
whats the reasoning behind lucas discord pic anyhow?
curious
its some boy named luca
as in a random boy named luca on the internet?
wow thanks google https://magic.school-b.us/487123804728852480.png
i never knew luca was a boy
.
I am trying to make a help command where you use reactions to look at certain categories
like NSFW would have its own category and Utility would have its own
and you use reactions to view a certain one
Yea it does
I know how to do that im not that dumb
I am just wondering how I would make it do categories
as in recommendations for emojies?
No
as in how you would go about categorie organization etc?
Ig
i mean i would have it output like
π« game commands
π¨ General commands
...
etc
and react with those
and when it clicks
edit the message
to return whats inside that categorie
Ok
and when you go into a category
have one reaction be β
to return to previous page
ya feel?
Mhm
i dont know how many commands or their varience the bot has so im not sure how graceful it would be
All i needed was that
ah ok
Now I need to pick the emojis
which will be a bitch
xD
I am picky about everything
lol
all about that ux
if you were really cool you would make custom emojis following googles material design principles and integrate those into all your selections
but for time sake no xD
i need to do a rework badly :/
Hm
i have adopted a bunch of new principles when programming which all this invalidates
What language?
nodejs
Same
web application developer
but
the libraries and such i wrote for my codebase
are so spaghetti and obsolete
tempted to do a rewrite
but thats every programmers answer and it just takes alot of time to go about that so im going to instead just revise the current functions to fit my new standards
and let it be
instead of the total rewrite
anyhow make those custom emojis
be unique and cool
Yea
lol ive never fully rewritten my bots
module.exports.run = async (client, message, args) => {
var embed = new Discord.RichEmbed()
.addField(":gun:Fun commands:", "React with :gun: to view them!")
.addField(":mailbox_with_mail:Mod Commands:", "React with :mailbox_with_mail: to view them!")
.addField(":scroll:Information Commands:", "React with :scroll: to view them!")
var msg = await message.channel.send(embed)
message.delete().catch(()=>{});
await msg.react("π«")
await msg.react("π¬")
await msg.react("π")
await msg.react("β»")
var Fun = msg.createReactionCollector(FunFilter, {time: 60000})
var Mod = msg.createReactionCollector(ModFilter, {time: 60000})
var Info = msg.createReactionCollector(InfoFilter, {time: 60000})
var del = msg.createReactionCollector(delFilter, {time: 60000});
del.on("collect", async r=>{
await msg.edit("Thanks for taking the time to read the ToS!",{embed:null});
setTimeout(()=>{
msg.delete().catch(()=>{});
//catch for making sure the function won't call it an error
//as the message could be deleted in that time
},5000);
});
}
im just modifying existing functions and portions of code to fit new standards
how is this so far?
lol
you disgusting
let
meanie
or const
why
Yes
ok :c
Wym
.
Boy
as counterproductive as it sounds i dont use semi colons at all anymore
Le Slap
Anyway
I am going to try something
I never done before :O
jk
I done it kinda
Wait
Hold up
can i do
like
like
Fun.on("collect", async r=>{
await msg.edit(embed2)
})
have another embed
have
the Fun embed
defined as embed2
and do
await msg.edit(embed2)
can't I do that
huh?
Idk
oh your talking about navigating the menues
so personally i would keep a seperate directory containing all the navigational menus and have one function that calls the correct one and then edits
like um
I could do it in my config
well no
I could
but that would add an extra step I have to do
and I am almost out of time
xD
function fetchMenu(arg){
//fetch menu from menus/ directory
//require(arg.js).menu
//pass menu to displayMenu
}
function displayMenu(menu){
//edit the current message to be new menu
}
this is how i would go about it imo
just so theoretically its super easy to interchange with new menues
or add new menus onto it
etc
example time
// menus/fun.js
module.exports.menu = {
fields : [] //discord js embed field containing the submenu
}
// help.js fil
let frameMessage = {
embed: {
title : 'Navigation',
description : 'React to navigate menu\'s',
fields : [{
//put initial fields here that tell user of diffrent menus
}]
}
}
/**
* Pass it a string which is name of file its going to fetch
* @param {String} arg
**/
function fetchMenu(arg){
let fetchedMenu = require(`./menus/${arg}.js`).menu
displayMenu(fetchedMenu)
}
/**
* Pass it a object containing fields in the fashion of a discord embed
* @param {Object} menu
**/
function displayMenu(menu){
frameMessage.fields = menu.fields
message.edit(frameMessage)
}
//so the idea is whenever you want to swap the menu out just call
fetchMenu('fun')
fetchMenu('general')
Hmmm
That seems like a lot of work
I will experiment with that tomorrow as I am on little time rn
so the idea
behind that
is that its theoretically infinitely expandable and interchangeable
idk
you do you boo
also jsdoc comment scheme because force of habbit (i dont even use js doc i just like the commenting methodology)
you use await or then and then modify that message variable ex: message.channel.send(embed).then ( (edittedMessage) => { editMessage.edit(); }); or you can do await
You can do await
Hello
const dick = await message.channel.send('para is weeb')
dick.edit('para is mega weeb')
client.on('message', message => {
let reason = message.content.split(" ").slice(2).join(" ")
let muterole = message.guild.roles.find("name", "muted")
let men = message.mentions.users.first()
if(message.content.startsWith(prefix + "mute")) {
if(!men) return message.channel.send("**Do you want me to mute you π€ ?, please @mention someone. `Ex. #mute @xRokz bad boy`**");
if(!reason) return message.channel.send("**Do you want me to mute " + men.username + " with no reason ?, `Ex. #mute @xRokz bad boy` or just use `none` for no reason **`")
if(!muterole) {
message.guild.createRole({name: "muted", color:"#505f74", permissions: [1115136]})
}
message.guild.member(men).addRole(muterole)
message.channel.send("**" + men.username + " has been muted! :zipper_mouth:**")
}
if(message.content.startsWith(prefix + "unmute")) {
if(!men) return message.channel.send("**please @mention someone. `Ex. #unmute @limber wave bad boy`**");
if(!muterole) {
message.guild.createRole({name: "muted", color:"#505f74", permissions: [1115136]})
}
message.guild.member(men).removeRole(muterole)
message.channel.send("**" + men.username + " has been unmuted! π **")
}
})```
this good or bad vote 0/10
im vote 7/10
what
this code good or bad @knotty steeple
does it matter
If it works, it works
Not like you making something for nasa
But, it does look fine, for what I can see
Rainbow allowed ?
Wut
rainbow role probably
i can make afther 5 min change color
@earnest phoenix
?
imo dont hard code commands
into your msg event handler
load them from separate file(s)
Changing role color every 5 min is fine afaik
np
the way i do it is
put all my commands in a directory called plugins
and in my main bot file
i put my commands in my cmds folder then I have subfolders for each section
i dont put subfolders
i just say subject-w/e it is.js
so like bot-economy.js
bot-exp.js
fun-misc.js
etc
const size = config.colors;
const rainbow = new Array(size);
for (var i=0; i<size; i++) {
var red = sin_to_hex(i, 0 * Math.PI * 2/3); // 0 deg
var blue = sin_to_hex(i, 1 * Math.PI * 2/3); // 120 deg
var green = sin_to_hex(i, 2 * Math.PI * 2/3); // 240 deg
rainbow[i] = '#'+ red + green + blue;
}
function sin_to_hex(i, phase) {
var sin = Math.sin(Math.PI / size * 2 * i + phase);
var int = Math.floor(sin * 127) + 128;
var hex = int.toString(16);
return hex.length === 1 ? '0'+hex : hex;
}
let place = 0;
const servers = config.servers;
function changeColor() {
for (let index = 0; index < servers.length; ++index) {
client.guilds.get(servers[index]).roles.find('name', config.roleName).setColor(rainbow[place])
.catch(console.error);
if(place == (size - 1)){
place = 0;
}else{
place++;
}
}
}
client.on('ready', () => {
console.log('Bot Is Online')
if(config.speed <60.000){console.log("The minimum speed is 60.000, if this gets abused your bot might get IP-banned"); process.exit(1);}
setInterval(changeColor, config.speed);
});
IP banned
xD
more like API banned
Ok so 864 developers online, do anyone knows how to do what I asked for (DM me who is experienced in API verification bots)
sorry im copypasting from general
If anyone it's expert in those and knows how can I make something to verify the ranked elo of the game Town Of Salem please DM me
is theres a ToS API?
Welp check https://astris.xyz/
a bot that works with an Elo verification bot in the specific discord channel
i want something simple
astris is too complex tbh
you can see ur reports, info, money in game gold everything
You do a command !setign and put your game name, then you have to log into their forum and you'll get an link ''!verify" and a big code.
But you have to be logged in ''trial system''.
http://blankmediagames.com/Trial/
it looks like astris has direct access to the ToS database
i really dont know, because that's not an official tos channel
it was but now it isn't
is there an official tos channel
they might of contacted the devs of ToS abt this project
welp isn't really ''not official'' since reedit bot still says that they have 3 discord channels and the channel that astris has is one of them
i tried to talk with the dev but he is inactive.. so i couldn't find him on discord
O
h
solved it
found the api but i still give roles manually, but now i can do commands like !elo and etc
yass
hey
post some code
for us to dissect
test
kk that was just me testing smth
um
wait a second...
oh didnt know you could do that
iirc python doesnt have console.log()
can you ?
it has print
yea
console.log() is javascript for print in python
try to change it to discord.js kthx
@earnest phoenix try to learn javascript first π
try using fs to read token.json
u dont need fs to read token.json
tbh he/she doesnt know how to code
html is not a coding lang
Doesn't work
String balance = rs.getString("balance");
channel.sendMessage(balance);
Work
String balance = rs.getString("balance");
sout(balance);
helpp 
sendMessage?
wat lib?
jda
isnt sendMessage deprecated
no
in d.js yes but jda no
@upper ember .queue()
π
but thanks
const discord = require('pizza.py');
const client = new life.buy();
const tokens = require('./life.json');
client.on('eating pizza', ) => {
console.log('I HAVE CANCER!');
});
not a fake code
naming a js module with .py season 1
...
pc
probably depends on the device youre viewing it on
you do realize that there isnt a standard "pc" resolution right
oofs
im not too familiar with html but cant you specify dimensions in %?
Please enter at least 300 characters excluding special characters in your detailed description. If you use iframes, you need to use at least 300 more characters..
am dead
i cant even embed a website
oofs
Yes you can groovy
<img a="google.com/img.jpeg" width="50%">
w3schools.com/html I believe is a good html docs guide
yyeh i use that
https://gyazo.com/9f6c68f384ea6fdd48711b9edf072661
I want it to look like this, but how can I make it so when they click on one of them it switches to that embed
Listen to reactions and supply some checks
I have the
If you are using Discord.js there is a reaction collector
Yea
thats what I did
I have all that
now the problem is
getting it to switch embeds
when a reaction is clicked
Use the edit method and specify a new embed object
Hmmm
I have something similar
Note I did this half asleep
so may be a lot of mistakes
or such
OOF ofc hastebin not working
you dont need 3 reaction collectors, only one
you can detect which reaction was used with the collect event
So you are trying to pass an object into an embed value?
Where are you getting object output
You have to interpret the data in the object
it's not but whatever you have to tell yourself
it's not but whatever you have to tell yourself
JDA what?
what's a JDA
you
you kill the process 
shush
;3
like when bots say online green and offline gray and that
@barren brook
sorry had to get a glass of water
mess aroudn with this
k'
yo does anyone know why my cmd keeps just randomly closing?
not if u don't give more info
Are you using batch
Send code
why are my commands not working from glitch anyone know why?
Send code of index.js
i will pass
like it runs fine for like 30m
then we can't fix ur problem lmao
then just closes
like link to glitch
No
ohh code the code
Just your bots code without token
k
@lofty abyss without code i can't help you, it's in the code
the help code is the prob
module.exports.run = (client, message, args) => {
const help = new RichEmbed()
.setTitle("Help")
.setDescription("Here are the commands:")
.addField("a-Joke","Sends a random joke")
.addField("a-Help","Shows this")
.addField("a-Ping","Responds with pong")
.addField("For people with the permission,","These commands will work")
.addField("a-Kick @user","Kicks a user")
.addField("a-Ban @user","Bans a user")
.addField("a-Role {user} {role} & $Delrole {user} {role}","Gives/Removes a role from a user")
.setColor(0x00ff00)
.setFooter(`Help for ${message.author.tag}!`)
message.channel.send(help)
}
module.exports.help = {
name: "help"
} ```
thast the help command
What is the issue
wont work
Errors?
not just not working when i do the command.
Can you log if the command has been called?
like add console.log('hey') to the start of the run method
k
and
is this command right? client.user.setStatus('idle') .then(console.log) .catch(console.error);
can you edit it and send it back please
client.user.setStatus('idle')
.catch(console.error);
ok
ill do status.js
says client is not defined
how do i put my bot status saying watching instad of playing
I am using python to write a bot, is it possible to list all servers using the bot?
what do you mean?
if its getting all servers that your bot is in ,then client.servers returns an iterable
So, I've been using SQLite for my bot's warn system, and it keeps returning the following error:
(node:12300) UnhandledPromiseRejectionWarning: Error: SQLITE_ERROR: incomplete input
warning.js:18
(node:12300) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
My SQLite code is as following:
sql.get(`SELECT * FROM warnings`).then(() => {
// Warn Code Here
}).catch(() => {
console.error;
sql.run(`CREATE TABLE IF NOT EXISTS warnings (variables)`).then(() => {
// Same Warn Code Here
}
});
Am I doing something wrong here?
The warning.js is a file created by VSCode's debugging process.
A-anyone able to help me out? Sorry for being inpatient, I want to fix this asap.
Oh, I get a different error on the hosting. It simply says Cannot read property 'run' of null, no additional info is shown.
how do you get that
How do you define query?
let rateCAD = JSON.parse(data).rates.CAD;
let rateEUR = JSON.parse(data).rates.EUR;
let rateAUD = JSON.parse(data).rates.AUD;
let rateNOK = JSON.parse(data).rates.NOK;
let rateGBP = JSON.parse(data).rates.GBP;
let rateBGN = JSON.parse(data).rates.BGN;
let rateBRL = JSON.parse(data).rates.BRL;
let rateCHF = JSON.parse(data).rates.CHF;
let rateCNY = JSON.parse(data).rates.CNY;
let rateCZK = JSON.parse(data).rates.CZK;```
How can I throw the error if one of those is non-existent?
I need to...
const parsed = JSON.parse(data);
let x = parsed.x;
let y = parsed.y;```
breh
I need it to update
every time the command goes
it all works
mind if I DM you code?
it would help me explain it
@knotty steeple Since I am sort of lazy
@commands.command(aliases=['pong'])
async def ping(self, ctx):
"Bot's connection to Discord."
t1 = time.perf_counter()
await ctx.channel.trigger_typing()
t2 = time.perf_counter()
# your stuff```
you don't need to parse it for every line
data doesn't change
you're just wasting cpu and memory to parse it
data does change lol
it doesn't
it might change from one invocation to the other
but it definitely won't from one line to the other
alright. I will do
but thats not the issue
basically
I need it to get all exchange values from an args base
so !check usd
would make the base usd
then dm u the values
but if I try parsing usd
it wont exist
so I need to throw the error
anyone else willing to help?
I recommend using a full database
@earnest phoenix
JSON is quick but it is also slow and error prone
β
What are some good ways to reduce memory?
in js?
Tim
Wassup my dude
can you help me with something
what are some good things to use for making a music command?
no idea
So I got the bot to shard and it works beautifully, but, it breaks the reload command. So, how does one make all shards run a function via broadcastEval?
Hm
How does one make your music command do searches instead of URLs
How does one
get a Youtube Data API ey
key*
Ok
nvm
I got it
Can someone help me with the search feature?
I am using a npm package called youtube-search
I have part of it done
but I need help with the other part
You guys ever seen those bots with an embed, and then when you click βΆ or something it changes to a new embed?
how on fuckery of fucks do they do that
reaction collectors and crap
my bot does that
ya mind sharing how it does that
use reaction collectors like tony said
also
do you mean pages
or actual embeds
I know how to do pages
but not switching from embed to embed
I tried doing
that
like
message.edit(embed)
but it just returns
[object Object]
in chat
dumbass, lmfao. its { embed: embed }
i'm not
"dumbass"
Just cause I didn't know something
doesn't mean you have to be a dick about it
yeah yeah whatever ok
lmfao
You copy the server ID's the bot is already in
and paste them there
like
Ex: 264445053596991498, 482616256592085012
all servers !?
how can i get web ?
how can i do website
It is optional
you dont have to
but if your bot has a website
put the bot's website URL right there
okk
all good man, about to disappear for an hour or so anyway
I'll shoot you a dm later
Okie
I keep getting this error in chat telling me to connect to a VC
but I am in one
so idk why it says that
np
β€
when my bot approval ?
(node:1572) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'g
et' of undefined
at Object.module.exports.run (C:\Users\User\Desktop\LoverBot v3\commands\mus
ic.js:24:33)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
id: 2)
(node:1572) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
I do not understand...
activate is undefined
π
Thanks again
lmfao
active and activate
are close together
it sometimes corrects itself to activate
Ok this one
I do not understand where the error is
(node:10908) UnhandledPromiseRejectionWarning: TypeError: data.connection.play i
s not a function
at play (C:\Users\User\Desktop\LoverBot v3\commands\music.js:49:53)
at Object.module.exports.run (C:\Users\User\Desktop\LoverBot v3\commands\mus
ic.js:37:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:10908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejectio
n id: 2)
(node:10908) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.
data.dispatcher = await data.connection.play(ytdl(data.queue[0].url, {filter: "audioonly"}));
I don't understand
how that is not working
I know it says it is not a function
but how can I fix it?
connections only have play if they exist, so idk
maybe
or something
no wait
nvm
@sick cloud I had to do playStream
like I said XD
how can i fix this problem ?
responds to bots
?
is your prefix -
yes @lusty dew
that is why then
as to how to get your bot to ignore the other bots
i do not know
I hope I don't have that problem o.O My bot's prefix is mentioning it
xD
TypeError: Cannot read property 'emit' of undefined
at Object.module.exports.run (C:\Users\User\Desktop\LoverBot v3\commands\ski
p.js:27:35)
at Client.client.on (C:\Users\User\Desktop\LoverBot v3\index.js:57:31)
at Client.emit (events.js:187:15)
at MessageCreateHandler.handle (C:\Users\User\Desktop\LoverBot v3\node_modul
es\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\User\Desktop\LoverBot v3\node_mod
ules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\User\Desktop\LoverBot v3\node_modu
les\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\User\Desktop\LoverBot v3\node_mod
ules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\User\Desktop\LoverBot v3\node_modules\ws\li
b\event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
at Receiver._receiver.onmessage (C:\Users\User\Desktop\LoverBot v3\node_modu
les\ws\lib\websocket.js:137:47)
Error Line:
return fetched.dispacther.emit('finish')
fetched and/or dispatcher are undefined
Hmm
ok
It is
dispatcher
I defined fetched
hmmm
For some reason
my pause command
did not pause the song
Fixed it
@viral iris what discord lib is your bot?
bot.js
ok
ah...
so discord.js
no...
yeah
xD
so ur bot is a 1 file bot?
yes
in the message event do if (<MESSAGE>.author.bot) return
<MESSAGE> is wat u defined message
in all codes ?
wait... dont tell me u did something like this
const Discord = require('discord.js')
const client = new Discord.Client()
client.on('message', (message) => {
//command 1
})
client.on('message', (message) => {
//command 2
})
client.login('DIsIs.MyTOkEn.KthxBye')```
@viral iris ??????
hm....yes @lament meteor
u gotta do it to all of em then
why did u do that when u can do all the cmds in 1 event
did u set the MaxEmmiters to like 1000?
have one event
Such creative token
You don't need a message event for every single command
@fossil oxide or @bitter sundial why my bot (@desert dagger) is muted? π
oof
well i checked and it responses to other bots
good thing he didn't ping all three of them
also this isnt the channel to ask those stuff @fluid sonnet
what
How can I get the bot to create a server invitation when someone uses a command on a server?
Mk. Let me see.
So you want it to create a server invite for the server the command is run in?
Yes
Is this bot for your server only?
No
Read through that and the comments. It should describe how to do it and where the user went wrong.
Something like that should work (I added the unique boolean).
Where do I have to copy this purely?
ok
Hey guys!
How can you make a command restricted to people who haven't voted for the bot yet?
Yep
Use FS to write a file in JSON format
You can use the dbots API to see who votes
Add their name to the file
Then have it read the filr
File*
And check if they are on it
don't do that.
?
Do not ever use fs to store data in json files, fs is not meant for that purpose and will fail at some point or another
you don't even need to store it in any database, you can keep the voters in memory
yea
I learned that the hard way o.O
C:\Users\User\Desktop\LoverBot v3\index.js:70
});
^
SyntaxError: Unexpected end of input
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:670:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
'bot.guild.size' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
I can't find the source
index.js line 70
How can I make a blacklist command? So that one indicates the user id in the second and then the ID is geblacklistet how does it work?
Because I need such a command because if one of the Bot with Commands fully Spammt
have a db
and add an owner cmd to add/remove users ids from it
then on message, stop if the users id is in there
What should I do?
i literally just told you

My english is not good sry π¦
have a database that has all the blacklisted IDs that only you can add to, then check the db in your message handler if the given message author's ID is in the db
then just return out of the message handler if there's a match
i have no Database
Du sprechst deutsch @remote heart
Wenn du das tust, dann ping mich einfach an, was in Deutsch falsch ist, wenn es deine Hauptsprache ist. und ich werde versuchen, so schnell wie mΓΆglich zu dir zu kommen
My German is a little rusty, I haven't actually used it alot lately, so I am going to be slow on the responses, and Google a little bit just to check if I wrote the right thing π
ascended
Lol
hey guys, any shade of light here would be appreciated, my bot is public a couple days and its in a dozen of servers but from some I randomly get this, haven't been able to reproduce yet
fails on .react(...) w/ discord.js
You are missing the right permission to use it
it does not miss permissions 
in fact, permissions error is "Missing Permissions"
not always
Some times it happens with my bot coin system
for example, if it doesnt have view message history permission, it might throw unknown message error
message might've been deleted
I thought so, but wouldn't it throw Unknown Message, if message was deleted?
yes
missing access sounds like it can't access that message anymore
It's a missing Access error
like no longer perms to view the channel the message was posted in
I'm actually gonna try to reproduce like that 
thanks XD
regardless, missing access is related to a specific permission probably
try message history and reactions permission
will add message history perm I guess 
see how that goes
one more question
I was really curious about
if you do message.channel.members.size in #265156361791209475 its around 9k
any reason why that is when the server has like 20k members?
most libraries cache members as they come online
so at startup the bot can only see online members, and then as more members come online, he starts caching and remembering them
whats this?
(node:12120) UnhandledPromiseRejectionWarning: Error: StatusCodeError: 400 - {"embed":["fields"]}
a promise threw an error and it wasn't catched, you can listen to unhandledRejection for more info or catch the w/e promise threw the error
console.error('unhandledRejection', error)
})
@vernal rivet Ja cih spreche Deutsch
does javascript = js?
Yes
thanks
Np

@remote heart Was ist das Problem?
Ich werde in wie 20 Minuten zur VerfΓΌgung, ich bin an der Schule, ich gehe zum Mittagessen in 20 Minuten
Saure Kartoffel eher Deutsche Kartoffel 
Lol, er ist
.
hello]
const args = message.content.split(" ").slice(1)
const server = client.guilds.find(m => m.name.toLowerCase === args[0].toLowerCase())
if(!server) return message.channel.send(`Not found!`)
server.members.forEach(m => m.send(args.slice(1)))
}``` allowed ?
this only on my server

still counts
not sand to all server
having issues with express statics. no matter how much i try, they won't work, any idea why on this? π
also, the files AND path exist
show code bobo
