#development
1 messages Β· Page 509 of 1

its the end event
fuck this isnt testing 1
lol
i keep running commands in not testing channels
lmao
Cloudflare seems to be blocking some of my requests on discord.. maybe it thinks its a DDoS attack... js (node:8996) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 104.16.58.5:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14) (node:8996) 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: 5793) I think this may be because I'm doing js message.channel.fetchMessages({limit:2}).then(MSGS => { on Each message.. if this is true.. is there any way I could do the same thing without spamming the API?
why the developer portal is constantly generating tokens?
Well don't spam the API.
what do you mean?
well is that API spam?
Everytime I refresh the page, a new token is generated
I mean fetchMessages could always be client-side
You should not ever need to fetch messages every single message
how to stop it @earnest phoenix
how to get the token then
I copy the token then enter it to my code and then it says incorrect login details
...
@earnest phoenix ?
what
I copy the token that I revealed then I enter it in my code and when I run it, it says incorrect login details
incorrect token then
but everytime I copy a different token, I get that error
so...
try regenerating it
did that
yeah?
dont refresh the page lmfao
I know
const Discord = require('discord.js');
const client = new Discord.Client();
const economy = require('discord-eco');
client.on('message', message => {
let prefix = 'c.';
let msg = message.content.toUpperCase();
if (message.content.toUpperCase() === `${prefix}PING`) {
message.channel.send('Pong');
}
if (msg === `${prefix}BALANCE` || msg === `${prefix}MONEY`) {
economy.fetchBalance(message.author.id).then((i) => {
const embed = new Discord.RichEmbed()
.setDescription(`${message.guild.name} Bank**`)
.addField('Accound Holder', message.author.username)
.addField('Account Balance',i.money,true)
message.channel.send({embed})
})
}
});
client.login('token');
error unexpected end of input

