#development
1 messages Β· Page 1008 of 1
Postgresql is just a database structure thing
mongoose wrapper if u want to make life easier
On heroku u can add a postgresql database to your app
Ok tmr I learn mongoose
my bot rn has mysql db xD
wdym? .-.
So it's online in that sense
i dont know is it worth of it to use mysql
But you could install it onto your own machine
google cloud
My aws π
my friend pays 
1 year free trial
For my raspberry pi I just use sqlite3

its soon over
also i dont think 2GB ram can hold my bot for long time more tho
@wild ore that's not a function
okey
why does avast say discord.guide is not trustable
what should I do
@slender thistle hey I have 1 questions is pepe emotes banned here
I dont know a discord.guide domain
NSFW, flashy, and other Discord ToS-breaking emotes are not allowed, the rest we don't care
That one my antivirus says isn't harmful but isn't trustable

512 is for 40 servers
oh God what
Depends on the library and amount of caching you do
hmm
if you go over 500 then i think its not
@pure saddle it will got till bot has 1 or 2k servers
also ^^^ (what woo said)
Maybe 1k
depends caching mostly
discord.js
Buy galaxygate
if you dont cache things, then it can prob hold even 2000+ guilds
^
(dont recommend tho)
A static bot that just responds scripted messages ram usage will always be really low
What is the prefix for the discord server list bot?
which is the best free bot hosting service that allows you to put custom clde because WHO CARES FOR BOTGHOST AND BOTBIND
@sterile vale why you need
My bots in 135 servers and uses 40mb ram
My bot has a rendering program, that uses 300mb just to launch it. And 500mb when its used.
Just for an assisting program
@earnest phoenix get a friend who pays ur vps

Cause im using the bot for my server
Python?
@hushed jungle yea

All the usages
even network one?
glitch is the fastest worst bot hosting service
@earnest phoenix how?
Btw i added an advertise command to my should probably put a cooldown on it but I DONT CARE
any good bot hosting service
Which libarary you use
Discord.js
Galaxtgate is good vps hosting
^^ or contabo, actually any
I've heard bad things about contabo
how to set up so it does something when a user votes your bot
that belongs in #topgg-api
no minimodding right
i dont evem know what is and isn't considered minimodding
minimodding is allowed i guess tho
why
i dont know
Its not allowed
and im not sure
also can someone tell mehow i can get a mentioned user from a message and turn it into his id? i use ids for economy system to prevent with hunting (what does that even mean)
Generally minimodding is acceptable if you mean reminding someone of the rules/warning
^ I think it's more about dont constantly do it
Generally minimodding is acceptable if you mean reminding someone of the rules/warning
@slender thistle so saying "that belongs in #topgg-api" isn't minimodding right
please dont kill me
Not really, if there's no moderator then it's acceptable
The latter
realizes there are two testing channels
Shivaco when will mod application over