means u have a typo
You didn't close a parenthesis of bracket
discord bots β’
Tom pls
u mean unexpected end of input
what is discord-eco anyways
r u real thats not dev question
discord eco is autism eco for people for hmnever spent 5 minute learning the concept of using a db
and actually doing points
so is it a discord economy system in a npm package
haha sad
class CoinFlipCommand extends commando.Command
{
constructor(client)
{
super(client,{
name:'flip',
group: 'simple',
memberName: 'flip',
description: 'Flips a coin, landing on Heads or Tails!'
});
}
async run(message, args)
{
var chance = Math.floor(Mathf.random() * 2);
if(chance == 0)
{
message.reply("Your coin landed on Heads!!!");
}
else
{
message.reply("Your coin landed on Tails!!!");
}
}
}
module.exports = CoinFlipCommand;```
Is there something wrong with my code?
The command isn't executing
the problem is you learned ur code style from a C tutorial
ofc
it is in dbl bakagain

haha
classic dbl 
syntax error
asking for help 
if/else statements 
Client.commands.register("8BALL", (args, message) => { let rand = [ "Yes", "No", "Why are you even trying?", "What do you think? NO", "Maybe", "Never", "Yep" ]; let result = rand[Math.floor(Math.random() * rand.length)]; message.reply(message, "Your anwser is: " + result); if (!args [0]) { message.reply.("Please ask a question to me. I am friendly."); return; } }); is giving me a error
Why do you check args after you run 8ball...
It should be before?
You should learn JavaScript first.
When do I check args?
And I am new to coding
then learn javascript before making a discord bot
then you won't have to ask these questions
Either way I will
Like, I am hard to teach so stfu
what
I can't really be taught anything
sad
well
theres a lot of online tutorials so
That probably won't teach me but ok.
or get a JS book
and read it
like
all of it
^
reading makes you smarter
but doesn't teach me shit
ya sure?
it does if read it
im not normal
cool
I can tell by your memey pfp
I don't understand memes.
me neither
var answer = document.getElementById("answer");
var button = document.getElementById("button");
var input = document.getElementById("input");
var options = [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes β definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
"Outlook good",
"Yes",
"Signs point to yes",
"Donβt count on it",
"My reply is no",
"My sources say no",
"Outlook not so good",
"Very doubtful",
"Reply hazy, try again",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again"
];
button.addEventListener("click", function(){
if (input.value.length < 1) {
alert("Please enter a question!");
} else {
eight.innerText = "";
var num = input.value.length % options.length;
answer.innerText = options[num];
}
});
is that right?
?
for 8ball
pleaee come back when u know how to code
sir
thats js code for html
?
i am not a sir
well
sorry
mis
lmao i can't be taught JS
time to test this 8ball
IM about to delete my discord acc
please do
js code for html
js code for html isn't even for anything
classic dbl 
if you're too stupid to read a book and learn from it, go pay for someone to make you a discord bot
π
coding seems to be the only thing
where people arent embarassed to ask
dumb ass fucking questions
nd then say thaay dont wanna learn
blows my mind
I can't learn
I try but I can't
wrong
I am no where near as normal as anyone else, I can't be taught.
that means your IQ is too low to do a high iq job
are you saying you have a learning disability @earnest phoenix
hopefully u dont
but
@earnest phoenix Ya
googling codeacademy and following step by step is not hard
i dont judge
but this guy got stuck on step 1
if i don't see a doctor notice it's just another depressed 16 year old
gave up
nd said hes not teachable
lmao
I ain't a he
she?
then thats a you problem you'll need to figure out by yourself

Yea
ok
That doesn't change anything

dbl makes me.happy sometimes
I just noticed how stupid I am
oh cool
I didn't have JavaScript on glitch
glitch..........
Yes... Glitch
glitch does have javascript tho
glitch only has javascript actually
I have to install it thru console
yeah it's not magic
well
you can't install a prebuilt language
being a dev means u have to do shit through the console
Ohhh
I know that Apap
LOL
-installs javascript throught nodejs tool
300 IQ
ARE U BLIND
why are trying to install a language through npm @earnest phoenix
then u dont need to download js
lmaoa
im dying
this isnt a coding problem
like when this person tries to start they car
ndd it dont start
they just give up?
But I can't start my bot because of 8ball I need a different language to use it.
i wanna die
they don like... google it or look for clues of the problem
@earnest phoenix no it doesn't
u can make an 8ball command
in JS
syntax error
you're using HTML js code
plain as day
for the 8ball com
not rocket science
thats an javascript error
If I remove the 8ball command
it works
yes
Magic
lmao
Hey guys! Today we go over the 8Ball command and how we can use the js Math functions to randomize a number and select a random string from an array in Disco...
how did u get through school
booted
Bc i did
Then he will just copy line after line and not learn anything
please send this person tp anidiots guide
console.log("booted")```
ez
inb4 remedial classes
Yup
they accommodate clueless stubborn people
That was easy ad
please
af&
af*
af?
as fuck
bye
I clicked the link lmfao
yes
so
go there
good
they help u
watch
not us
watch all of it
please
They better
your saying you were in remedial classes @earnest phoenix
ok
they more willing to work with...
I wasn't talking to you @earnest phoenix
people w no clue
lol
hmm
My lord, this gonna hurt me head
my*
hi devverinos
hey nik
Ima just steal this command xD
Sike
nvm guys that site is not for him

oof
I am not a him lmfao
hmmmmmm should i try and move to the new server infrastrucutre
hmmmmmm
I might just start coding from scratch
wedc
Ima go make a new bot and start from scratch
ok
gl
I'll need it
learn js while your doing it k thx
no
I'll read through all that js work
and learn nothing
you'll never get anything done then
learn what is a variable
then what is eachdata type
then ur done
z clap
`var answers = [
"Audible",
"Bolt d'\Oro",
"Bravazo",
"Combatant",
"Enticed",
"Firenze Fire",
"Flameaway",
"Free Drop Billy",
"Good Magic",
"Hofburg",
"Justify",
"Lone Sailor",
"Magnum Moon",
"Mendelssohn",
"My Boy Jack",
"Noble Indy",
"Promises Fulfilled",
"Instilled Regard",
"Solomini",
"Vino Rosso",
"No one on your tickets!"
];
document.getElementById('answerButton').onclick = function () {var x = document.getElementById("eight");
if (x.innerHTML === "8") {
x.innerHTML = "";
} else {
x.innerHTML = "";
}
var answer = answers[Math.floor(Math.random() * answers.length)];
document.getElementById('answerContainer').innerHTML = answer;
};` my attempt
THATS CODE FOR HTML
FUCK
JS HTML
someone mute
this is a bait
troll
not real
no it not
Mute me for nothing :/
@earnest phoenix do you know the difference between node.js and js fot html
nope
go ahead and learn
Why would you use HTML for a Discord bot anyways....?
I don't get that.
lmao
@earnest phoenix learn the difference before doing anything with a bot
omg
lmfaooo
@earnest phoenix Ok
GOOGLE IT
@earnest phoenix also e=why do you keep installing npm packages
like
smh
Make me
seriously
i wanna kms
helpless
I do to.
Is it a sin here to use the Discord Bot Maker?
Also, is there another way to host a bot remotely through a console other than node.js? I don't plan on switching yet, but if there's something better I'd consider it.
yes and yes
if you don't want to learn then you don't want to make a discord bot
any language u just run on a remote machine in the cloud
I do
and dont use dvm
no you don't
wait what
discord bot maker?
You think I don't, but I do.
@earnest phoenix if you did you would've went and learned how to
Shibotya is my first attempt at making a bot. I'm only using DBM for the code blocks, then fixing the scripts later after they're compiled.
huh
dont use dbm learn the code
dont edit it its not the same
I learn piece by piece, usually. I mean, most of DBM seems to be basically just if else statements everywhere, which is satan in itself.
yeah
I just haven't figured out switchcases
dbm is bit of a waste of money
Only if you try to run a bot out of it directly.
I mean, over the two days I spent making Shibotya, the bot went down with only a "There was an error" message on the screen, and that didn't even tell me how to fix it. That's why I switched to node.js and an admin cmd window.
I just don't know if there's a better way to host it locally.
I tried to make an alternative to fetchMessages.. so I don't spam the api.. but its not working out.. ```js
async function lastMessage(message) {
if(!message.hasOwnProperty('content')) return;
if(!message.hasOwnProperty('channel')) return;
if(!message.channel.hasOwnProperty('id')) return;
var channelid = message.channel.id
var MessageCache = message.client.table.fetch('MessageCache')
if(!MessageCache) MessageCache = {}
if(MessageCache[channelid]) {
var before = MessageCache[channelid]
MessageCache[channelid] = message
console.log(message.channel.name + " | " + before)
return before
} else {
message.channel.fetchMessages({limit:2}).then(msgs => {
var before = msgs.last()
MessageCache[channelid] = message
console.log(message.channel.name + " | " + before)
return before
})
}
console.log(MessageCache[channelid])
message.client.table.set('MessageCache', MessageCache)
}
Hey, if you could help me out here how do i make my bot not respond to other bots?
it wont work for me though
i tried
and the bot just crashes
@earnest phoenix
it couldn't define "msg" or "message"
that's cus you haven't defined message earlier in your code
yes i did
i didn't
exact words.
it could start running without that code.
see
lax!help
wow
automuter?
@earnest phoenix
No bot responds outside of testing and bot-help channels
And,
i forgot to check
you just need to use whatever variable you are ysing for the message instead of simply slapping that piece of in your file
bot.on("message", message => {
if(message.author.bot) return;```
That's how I have it shrug
Copyrights on public piece of code

i got in trouble for using something public without permission.
Well, Jonny didn't post it for shits and giggles
Or did he? 

Just use it, if anything I took it from someone else
But you didn't hear that from me
Watch DBL secretly become code stealing community
-ok-
lole
Anyone here who use d.js can help me with getting the duration of a video(ytdl-core)
in hours, min, sec
when u say duration do u mean played so far or total?
i mean like how long the video HAS played for or how long it WILL play for
well for the length of the video ull have to read the metadata(idek if ytdl shows metadata, i use youtube-node for metadata).
for counting how long it has played for u just start a times when it starts playing
well
i use ytdl-core
and in the longs it shows
duration so i did duration.minutes
but it returns as objects
returns this:[object] ?
did you try logging the object
ok
to see whats inside it
alright

gg > *
if I switch to aws
I wonder what my bill is
yeah not happening
non interrupted one is expensive
about 6x of my current price

galaxy gate i think
yes @west raptor
ok
better than gg
how to fix websockets errors?
@hot flax thats very vague, can you give more details? your code, the exact error, screenshot(s), etc
Ok
Error: Received unexpected end-of-file from SFTP server i get this error when i try to connect to a vps anyone know why?
lmao i cant find the error any more
ok my friend found out the problem nvm
how would I make a command called like
?invite bot id
And they do the command but they can add the bot id after it and when the bot returns it will go
User has invited
bot id
to the queue!
It will be reviewed shortly!
are you asking how to make the command
yes because Idk how
what exactly does it do
so
@fluid coyote you can't
(x) doubt
like you do
?invite botid
And it says User has invited the bot into the queue it will be reviewed soon and it says the bot id aswell
Why do you ask if you can?
no libs for lisp afaik
@native folio log the bot id
up to u
I like python
ts/js is a good one imo
@fluid coyote js is a good start
.ping
I prefer JS
uh
really
@loud salmon
@hushed berry selfbot thx
@fluid coyote don't ping people like that
@fluid coyote just leave
fuck
yes
Β―_(γ)_/Β―
yes
i was going to delete messages
yea
someone cant send messages that fast
they didn't have a typing indicator
no way
dammit why did you ban it without setting message deletion to "don't delete any"?
They could have sendkeys'd their messages in.
anyone screenshot it? 
no
like it matters anyway
sad
didnt have time
all those people got ghost pinged
Can I get the id of it real quick?
505855671980261384 is there id
I got pinged?
selfbot
@storm tulip some selfbot going around pinging people
hm
Is anyone else salty from that mass mentioning?
how would I make a command like this?
?invite botid
And it says User has invited the bot into the queue it will be reviewed soon and it says the bot id aswell
I don't know how to do that
use enmap
its a database
This is probably going to be a stupid question, but how would I set up a custom welcome message for when members join a server in JavaScript? Every time I've tried to find a way it ends up breaking and not sending.
the guildMemberAdd event
Okay but... I don't know what that is??
I've only been working with a bot for two days so far
events
Can I assume that you are using discord.js?
when x happens do y basically
I actually can't remember what I'm using, but it might be discord.js?
lol?
Okay
That's..very important that you know
lmao sorry im an idiot and forget what I'm supposed to be doing half of the time
didnt you say earlier that u use dbm?
Yeah, I do.
I've been using the input raw code function instead of the code blocks, though.
Hmm
Can't speak much about that
ask DBM support
never used a bot maker
Yeah, it runs on discord.js
I still have no idea what to do here though, because previous attempts have lead to error messages in the console.
I tried :')
hey does anyone have experience with the message.clearReactions() method? https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=clearReactions
I'm able to edit my bot's message fine with the message.edit() method, but when i call clearReactions, it throws an error
DiscordAPIError: Missing Permissions
because it doesn't have permissions
but what extra permissions are necessary to clear reactions?
my bot has all the text permissions
Raise the bot's role level to be higher than the user role of the reactions you're removing.
i mean as in the user who put the reactions there
^
If the bot role is below the member role, Discord assumes that the bot takes lower priority than the user.
It's sort of like how moderator roles are above members, but admins are above mods.
Pinged?
Are you able to host a bot with t mobile jazz?
const { RichEmbed } = require('discord.js');
const fs = require('fs');
let co = require('../../database/cookieOut.json');
let ci = require('../../database/cookieIn.json');
exports.run = async(client, message, args, color, prefix) => {
let cookieAns = require('../../assets/json/cookies.json');
let cookieAnsRandom = cookieAns[Math.floor(Math.random() * cookieAns.length)];
let user = message.mentions.users.first() || client.users.get(args[0]);
if(!user) return args.missing(message, 'You need to mention user to give a cookie', client.commands.get('cookie').help);
if(!co[message.author.id]) {
co[message.author.id] = {
cookie: 0
};
}
if(!ci[user.id]) {
ci[user.id] = {
cookie: 0
};
}
let curCo = co[message.author.id].cookie
let curCi = ci[user.id].cookie
let amount = parseInt(1);
let embed = new RichEmbed()
.setColor(color)
.setThumbnail(user.displayAvatarURL)
.setAuthor('Cookie πͺ!', message.author.displayAvatarURL)
.setDescription(`**${message.author.username} has given ${user.username} a cookie**!\n${cookieAnsRandom}`)
.setFooter(`π₯ ${curCo} | π€ ${curCi}`)
co[message.author.id] = curCo + amount
fs.writeFile('./src/database/cookieOut.json', JSON.stringify(co, null, 2), (err) => {
return message.channel.send(embed);
if(err) console.log(err);
});
ci[user.id] = curCi + amount
fs.writeFile('./src/database/cookieIn.json', JSON.stringify(ci, null, 2), (err) => {
if(err) console.log(err);
});
}
exports.conf = {
aliases: [],
cooldown: '0'
}
exports.help = {
name: 'cookie',
description: 'give someone a cookie',
usage: 'cookie <@user | ID>'
}
Help me please, i confused in total cookie ( curCo and curCi ) output is undefined
If you don't like JSON just shut up, Don't bully me :(
Please read the footer what i sayd
let amount = parseInt(1); ... why
why are you parsing 1
for add to json
you dont need to parse that int tho 
let amount = 1 @_@
parsing a number
Still same, the total cookie when i use the command 2 times they going give me output undefined
the first time i use its okay work
i just cant
pls use a database
Yeah
i'm waiting for my friend, they making a module to save data based on sqlite
they want to make sqlite more easy to use, friendly beginner π
but still on progress
π
well
ur wait
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-GDIJQW/aiohttp/ anyone know why i would get this error when im installing discord.py
well aiohttp but meh
oh it was a problem with pip version
was for 2.7 python
not 3.6
Traceback (most recent call last):
File "/home/samuraistacks/.local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "botta.py", line 60, in on_message
if not bot.is_ready() or msg.author.bot: return
File "/home/samuraistacks/.local/lib/python3.6/site-packages/discord/client.py", line 296, in __getattr__
raise AttributeError(msg.format(self.__class__, name))
AttributeError: '<class 'discord.ext.commands.bot.Bot'>' object has no attribute 'is_ready'
``` well shit
this was working before?
Sooo when the bot joins a server, it's supposed to send a message in #general (if there is one) but for some reason this code isn't working
@client.event
async def on_guild_join(guild):
general = find(lambda x: x.name == 'general', guild.text_channels)
if general and general.permissions_for(guild.me).send_message:
await general.send('message')```
i also have from discord.utils import find at the top
idk why this is happening and i dont understand why can i get some help?
Traceback (most recent call last):
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType```
invalid argument
how do i fix it
Command raised an exception: InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType
give it an argument that is the type it asks for
and if u dont know what that means
π 
@mild quarry , You can use this code : client.on('guildMemberAdd', member => { member.guild.channels.get('channelID').send("Welcome"); });
dont spoon feed π (unless its bad code idk node all that much)
i would allow that spoonfeed
since its completely broken
and will only lead to more problem down the road
lmao

-bot
how can i have a command say how many users are online in the server
by status
im having a command say how many is dnd, idle, online, streaming and offline
this work?
${message.guild.users.online.filter()}
Would be a big help if we knew the library
java
...script?
yes
java and javascript are 2 different languages
i know
discord.js?
yes
Look there
message.guild.users.online.filter() 
im dead
point is, i tried that
Point is, you should read some docs 
@mild quarry Hey
it's send_messages
Not send_message
@knotty steeple Reinstall d.py and try again
i tried this
${message.guild.users.online.filter()}
error:
(node:6544) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'online' of undefined
because guild doesn't have a property of users
also users.online isn't a thing, so it can't be mapped @earnest phoenix
guys anyone know how to fix this error TypeError: Cannot read property 'online' of undefined?
should i reinstall windows xp?
MS-DOS ftw
install windows me for good measure

@earnest phoenix delete system 32 first then try again
well i dont want to
my bot is rewrite
im literally doing python3 -m pip install -U discord.py
nvm got it
bot.on('message', message => {
let channel = bot.channels.get("503660117015658503")
if(message.author.bot) return;
let spam = bot.channels.get("505813580457967620")
if(spam.send) return;
channel.send(`[<#${message.channel.id}> [${message.channel.name}] | ${message.guild.name}] | <@${message.author.id}> [\`${message.author.tag}\`] | msg: ${message.content}`)
});
let spam = bot.channels.get("505813580457967620")
if(spam.send) return;
this not work
.send its the error
TypeError: Cannot read property 'send' of undefined
Cannot read property 'send' of undefined
so whatever you are trying to .send on is undefine
so the channel
doesnt
fucking
exist
pls
thats not even proper js
also why are you calling the channel spam?
like
if(spam.send) return <-- what is this even
checking for undefined to prevent property of undefined error 
checking a property of undefined, getting property of undefined error and asking why it doesnt work 
the competence of the average "developer" who makes discord bots

but
@topaz fjord 
my question is why is he trying to send a message for any message currently being sent in all the servers his bot is in
i mean
thats one of quickest way to get rate limited
Apart from rainbow roles
ur a breaky

commandfile.run(client, message, args, con, cmd, DBL, dbl, errors);
module.exports.run = async(bot, message, args, con, dbl, DBL) => {
@earnest phoenix does this give you cancer

and then I have a constructor which takes in the the client
double 
the the client
@quartz kindle shut
afaik yes
How can certification be obtained?
once it's open
okay
ok
ok i get my error again
every time i get this error 10 times
if i remove something in my code it will crash
ok
connection error
you fix with better internet
^
Bro can I talk to you
sure
@charred garnet
-bots @frail terrace
@charred garnet
-bots @loud salmon
@median gust 
@charred garnet
Aaaaaa
@earnest phoenix
- you have two spaces
- #commands / #265156322012561408 / #265156361791209475

@inner jewel I didnt got there because I thought that was not part of testing. Anyway can you help me with the bot?
Issue?
i already told you
there is no issue with luca
you have two spaces
@topaz fjord scroll up
-bots <name> vs
-bots <name>
^
when mentioning it adds another
well at least it does for me
it embeded for me
You never know what sound it could be
why would a mod try to do stuff for you 
Because I am a customer
wut
this aint mcdonalds
I am saying all of us are customers
Im not a customer ok
And customers are"always right"
thats bs
always right what
its a shitty saying
"customer is always right"
even tho you tell the person something that is wrong
I dont believe that shit for a second
See the service is dbl
I dont buy from dbl
smart turtle
They make money from us
how about going to #memes-and-media
what @earnest phoenix

because this isn't development related at all
they are making money from ads
@inner jewel is dbl a services?
ok natan
am cleaning keyboard rn
when my keyboard is clean
lmfao
@frail terrace there is that little hair on the left side of the w key
Make sure you get that
Please
huh
Is your keyboard clean?
ish
#memes-and-media might be better for this just saying
then i have to put screws back in and keycaps
Just
@native folio a cause , explanation, justification for an action or an event
so
reason = explanation?
Does anyone here have experience running java applications inside docker containers?
// Call Packages
const Discord = require('discord.js');
const economy = require('quick.db');
// Define client for Discord
const client = new Discord.Client();
// This will run when a message is recieved...
client.on('message', message => {
// Variables
let prefix = 'c.';
let msg = message.content.toUpperCase();
// Commands
// Ping - Let's create a quick command to make sure everything is working!
if (message.content.toUpperCase() === `${prefix}PING`) {
message.channel.send('Pong!');
}
// Balance & Money
if (msg === `${prefix}BALANCE` || msg === `${prefix}MONEY`) { // This will run if the message is either ~BALANCE or ~MONEY
// Additional Tip: If you want to make the values guild-unique, simply add + message.guild.id whenever you request.
economy.fetchBalance(message.author.id + message.guild.id).then((i) => { // economy.fetchBalance grabs the userID, finds it, and puts the data with it into i.
// Lets use an embed for This
const embed = new Discord.RichEmbed()
.setDescription(`**${message.guild.name} Bank**`)
.setColor(0xD4AF37) // You can set any HEX color if you put 0x before it.
.addField('Account Holder',message.author.username,true) // The TRUE makes the embed inline. Account Holder is the title, and message.author is the value
.addField('Account Balance',i.money,true)
// Now we need to send the message
message.channel.send({embed})
})
}
});
this is not working π€
yes i have client.login('token'); after
// Call Packages
const Discord = require('discord.js');
const economy = require('quick.db');
// Define client for Discord
const client = new Discord.Client();
// This will run when a message is recieved...
client.on('message', message => {
// Variables
let prefix = 'c.';
let msg = message.content.toUpperCase();
// Commands
// Ping - Let's create a quick command to make sure everything is working!
if (message.content.toUpperCase() === `${prefix}PING`) {
message.channel.send('Pong!');
}
// Balance & Money
if (msg === `${prefix}BALANCE` || msg === `${prefix}MONEY`) { // This will run if the message is either ~BALANCE or ~MONEY
// Additional Tip: If you want to make the values guild-unique, simply add + message.guild.id whenever you request.
economy.fetchBalance(message.author.id + message.guild.id).then((i) => { // economy.fetchBalance grabs the userID, finds it, and puts the data with it into i.
// Lets use an embed for This
const embed = new Discord.RichEmbed()
.setDescription(`**${message.guild.name} Bank**`)
.setColor(0xD4AF37) // You can set any HEX color if you put 0x before it.
.addField('Account Holder',message.author.username,true) // The TRUE makes the embed inline. Account Holder is the title, and message.author is the value
.addField('Account Balance',i.money,true)
// Now we need to send the message
message.channel.send({embed})
})
}
});``` because codeblock is in wrong language
also what exactly isnt working
let msg = message.content.toUpperCase();
if (message.content.toUpperCase() ===
y
and why uppercase
also it won't react because it'll automatically turn the c. in the message into C.
also copied code
that's not the issue
it is
the issue is that this code is obviously from a tutorial, but is actually awful
what kind of trash tutorial is this
thats my name
don't wear it out
π
also im 99% sure fetchBalance() is not a function in quick.db
did i hear "bad tutorials"? 
anidiotsguide
time to get york
Really quite confused,
let serverdat = JSON.parse(fs.readFileSync('C:/Users/ninja/Desktop/bot/priv/server_data/' + message.guild.id + '.json'))
if(serverdat['filter'][0]) {
let serverfilter = serverdat['filter']
stopcustom = false
serverfilter.forEach(word => {
let custsio = new RegExp(words, 'gi')
if(arg.match(custsio)) {
stopcustom = true
}
})
if(stopcustom) {
stopped('Custom Filter', arg)
return;
}
}```
keeps throwing an error saying things like cant read property 0 of undefined etc. But in all my server files they all have `"filter": []`
- why do you have a json file for each guild
sh
- json for database
It's very specific deployment
Dw
I moved from a mysql db to json
That's besides the point
I also tried to do for(i = 0; i < serverfilter.length; i++)
- i'm 37% sure its because theres nothing in the arrays
but it said cant find length of undefined
json db
sync io in nodejs
dbl 
so i need to have like '' in the array?
cuz in my other jsons with other things, there are just [], and it doesnt error
its undefined
i even tried doing eval with the code i had
it only errors when i actually PUT it in the code
also it might be because the json file doesn't exist
yeah thats what i was thinking
also why you move?
its still giving me the error
let serverdat = JSON.parse(fs.readFileSync('C:/Users/ninja/Desktop/bot/priv/server_data/' + message.guild.id + '.json'))
if(!serverdat) return;
if(serverdat['filter'][0]) {
let serverfilter = serverdat['filter']
stopcustom = false
serverfilter.forEach(word => {
let custsio = new RegExp(words, 'gi')
if(arg.match(custsio)) {
stopcustom = true
}
})
if(stopcustom) {
stopped('Custom Filter', arg)
return;
}
}```
arg.match undefined
canΒ΄t read property of if(serverdat['filter'][0]) 0
arg is defined
match is not a function
and error on sql system
what exactly is arg
anyways
const arg = RemoveAccents(message.content.replace(/[.]/g, '')).slice().trim().split(/ +/g)
and later down in the code i match arg and it works
i just realized i have to forEach arg
hummanauuuuh
but still doesnt explain why 0 is undefined
ok actually now it works
but now my console is still being spammed
I console.log'd the server id everytime its sent and it has no consistency on which server doesnt seem to have a file
ok nvrm turns out there is a consistency accross multiple servers
and a few of my server files dont have "filter": [] but i did this before:
bot.guilds.array().forEach(server => { let serverdata = JSON.parse(fs.readFileSync("B:/priv/server_data/" + server.id + ".json")); serverdata['filter'] = [];fs.writeFile('B:/priv/server_data/' + server.id + '.json', JSON.stringify(serverdata))})```
so why don't they all have it?
a lot of them do
but some dont
and either way i did
if(serverfilter['filter']) {
...
}```
so why does it still throw errors?
docs:
guildBanAdd
Emitted whenever a member is banned from a guild.
Parameter Type Description
guild Guild The guild that the ban occurred in
user User The user that was banned
client.on("guildBanAdd", user, guild => {
});```
whats it meant to be?
(user, guild) =>
user, guild will never work in js
user => will
but since you have 2 it needs to ne (user, guild) =>
client.on("guildBanAdd", (user, guild) => {
});```
thanks
how can i find a channel with a specific name in guild?
check the docs
para just search this guys name in #development and decide if u wanna keep responding
thats not how .find works @wide ruin
@earnest phoenix brb 1 min
you ask it really nicely
very helpful
:^)
I added a reaction using await ms.add_reaction(reaction). Now how would I get it as a discord.Reaction object in discord.py?
Ok thank you! π

@simple grove Collection.find(item => ...)
@earnest phoenixWhere should I write
sigh Show your code
whats the collection you're finding from
No collection
sigh