Ok @_@
also we all should probably goto #general and purge our currenct messages wait shivaco i was about to say that
Mention.user.id
@solemn latch so will this work:
db.get(`userBalance_${message.mentions.user.id}.balance`
why cant i type colored syntax mobile
@earnest phoenix You know how I can get ram usage or not π¦
Message.mentions.first
I wanna get the id
Of the first mentioned user
If only i didn't make my bots code available to anyone then i can safely store usernames
.first gets the first mention
so
@hushed jungle I will tell tmr

@solemn latch message.mentions.users.id.first?
What is tmr
Message.mentions.first
Tommorow
@solemn latch message.mentions.users.id.first?
message.mentions.first returns normal users not their id
@slender thistle what heppen if I invited Luca bot to my server
nothing


Lol
hi
And putting first at the end doesnt make any sense
idk
Putting first on the collection does tho
Suuuuup
how to i get Bot Dev. Perm
just wanna figure out how to get the id of the first mentioned user
Wait
no

you told mr hwo to get normal user with tag not id
thx
No spoon feeding dice
You're so thick
wo
No spoon feeding dice
One off
I have him how to get the user, he knows how to get the ID from a user object
I-
He woulda figured it out
@slender thistle it will left automatically?
@earnest phoenix what would actually happen
it's a private bot, you can't invite it
it used to be public
i tried to invite luca once
@misty sigil I can invite
no you cant
You have to put his id in invite link
its private

you cant invite with that
@modern sable how to make private
https://luca.is-inside.me/bGKhr2od.png untick this on the bot page of your developer portal
ok
Oh
so, I have this function for findOne ping js async function dbping(guildID){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findOne({"g_id" : guildID}).then(date = Date.now) }and I have this for my findAll pingjs async function dbpingall(a){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findAll.then(allDate = Date.now) } The allDate var and date var return NaN and this is my init code for the date and allDatejs var date, allDate;

thatdidnothelpintheslightestlol
Can you add spaces
wdym
thatdidnothelpintheslightestlol
@misty sigil this text
ohnahsorryspacekeybro ke
Seriously you lieing
you missed the joke lol
How can you code then
How can i create a new role and add that role to my bot? The docs didn't help :/
you dont need a new role
the role gets made automatically
with the oauth perms
that you decide when making your link
its good for dc bot hosting?

Is creating new roles possible in code as well tho? (discord.js)
still, whats the company?
witherhosting
@hidden lynx yes
how?
guild.rolecreate

Or see https://discord.js.org/
It is createrole
Maybe
I forgot
roles.create lol
Omg
let role = message.guild.roles.find((role) => role.name === "lol");
if (!role) {
try {
role = await message.guild.createRole({
name: "lol",
color: "#fff",
permissions: [],
});
client.addRole(role);
} catch (error) {}
}
thats what i have so far
Try
Yup
and to create its guild.roles.create()

let role = message.guild.roles.cache.find((role) => role.name === "lol");
if (!role) {
try {
role = await message.guild.roles.create({
name: "lol",
color: "#fff",
permissions: [],
});
client.addRole(role);
} catch (error) {}
}
it says that guild is not defined
I hope i did that correctly with the cache
no, it says its really not defined
omg guys im fucking stupid
the code snippet i showed you was from a node module. the error came from the index file
thats the multiserver thingy??
I think you've asked this question like 5 times now
And gotten pretty decent answers
depends on a lot of things
a bot on 1000 servers can use 100mb ram or use 1gb ram
depending on language, library, code, optimizations, requirements, caching, etc
bad description declined
yeah that desc will probably get your bot denied
so, I have this function for findOne ping js async function dbping(guildID){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findOne({"g_id" : guildID}).then(date = Date.now) }and I have this for my findAll pingjs async function dbpingall(a){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findAll.then(allDate = Date.now) } The allDate var and date var return NaN and this is my init code for the date and allDatejs var date, allDate;
but it returns NaN
unless im doing something wrong

this is not the fix, but, findAll is a function, therefore needs (), so, findAll().then...
yea i did
ok
You can't do assignment like that in the .then method call.
ill just split line
is Manage_Messages needed for Editing non Cached Messages? (Editing them after the bot got Restarted)
You probably need the READ_MESSAGE_HISTORY perm instead
that
Does anyone have any suggestions on how to rate limit / throttle commands? I want to globally limit / lock up the bot and wait for a command to finish executing before letting new commands be entered. I looked at discord.js commando and I'm not crazy about it. Are there any other suggestions or best practices?
how much time does it takes for a server vps to activate?
no idea
thats a question for your host
i c
Do you want to rate limit the command per person/guild or in total?
for everyone in the entire server
Basically its a really wonky api call I wan't to let finish before anyone does anything else.
youd have to make a cooldown collection per guild
@plucky harness You might want to take a look at caprover for hosting, might save you some money.
Well in that case you could just have a Collection/Map/Array, where you save the guild id, and delete it with a timeout, then before executing that command check if the guildid is in there
how do i use a vps
you pay for one
buy it, then use it
and SSH into it

ye
lol
still working on mongo ping
limit is 100
how do i make it say the actual amount of messages that have been deleted
and not the amount i typed
pass in the args
wym
@client.command()
async def clear(ctx, amount=0):
await ctx.channel.purge(limit=amount)
await ctx.send(f'I Have Cleared **{amount}** Messages!', delete_after=5)```
I believe ctx.channel.purge returns a list of messages that were deleted.
So you could count how many messages were deleted.
So I'm having an issue that doesn't produce an error, I have a block of code thats running when I provide different arguments and I don't know whats wrong.
else if(!user.mentions){
const embed = new MessageEmbed()
.setTitle(":warning: Error in: User Mentions :warning:")
.setColor(0xFFD700)
.setDescription('Hey ' + `<@${message.author.id}>` + '! You need to mention someone for me to work! Not just provide arguments!')
.setFooter(copyright.copyright);
message.delete();
message.channel.send("Hey " + `<@${message.author.id}>` + '!', embed);
}
else if(user.bot){
const embed = new MessageEmbed()
.setTitle(':warning: Error in: User Mentions :warning:')
.setColor(0xFFD700)
.setDescription('Hey ' + `<@${message.author.id}>` + '! You shouldn\'t mention a bot! Not as much fun huh?')
.setFooter(copyright.copyright);
console.log(user.mentions)
message.delete();
message.channel.send('Hey ' + `<@${message.author.id}>` + '!', embed);
}
else{
const embed = new MessageEmbed()
.setTitle('The Tow!')
.setColor(0xFF0000)
.setDescription(`<@${message.author.id}>` + ' is towing ' + `<@${member.id}>` + '\'s car!')
.addField('The Car Is: ', `<@${member.id}>` + '\'s ' + vehicle)
.setFooter(copyright.copyright);
message.delete();
message.channel.send('Hey ' + `<@${message.author.id}>` + ', ' + `<@${member.id}>` + '!', embed);
};```
Blocks that don't work
Block two triggers when I mention a bot, and when I do the command correctly.
Two of my webhooks send [object Object]
its an object
i wonder if i could subdomain
anyways, this is my code for pinging, it still returns NaN js async function dbping(guildID){ t0 = Date.now await client.db.collection('prefixes').findOne({"g_id" : guildID}) t1 = Date.now - t0 t2 = Date.now await client.db.collection('prefixes').findAll t3 = Date.now - t2 }
my turn to ask a question, is this possible?
on index.js
if (command === 'reload')
client.commands.get('reload').execute(this.params);
on reload.js
module.exports = {
params = message, client, fs, Discord, config
async execute(params) {
//...
}```
passing params onto module.exports and executing them on index?
i think it would be
wouldn't you need to define the params directly like a function
oh god thats a function
Suuup
why you pinging inside the func?
wait no im dumb
actually, nvm, i can see why'd want it
if someone knows the awnser for my question, lemme know, i cant use my pc rn to try it
from Object.entries how would you get the value of a certain array inside the array
@misty sigil you can just do .find()
Object.entries returns a multidimensional array, like this: [[key1,value1],[key2,value2],[key3,value3]]
you should be able to use any array functions on it, such as .find .filter .reduce etc
K
figured, thank you, gotta tell the guy who asked me that that i was wrong
i may have told them you should be able to do it
also, do what?
module.exports = ({message,client,fs}) => {
// do stuff
}
and call it with myfunc(object)
if object contains those properties
Bsbsbsbsbsbsbs
@misty sigil you can just do .find()
@digital ibex still returns 0
whats the collection name?
prefixes
oh, u shouldn't make collections for every thing btw.. its just gonna take up a lot of storage and idk about ram, prob
if u do whatever.findOne({ g_id: message.channel.guild.id }); what does that return?
alright so
i need to get the guildcount before any shards are started
how would i do this
findOne works
am using DiscordGo but im assuming its the same in most libs or theres a web thing to get it
Why do i have this error?
can i still use raw event...
help
const client = new Discord.Client(TEST);
what do i put inn
what do i put after discord.client
Can someone help me to advertise my server on the website?
It needs client options
Although they're optional.
You can read about them on the docs.
i used discord.js
You're looking for this: https://discord.js.org/#/docs/main/stable/typedef/ClientOptions
Look at the example on the front page
Would you like to help me to pls?
You just go to the website and follow the instructions.
wait so i can put nothing in it?
don't post your token 
now the first thing you want to do is regenerate it
reset your token
anyone that works with ererla think they can help me? I get the ERRCONNREFUSED message
what isnt' working
before i change the token
@timber linden Maybe I can help
i tested it before i showed you it
waddup
just now
https://repl.it/@whatmepls/TraumaticMushyCalculator
@timber linden You forgot to create a client object
ik the problem
at the top
traumaticmushycalcuator
it says thats the "NAME"
of the bot
And the import of the depency should be before all
no
That's now how that works
the options are optional
oh
ok i added it back
but imma put in
Object
ok
heres the problem
"name": "TraumaticMushyCalculator",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^12.2.0"
const { Client } = require('discord.js');
const client = new Client();
client.on('ready', () => {
//CODE
});
client.on('message', message => {
//CODE
});
client.login(TOKEN);
i use js
That's js
make a new login
Nonono
well since you showed yours, yes you make a new one. but he said "TOKEN" because that's what you have to replace with your own token
Without showing it to us!
I think is better to first learn JS before you start using NPM dependecies
i only know some
ive learned for like 3 days and im trying to make a test bot
so i know how to make it online
lmao
mr gonna steal ya token
then why did you even bother with the red line
either block it out 100% or show me

process.env.DISCORD_TOKEN 
im alloweing everyone to edit it
but why
and also having a token in public is not what a token is supposed to do
making a discord bot but everyone can edit it
it's literally the exact opposite
if you give me the password to your real account i can help edit that too 
well have fun until the griefers arrive

this is you --> π€‘
lemme try some js
What's this
can you please stop spamming?
ok.
sometimes i wonder what im doing with life
You can use if-else statements, but I used switch for now
it says no
i think i forgot
the numbers
for the username
/home/runner/betterantispam-V-7683
client.on('ready', (how are you) => {
^^^
SyntaxError: Unexpected identifier
Where do you run it?
Where in the code
at the side
and remove "How are you"
at the side
@timber linden
it runs it in node.
by at the side
i mean thats where node is
but at the top yoou press run to run it in node
Please follow a tutorial online
Love the video or need more help...or maybe both?
π¬Join us on Discord: http://discord.gg/invite/fw5cKM3
This series is outdated!! We have a new series playlist here!
https://www.youtube.com/playlist?list=PLdnyVeMcpY7_IiC977keSLBXXJG_I3vUo
Thank y...
Follow {TheSourceCode}'s tutorial
Iβm finally almost done π
I'd use cron for longer periods
why?
so when someone writes .spawn it spawns a pokemon
but when they write .catch it catches the most recent pokemon spawned on the whole bot but i want it so it only catches the pokemon in the channel it was spawned in
probably something to do with this
you want to store that data
Let's see
just use join
You can use args.join(" ") instead of a for-loop
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
var args = message.content.slice(prefix.length).split(/ +/);
var command = args.shift().toLowerCase();
if(command=="ping"){
message.channel.send("You pinged Azul, now Azul pongs you!")
} else if(command=="say"){
message.channel.send(`${message.author.username}#${message.author.discriminator} said: ${args.join(" ")}, Arguments passed: ${args}`)
}
})
args has the command in it tho
nvm (.shift())
@earnest phoenix btw the issue with your code (doing it you way) was using for in rather than for of.
for in was looping over the keys (0 and 1)
${message.author.username}#${message.author.discriminator} -> ${message.author.tag} (No ping) or ${message.author.toString()} (Ping)
@earnest phoenix
Where can I contact someone about not being able to connect to api as cloudflare is blocking it?
It thinks your bots sus
Thatβs just it I recommend waiting and trying again later
Where can I contact someone about not being able to connect to api as cloudflare is blocking it?
@earnest phoenix #topgg-api
@ebon kelp I ask in there and I dont get a response about it
I know it's working as I put the token on my tester bot hours ago to make sure it was posting stats then changed it back and put it on my main bot
I have a error here, i can resolve,
so, I'm trying to make a command that would be more or less "+ list (role)" and the bot would make a list of all the members that had the role mentioned and send it on the channel!
I tried with the for cycle but it also gives an error! I do not know what else to do.
Filter the guild#members collection, removing any member that has not got the role. Then work with what's left, such as using the map method or size property depending on what you want to do
That's not how you use for(), you need to pass arguments inside those parentheses
That's not how you use
for(), you need to pass arguments inside those parentheses
@signal vortex yeah i know ahaha
I had erased because it gave an error and I ended up taking the print with nothing inside
It's gonna give an error when you remove all arguments too
But you don't need to run a for loop
You can tho
It's one way
If you're to do so, iterate through the collection and check if each individual GuildMember has the role
Whats your code
CODE
thats my code
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
@signal vortex how can i fix that
Was a retry-after header given?
you've most likely been temporarily banned, just wait for like an hour or something
Not banned, ratelimited
hm, im having a small issue.. if anyone knows.. js app.get('/chat', async (req, res) => { res.render('chat'); }); why am i going to mywebsite.com/chat and uh
its saying in the console i went to the 404 page.. it doesn't redirect me to it just says i went to the 404 page for some reason
the full code:
app.js -> https://github.com/OfficiallyLost/site/blob/master/src/app.js
chat.ejs -> https://github.com/OfficiallyLost/site/blob/master/src/views/chat.ejs
describe what you're trying to do
Use margin-left: 5px; or change it to -5px and increase those values to see which one sticks
ok
the text doesnt move
@prime cliff
Ok
i did it
thank you guys
Whats wrong in the code?
'-'
It is not to be like this : /
Dang that's nice
Was wondering if anyone knows how to use youtubes data api to pull subscriber counts via nodejs? please contact me as ive been trying to figure this thing out for 2 weeks. Cant find anything on StackOverflow, Thanks in advance.
youtubes api is pretty straightforward
channel.statistics.subscriberCount
@sudden chasm
actually, the very first result on google has a library for getting channel data
Move your files over, install dependencies, run your code
How to make a command vote only feature
Thats in the docs
this should send " π² | rolled a (number)
but it sends
π² | rolled a **(number)
it just cancels the last two **
how can i fix this
You should look into using ``
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
It makes reading strings so much easier
Your issue is your closing parenthesis early
fixed it thanks
I would look into template literals. It really makes things easier
just ask
Well
I need a website for top.gg
and
Idk HTML
lol
I have my developers do it.
but
they are working on my bots, they also dont know HTML
So
I need help
Making a website in Top.gg.
So
if you know HTML DM me
Can somone help me get my bot online but Iβm on mobile
Can somone help me get my bot to be online
What
nothing


2020-07-01T04:02:29.125128+00:00 app[worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:475:25)
2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
2020-07-01T04:02:29.125129+00:00 app[worker.1]: at startup (internal/bootstrap/node.js:201:19)
2020-07-01T04:02:29.125130+00:00 app[worker.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
2020-07-01T04:02:29.181494+00:00 heroku[worker.1]: Process exited with status 1
2020-07-01T04:02:29.223278+00:00 heroku[worker.1]: State changed from up to crashed```
any buddy help plz

For some reason, I have a hard time with heroku errors

looks like it cant find a file
which
read the error

it litteraly say what file is missing in the first line
even the path where the file is expected
.env
how tf did you think its a .env file when it expects a .js?
find out how to read the error and fix it

we are not here for debugging your code. And the ability to debug your own code is mandatory
i gave you some pointers the rest is by you
you have somewhere a file that requires("app/index.js") find it and fix it
Are your commits all named like that?
Maybe I just take naming commits too seriously 
It helps to make your commits describe the changes, not the name of the file updated(that's already part of it).
yeah so im a bit new and im using a pebblehost node to host my bot, I was wondering how to store the channel.statistics.subscriberCount
pulled from YouTube's API? damn i know so little
check package.json @earnest phoenix , sometimes that contains what your main / index file is
use a database
if there a way to store it in a local directory?
there are different types, from sqlite over sql to no-sql
or make it log into FTP?
you could use a json db but they are unreliable and corrupt easy
fs
ok thanks
@sudden chasm { "name": "HAPPY", "version": "0.0.1a", "description": "Moderation bot", "main": "mainbot.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node index.js" },
u using heroku?
if you dont want to have external stuff i suggest having a SQlite DB would be the best solution for you RN. but the downside is if you want to have many users /servers it can cause issutes
its just going to be in 1 server
then SQLite is fine
ty
if you use node.js look into Enmap or quick.db
will do
enmap works like Discord Collections but with persistant data
@sudden chasm mainbot.js edit??
what is ur problem
@earnest phoenix cmon do ur own work, you'll learn more by not making us write all your code for you
in fact you'll learn so much you can do it independently next time as well
@restive pebble 2020-07-01T04:02:29.125127+00:00 app[worker.1]: Error: Cannot find module '/app/package.js' 2020-07-01T04:02:29.125128+00:00 app[worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:475:25) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:695:10) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at startup (internal/bootstrap/node.js:201:19) 2020-07-01T04:02:29.125130+00:00 app[worker.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) 2020-07-01T04:02:29.181494+00:00 heroku[worker.1]: Process exited with status 1 2020-07-01T04:02:29.223278+00:00 heroku[worker.1]: State changed from up to crashed

damn boeing going hard
@restive pebble tik tok is app
ban in india
ik
yes we know
it got banned in india the other day
chienes app
omg
chaines corona

π
that insults me so much im literally chinese
global server
f u
corona
racist
solution
idk
lol
u modified discord.js?
temoporary solution is that make a package.js
file
empty
Your requiring js
this same project glitch.com work but heroku 

"discord.js": "^11.5.0",
i am right??
version is 11.5.0

by now im just wondering if i can make my bot use FTP to store files instead 
this is going to fill up that 1g hard drive so fast but lets try it
i found it
Your trying to store just sub counts? With ftp?
^
Ftp is more of a file transfer thing.
Its probably the worst way to do what you want
use fs
Try that bot
What
Your asking me?
sure
Itβs a discord bot that is a utililty
why did you send the invite
Am I allowed to?
yikes
no not really without context
Vps is asking me for a host name what type of name should i give?
If Iβm not I will taken it down p
Okay

and?
nothing
cool man
video is end say
Vps is asking me for a host name what type of name should i give?



you okay mate
link pls
ur choice
just anything will do
So will host.dbdv.com do?
yes
Ty
Does anyone know how to do a moderation script for a bot
module.exports = {
name: 'kick',
description: "this is a kick command. only people with kck permissions can use this",
execute(message, args){
if (msg.member.hasPermission("KICK_MEMBERS") {
if (msg.members.mentions.first()) {
try {
msg.members.mentions.first().kick();
} catch {
msg.reply("I do not have permissions to kick " + msg.members.mentions.first());
}else {
msg.reply("You do not have permissions to kick " + msg.members.mentions.first());
}
}
}
it says theres an error in the else statement.
how to fix this?
didnt work
what is the error exactly
fixed the top and bottom problem. the code is now like this
const newLocal = module.exports = {
name: 'kick',
description: "this is a kick command. only people with kick permissions can use this",
execute() {
if (msg.member.hasPermission("KICK_MEMBERS")) {
if (msg.members.mentions.first()) {
try {
msg.members.mentions.first().kick();
}
catch {
msg.reply(`I do not have permissions to kick ${msg.members.mentions.first()}`);
}
}
else {
msg.reply(`You do not have permissions to kick ${msg.members.mentions.first()}`);
}
}
}
};
nice
is it all good now?
why }; at last tho
it says } expected
@hazy sparrow is the code running or giving errors
good
message
msg is not defined
U ok?
dude
const Discord = require("discord.js");
const client = new Discord.Client();
const fs = require('fs');
const prefix = ("bow");
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync(`./Commands/`)
for(const file of commandFiles){
const command = require(`./commands/${file}`);
const name = file.split('.')[0];
client.commands.set(name, command);
}
client.on("ready", () => {
console.log("bow bot is online!!");
});
client.on("message", (message) => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
if (message.content.startsWith(`${prefix} ping`)) {
client.commands.get('ping').execute(message);
} else
if (message.content.startsWith(prefix + " foo")) {
client.commands.get('foo').execute(message);
} else
if(message.content.startsWith(`${prefix} roll`)) {
client.commands.get('roll').execute(message);
} else
if (message.content.startsWith(`${prefix} invite`)) {
client.commands.get('invite').execute(message);
} else
if (message.content.startsWith(`${prefix} help`)) {
client.commands.get('help').execute(message);
} else
if (message.content.startsWith(`${prefix} user-info`)) {
client.commands.get('userinfo').execute(message);
} else
if (message.content.startsWith(`${prefix} server-info`)) {
client.commands.get('serverinfo').execute(message);
}
})
client.login()
it says client is not defined
Could someone help me with packaging a electron project? When i export and run the setup stops at around 30% and if i run the file generated by the command used to run it will load index.js but not index.html
it says client is not defined
@hazy sparrow than set client
const swearWords = ['N word here']
if(swearWords.some(word => msg.content.includes(word)) ) {
let personlol = msg.author()
msg.delete()
msg.channel.send(`${personlol} just said N word`);} ```
what is wrong here\
what error are you getting?
the message has been deleted
no
if i use $person
it doesnt not do anytging
if i jjst write OMG U SAID N WORD
then it works
fm
is the message deleted though?
depends
in the code above
it doesn not
but if i remove $person
thn it does
so?
so the issue is that the message doesn't send?
yes
you should delete the message after you send the message
yeah, i am pretty sure you can just provide the user object to @mention someone
awesome










