#development
1 messages ยท Page 545 of 1
many vps solutions limit them
When RegExp screws up commenting https://upldr.party/H77ZqCn6.png
lmao
@jagged plume, I have checked the id of the channel, there's no problem with it
but still not working
idk, i don't use discord.js
the problem is that ok is undefined, meaning that it cant get the channel
are you sharding?
i really don't know, someone who knows more about discord.js might be able to tell you why it's doing that but i cant
ยฏ_(ใ)_/ยฏ
maybe do
client.guilds.get("dwde").channels.get("dwedfa")
i dont really use discord.js
whats the problem
read #topgg-api
lol
i mean
I'm tired, I have no clue how to fix it
dbl.webhook.on('vote', vote => {
let ok = client.channels.get("527308073296199700")
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
ok.send(votea)
});```
Error: ok.send(votea)
^
TypeError: Cannot read property 'send' of undefined
the channel 527308073296199700 doesnt exist
thats what i said 
people already told you in #topgg-api
no, I have checked the id already
and i have tried another channel
still not working
"still not working" isnt gonna get you help
I know, I'm here to request for help.
console.log channels to see if the channels object exists and is populated
if it is, then the id is wrong. if its not populated then something else is wrong~
if it is populated but still doesnt contain the desired id, is the bot sharded? maybe the id is in another shard
I don't know what's shard, but the log send no shards
is this how you would make it so if you dont mention someone it would be the author
let user = message.mentions[0] || message.author;
eris^
cuz it doesnt work
is there another way?
This should go up a folder right?
mine?
yes
Check for the mention first then if user is still nothing ser it to the author
you dont know eris
I know enough to know that if you get rid of the || message.author and seperate it
Well I don't know what to tell you. I tested it and it worked
you know that eris and discord.js are completely different
In d.js it'd be like this
if(!user) user = message.author```
const Eris = require('eris')
exports.run = async (client, message, args) => {
let user = message.mentions[0] || message.author;
let embed = {
color: Math.floor(Math.random() * 0xFFFFFF),
title: user.username,
image: {
url: user.dynamicAvatarURL("gif", 1024)
}
}
message.channel.createMessage({ embed });
}
exports.conf = {
aliases: []
};
exports.help = {
name: 'avatar',
description: 'Avatar of user',
usage: 'avatar'
}
i have this
Eris is still javascript...
yes i know that
but
you are still thinking that discord.js and same as eris
its not
if(!user) user = message.author
|| is a shorthand
I know
but clearly its not working
If it skips to the message.author
have you tried logging message.mentions[0] to see if it ever picks it up?
1 sec
its logs for myself, so i dont @ anyone , and it logs it as extendeduser
but when i @ someone
it logs it as user
its different
Well thats where knowledge of eris would help me, I cant help from that because I dont know what the differences of extendeduser and user are sorry
You only get an instance of ExtendedUser, as far as I know, if it's the bot
i only get ExtendedUser when i dont @ anyone example: =>avatar.
but when i @ someone example =>avatar @ someone, it logs User instead of extendeduser
i sent the code just scroll up to see
Well user should still be something so why does it go to message.author ๐ค
yes but when its message.user.mentions[0]
it will return as cannot read property's of mentions
nvm
when i do =>avatar
it returns as undefined
hmm
Alright anyone able to help me go up directories in fs?
Doesnt seem to be working
its in mobilefriendly/commands
Just require it
What is the error?
I've written to files and stuff before so Idk why it isnt working
This works just fine
thats in a different directory.
.rainbow
Now Im having a new problem, its not writing...
This same code is what I use for setting prefixes and it works
No errors in the console
It sends the message
Just doesnt write
This is my prefix command if that helps
@wanton shuttle your Prob solved?
not yet
Its practically the same code with different variables.
No it is the same code with different variables
@amber fractal Keep consistency through out code
dont use let and var
use one or the other
Makes neater code.
@wanton shuttle
try
let ok = vote.guild channels.get('id')
then just create all them at top
Dont want them global
Ok...
Either way thats not the problem Im having ;-;
@earnest phoenix
let ok = vote.guild channels.get('id')
"guild channels"? no dot between them?
ni a . between sry
ok ๐
The two pictures I sent are identical code, one is for setting the prefix, which works. The other is for blacklisting a user, which doesnt work, no errors.
blacklisting
It just doesnt write because when I log the file its still blank
adapt?
?
People that abuse commands
I have no idea but my forever process on my ubuntu aws machine keeps turning itself off and I don't know why.
No error given. Is this an issue or am I doing something wrong?
I tried
instead
None worked, but I just dont know why its not writing
Theres nothing in it and your trying to write to something that doesn't exist?
No, the file exists
Its creating it
agh
Its the same way the prefixes work
whats prefixes
@earnest phoenix
now it returns this error
TypeError: Cannot read property 'channels' of undefined```
Forget about what I just said I was being an idiot and was running 2 processes of my bot at the same time without sharding so it turned off.
OHHHHH THIS FEELS LIKE DEJA VU
I was having that exact issue a few hours ago
Because I was doing too many steps and was defining my variables in weird ways
And why use sync
If I sent the whole code, you'd see prefixes is defined
Prefixes command works
...
defined as what?
prefixes = JSON.parse(fs.readFileSync("./prefixes/prefixes.json", "utf8"))
ooft
prefixes is defined globally
which is why there is no var there
Prefixes works tho its the blackist Im having trouble with
ok
I said that 3 times now 
i understand that
Its weird
it logs blacklist.json as { '465203654685622282': 'test', '408736647480475648': 'test' }
Whoops
ok
@wanton shuttle semicolon behind let ok = ...('id');
But when I go to the file nothing
So logging blacklist.json shows it, the file is empty when I go there tho
does "prefixes work" not mean anything or something?
Its literally the same code with different variables
Neither do I 
Ill just keep trying stuff
@earnest phoenix like this?
dbl.webhook.on('vote', vote => {
let ok = vote.guild.channels.get("523437698699231232");
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
ok.send(votea)
});```
Yeah the code is correct.
your complaing about not seeing whats in Json file...
fs.writeFile("location.json", JSON.stringify(data), (err) => console.log(err));
@sick cloud i still need help on the help menu embed thing
well, i can't help you past the fact theres no errors
well can i do a confirmation?
if (reaction.emoji.name === 'โฌ
') {
await removeReaction(m, message, 'โฌ
');
if (page != min) {
page = page - 1;
await m.edit({
embed: pages[page]
});
}
awaitReactions(message, m, options, filter);``` the embed doesnt edit when I react โฌ
now
but edits when I react โก
plus there was no errors so I assume something went wrong
So its a problem with the editing them
hmm ok
put var { min, max, page, limit } = options outside of the awaitReactions
it resets to 1 every time
I had the same issue
oh lel
Should be working after that
oh hey it works ๐
Know that it wont auto delete reactions on servers it doesnt have perms to, obviously
It will work if they unreact and rereact tho
And you can also go all out on the pages
anything inside the page object that works in an embed is good
ok
Um not sure on the max
The way I do it is weird so it definitely wont apply to you
oh rip
I dont have a module.exports.help thing in my commands
Can I store a hyperlink as a string and use it later in an embed?
var link = "[link](url)"
idk if it will work but it might
I dont see why it wouldn
t
Yeah just wanted to know if it would work
Thanks
I want to store them in an array
test it then
Code: ๐
const pages = {
1: {
footer: 'Page 1'
}
}
Error: ๐
embed.footer: Only dictionaries may be used in a ModelType
at item.request.gen.end (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
at then (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
name: 'DiscordAPIError',
message: 'Invalid Form Body\nembed.footer: Only dictionaries may be used in a ModelType',
path: '/api/v7/channels/446833822118445069/messages/529155640774623232',
code: 50035,
method: 'PATCH' }``` i wonder if im not allow to use footer
best way to decancer a name?
?
Footer is an object
so what do I need to set a footer lmao
footer: { text: "Example" }
Do you have an array of commands?
in half
for 2 pages
also no
i did
description: `${client.commands.map(c => `${prefix}${c.help.name}${' '.repeat(longest - c.help.name.length)}`).join('\n')}`
prefix is defined, and so has longest
The easiest way I can think to do it is pretty is a ugly way to do it
wut
client.commands is already an array isnt it?
I think its a collection
dbl.webhook.on('vote', vote => {
let ok = client.channels.get("527308073296199700")
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
ok.send(votea)
});```
Error: ok.send(votea)
^
TypeError: Cannot read property 'send' of undefined
can anyone help?
lmao xD
@wanton shuttle the channel maybe inaccessible xD
or the bot cant send embed there
do this ```
client.commands.forEach(c=>{
what you want to do with every command.
})
@visual zenith
if you want half of an array, why don't you refer to the array's length and then splice??
already got it
no
its client.commands.keys()
map is easier
lmao
He wants to split it in half
ok
then chunk an array
you could just split whatever .map returns lmao
or, you could chunk an array
My bot has the Administrator perm, so it can access to every channels
client.commands.key() returns a long list of commands in an object
the array needs to exist to chunk it
which is where the mapping would come in it returns an array... I think ๐
Or it's not allowed to put it in index.js?
whats not allowed to what?
Scroll up to see my question
ok
oh
so the channel must extend a TextBasedChannel in other words it must be a channel thats apart of a guild, group dm, or dm
or read the docs
Yes, it's a channel
it needs to be a text channel tho
Yes
Just like this development channel?
hmm, this is a text channel
code: ๐
client.users.get(vote.user).send('test')
error: ๐
TypeError: Cannot read property 'send' of undefined
at DBLWebhook.dbl.webhook.on.vote (/app/shard.js:38:36)
at emitOne (events.js:116:13)
at DBLWebhook.emit (events.js:211:7)
at IncomingMessage.req.on (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:83:16)
at emitNone (events.js:106:13)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
still failed xD
yup
oof
so how can I still grab them and send a dm message?
sharding just splits your bot into multiple websocket connections depending on the lib
v11.4.2
did you try it with client.users?
because you edited the message, but I dont think you edited your code
I haven't try yet hold on
I'm eating something rn
So I have to create a new channel and don't type anything at the channel?
I never said that
it technically has a type
i already tried that
but, the thing about normal channels is that you cant send messages to them instantly
iirc your client needs to be ready
you should get a guild channel
well, what exactly are you trying to do?
I'm using index.js, and write that code down, so if a person votes, it will send a message to that channel
you mean to the user?
this is what a channel would repersent https://images.remixbot.ml/XcN65a4M.png
no just send (`user.tag voted the server!`) to the channel
ok
you must need a text channel then https://discord.js.org/#/docs/main/stable/class/TextChannel
no its
(`${vote.user.tag} voted the server!`)```
I already have a channel?
me?
FallenTaco, I was just typing an example
lemme see
user undefined
check if the user actually exists
here is some code
const user = client.users.has(vote.user) ? client.users.get(vote.user) : await client.users.fetch(vote.user)```
its ternary
process.env.token you on heroku?
all that code does is check if the user exists, if it does, it will grab the user from the map, if no user exists it will fetch the user from the discord api.
(node:5603) UnhandledPromiseRejectionWarning: TypeError: client.users.fetch is not a function @blazing star
oh your using stable
xD
use client.fetchUser instead
of course
sorry im back
code
error: ๐
const user = client.users.has(vote.user) ? client.users.get(vote.user) : await client.fetchUser(vote.user)
(node:5729) UnhandledPromiseRejectionWarning: Error: Request to use token, but token was unavailable to the client.
at APIRequest.getAuth (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/APIRequest.js:33:11)
at APIRequest.gen (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/APIRequest.js:39:54)
at resolve (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:59:20)
at new Promise (<anonymous>)
at SequentialRequestHandler.execute (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:58:12)
at SequentialRequestHandler.handle (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:119:10)
at SequentialRequestHandler.push (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:48:10)
at Promise (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RESTManager.js:27:15)
at new Promise (<anonymous>)
such a big error
where did you put the code?
Hi.
so if a person votes the bot but not in the server, will that still works tho?
what?
I need an example upvoting command. :<
client.users.has(vote.user)
that will check if the user is in the client users
Ok,so I have created a text channel and I have copied the channel id
dbl.webhook.on('vote', vote => {
let ok = client.channels.get("5529165495753113600")
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
ok.send(votea)```
so that's my code, i think it's correct now?
ok
so heres come the problem
^
TypeError: Cannot read property 'send' of undefined```
๐
let guild = client.guilds.get("the guild id");
message.guild.channels.get('CHANNEL ID')
this?
just remove the message part and ur good
oh
let me try ๐
guild.channels.get('CHANNEL ID').send(votea)
^ can i just do that instead?
@blazing star i put it where the shard is being spawned
since i dont want it to repeat several times
^
TypeError: Cannot read property 'channels' of undefined```now returns this so hardd
?
Whats this supposed to be doing?
sending messaged to a specific channel
guild isnt defiend
defined*
where is this code at
what even
event*
I can spell 
xD
no clue now ://
(node:155) UnhandledPromiseRejectionWarning: Error: Something took too long to do.
Go here https://hastebin.com/ and paste your code, edit out all sensitive data like tokens and such.
dont send the link unless all sensitive data is removed
ye^^^^^
the whole thing?
Was that like upvoting and rewarding the upvoter?
He's sending (user) just voted for the bot whenever someone votes
Oh. I see.
run a console.log(guild)? ok
yes
console doesn't log it
what does your console say?
dbl.webhook.on('vote', vote => {
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
let guild = client.guilds.get("520445191732068353");
console.log(guild);
guild.channels.get('5529165495753113600').send(votea)
});```
Pickaxe Bot is online on 51 severs!
{ server_count: 51, shards: [] }```
wait
didn't return that error,cuz i have to test webhook and it will send that error
Any way to simulate that?
yes, Fallen
oh i had the same problem
u saw dat port: 3000 so u might know xD
its
https://${projectname}.glitch.me/dblwebhook
in the url section
i mean
https://projectname.glitch.me/dblwebhook
that dbl bot settings?
yes
Alr you can take over
sure
wait
Run the webhook without voting
Idk how webhooks work I just how how d.js does lol
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
server.listen(3000);
const dbl = new DBL(process.env.DBL_TOKEN, {
webhookServer: server,
webhookAuth: process.env.password
}, client);
just do ^^^
you'll figure it out once it works
;0
what's webhookServer?
An existing server to run the webhook on. Will activate webhook when set.
legit in the docs
make sure your webhookAuth is the same as Authorization
@wanton shuttle
make sure your webhookAuth (the code) is the same as Authorization (the website)
done
did it work?
undefined
/app/server.js:30
guild.channels.get('5529165495753113600').send(votea)
^
TypeError: Cannot read property 'channels' of undefined```
xD
now it logs undefined
steven told me to add console.log(guild)
to see if its defined or not?
maybe
is it even defined?
also what handler is it put in?
message?
do you usually do message.channel.send?
recommend doing client.channels.get
thats what i do
let guild = client.guilds.get("520445191732068353");
change guilds to channels
and get a channelID
wait you dont need to have the guild to get the channels
xD
.channels is already a property
Mapped by their id
client.channels.get(channelid).send(send something)
let guild = client.guilds.get("520445191732068353");
guild.channels.get('5529165495753113600').send(votea)
``` ๐
its client.channels.get(channelID).send('whatever you want lmao')
u dont need guild
idk why I didnt see that before
you canโt do that
?
you canโt just send to a plain channel
iโm pretty sure you need to get a channel from a guild
ok
so what should i do now
?
did you try it yet?
also @blazing star i still cant get it to work
rip sharding
get channels.get?
?
i tried it before
yes, i tried it before
if you dont know how to get it^
Iโm pretty sure itโs a list of channels that the client has access too
yes 
ok
dbl.webhook.on('vote', vote => {
let ok = client.channels.get("527308073296199700")
let votea = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`${vote.user} just voted the bot! ๐ข`)
ok.send(votea)
});```
and does the bot have access to it?
like this development channel
and can chat?
Im going to say this once
yes my bot has adminstar perm
ok
no u dont lmao
and everyone can access/type at that channel
yes the error is
?
Error: ok.send(votea)
^
TypeError: Cannot read property 'send' of undefined
xD
i rly want to die
wait
spent 2 hours on dis xDDD
even harder than doing commnads
You dont need a guild
just do client.channels.get('527308073296199700').send(votea)
and u dont need a guild at all
client.channels.get(id).send(stuff)
what I did 
Ye
legit it shouldnt break
Wait who said you needed a guild, multiple bad on u
It was var const = let
didnt rlly need the ping
lmao wot
i blocked off the part where it should ping him
ye ik
it should work now lmao
client.channels.get('527308073296199700') is a collection, that id should only have once
bruh
i dont think other channels can have the same id
did you use the code i gave u?
They cant
its not api abuse trust me
Got me eyes on you m8
@wanton shuttle so did it work?
when u tried to shard and send a dm message to a user but it failed ๐ญ
?
again?
client.channels.get('529165495753113600').send(votea)
^
TypeError: Cannot read property 'send' of undefined```
You can emote in that?
u wut?
fine omg i'm so done
wait
is the id right? lmao
yes
make sure the id is valid
try doing <#id>
if it shows the channel name then ur good
xD
console.log(client.channels.get(id))
<[#development](/guild/264445053596991498/channel/272764566411149314/)>
yes finally
\#channelname will returns the channel id right?
and i copied that and pasta
pasta
xD
did it work for u?
get rid of let guild = client.guilds.get("520445191732068353");
pls
its not needed
are you sure the bot can chat in the channel???
because it looks here that the bot can not send the message
do you have Embed_Links on?
because u need that to send embed
lmao
I have the ultimate solution... No one will like it because everyone hates this
let guild = client.guilds.find(g=>g.name == "Your guild name case sensitive")
let channel = guild.channels.find(c=>c.name == "Your channel name case sensitive")
channel.send(stuff)
Never do that but lmao
xD
yes
wait i have a question
is it let votea = new Discord.RichEmbed() or const votea = new Discord.RichEmbed()
because i keep on using const
WOuldnt matter
the only difference is one is editable
LOL
he defined the client as BOT
He is using bot
REEEE
yes im using bot
change it now
change client.channels
change that client to bots
to bot.cannels
reeee
When it says cannot read property of something it means the thing before it is undefined.

LOL
This whole time
welp
We never looked at discord.client
Wait
LMAO
const client = new Discord.Client(); const let bot = new Discord.Client```
fianally!
Lmao wot
thanks so much!!!!
thats both in his code
wait a second
๐ค
omg
im crying
he actually defined both
xD
pls remove the client one since ur not using it
otherwise its confusing people
wait i acutllay defined both xD
lol people now realized
It uses the most recent one made, which in all honesty shouldnt work because it doesnt have ()
lmao same
and good luck
boom bye bye client
its 10:27pm
this entire time
it was client who broke the code
cya
cya
cya
see ya in 6 hours
do u want it to tag the person?
message.author.tag
Not that
u want it to tag the user who voted?
Yes
<@vote.user>
How about the tag?
ohh
dude
u have a link for the docs so i dont have to look it up?
.tag
vote.user.tag returns undefined
๐
yeah vote is just the json for the webhook info
hold on
you would have to define the user, which would mess up if the user wasnt on the same server as the bot
vote.user.tag should work perfectly
but it returns undefined
But it didn't say vote.tag exists in that docs?
yes.. .tag wouldnt exist for numbers
vote = { "user" : 12345678910, "type" : "blahblah" ... blah } vote is just a json string
im unsure in discord.js how to define a user
๐ค
if u figure that out, you can attempt to find the user in a specific guild, or all guilds.. which i probably wouldnt recommend.
let votedUser = currentGuild.fetchMember(userId) something along these lines, someone else probably knows
Oh
then you would end up doing votedUser.tag
the docs say UserResolvable for the type.. so might work if u try guild.fetchMember(vote.user)
So If the ppl is not in my server, it won't work?
yes, because it wont be able to find them
you could do some funky backdoor stuff, mention the user in a private channel, and use other code to get the .mentions from the message
๐
code:
dbl.webhook.on('vote', async (vote) => {
client.users.get(vote.user).send(`I have gave you $${amount}. Enjoy!!`);
});
error:
Unhandled promise rejection: TypeError: Cannot read property 'send' of undefined
@visual zenith client.users.get(vote.user) is undefined
how do you get total server count when your bot is sharded
loop through each shard and add the number of servers to a variable outside the loop
in some libraries you can also just do the total server count and it'll do the work of calculating that for you
It depends on what library and what type of sharding you use
discord.py async
For example in discord.js internal sharding it's just client.guilds.size
Hm idk if anyone here uses d.py async
Afaik everyone says to use rewrite
yeah they do
i think i may have to do something involving an external list where each shard appends its server count and when the list length reaches shard count they set their server count
Are we allowed to do web scraping?
(I looked at DBL's ToS, but I didn't find anything about it)
@coral trellis do you know this?
You'll have to ask Tonkku I am not sure if it's allowed
I would say no just to be safe
web scraping > using the actual api 
'k, I'll wait for confirmation of an web admin tho.
'k
why would u scrape thou
I want to learn how to scrape, so I'm want to create a project for something I'm motivated for.
I'm trying to find something that I can implement in my bot too.
xP
I think I'll do something with steam.
Oh nop
leave it got something.
yeet
Scrape https://example.com
im using js and im trying to make custom welcome
gco.on("guildMemberAdd", (member) => {
const guild = member.guild;
let userdata = JSON.parse(fs.readFileSync("./welcome.json", "utf8"));
guild.channels.find(channel => channel.id === userdata[message.channel.id]).send(userdata[message.channel.id].welcome);
});
}```
discord.js
and i get this
(node:16483) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMemberAdd listeners added. Use emitter.setMaxListeners() to increase limit
you're setting gco.on("guildMemberAdd" multiple times
check the rest of your code. that should be independent from anything else, for example outside of on("message")
ok
also, you shouldnt use readfilesync everytime. use it only once, and save it into a variable so you can re-use it later
Can't u just let userdata = require('./welcome');
Meh, not needed if it's the only file in that dir with that name
Which I'd recommend not having files with the same name
double check the webhook url, port and password
Epic question: how does snipe work? does it log deleted messages? Is it against the tos?
no, yes, no
how can i fetch messages per second
i want to find how many messages sent by users per second
just log the on msg event
im new on js
messages have a timestamp
so you can collect timestamps into an array or something and then compare them and average them
how do you get a bot's description
like in the developer page the short description
or is that not possible
how do i see what servers my bot is in as ive tried
console.log(bot.guilds)
client.guilds.size
for number
and
you can do this with eval
client.guilds.map(g=>g.name).join('\n')
@rocky mesa thx bro
Does anyone know how to fix this?
censored_private_infos-MBP:EagleProtect censored_private_info$ node index.js
Protectist is now online!
/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/structures/RichEmbed.js:165
if (!/\S/.test(value)) throw new RangeError('RichEmbed field values may not be empty.');
^
RangeError: RichEmbed field values may not be empty.
at RichEmbed.addField (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/structures/RichEmbed.js:165:34)
at Client.bot.on (/Users/censored_private_info/Desktop/Discord/EagleProtect/index.js:242:4)
at Client.emit (events.js:182:13)
at MessageUpdateAction.handle (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/client/actions/MessageUpdate.js:13:16)
at MessageUpdateHandler.handle (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/client/websocket/packets/handlers/MessageUpdate.js:7:34)
at WebSocketPacketManager.handle (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/Users/censored_private_info/Desktop/Discord/EagleProtect/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
censored_private_infos-MBP:EagleProtect censored_private_info$
Heres my code:
bot.on('messageUpdate', (oldMessage, newMessage) => {
let medited = new Discord.RichEmbed()
.setColor("#4caf50")
.setAuthor("Eagle Protection Threat")
.setDescription("A user editted a message.")
.addField("User", oldMessage.author, true)
.addField("Channel", oldMessage.channel, true)
.addField("Original Message", oldMessage, false)
.addField("New Message", newMessage, false)
.setTimestamp()
.setFooter("Type: User Edit Message")
bot.channels.get('524416339406749696').send(medited);
});```
this is line 13:
const client = new Discord.Client();
of MessageUpdate.js?
its too complicated for me, i want to be able to get other values
and its a very simple bot
my bot is having a rage episode xd
@zinc pawn thx for helping it works now
np
oh as a heads up "edited" doesn't have two "t"'s @raven bronze for the field where it says "A user editted a message".
my music bot is not working right
im taking this error
{ errors:
[ { domain: 'usageLimits',
reason: 'accessNotConfigured',
i have problem with my api code i can't fix it
how to prevent the shard spawning from repeating server.listen?
shard.js: https://pastebin.com/3xXKFTzq
vanguard.js: https://pastebin.com/SFFp8Vcw
anything else i need to add?
Your problem is that it's doing that for each shard?
Perhaps your sharding manager has some way to know the shard ID?
hmmm
You could check that and make it only happen on one shard
how?
Idk how your sharding manager works sir
Yeh well
There's no shardID in there
So check the docs for your sharding manager
And see if there's a way to get the shard id
lmao
if (client.shard.id === 0) {
//Code that should only run on one shard here
}
so im asking is that how to prevent it from repeating and only do server.listen right after the shards are done spawning?
^^
oh
Yes
If client.shard.id actually returns the id of the current shard
yes it does xD
Then that code will only be executed on the shard with id 3
Which is what you wanted? xd
wait
(node:6729) UnhandledPromiseRejectionWarning: Error: Shard 0's Client took too long to become ready.
(node:6729) UnhandledPromiseRejectionWarning: Error: Shard 1's Client took too long to become ready.
(node:6729) UnhandledPromiseRejectionWarning: Error: Shard 2's Client took too long to become ready.```
idk why it says that
๐
@late hill it doesnt work. It just puts the project on waking mode and doesnt open up the website

No
oh
yo what does channelType.toUpperCase
is not a function
mean
i mean
like theres no channelType.toUpperCase even in my code
what do you mean 
i'm using repl.it for my bot. for some reason, my output just keeps getting spammed with "socket.send() raised exception."
how do i fix this?
thanks
its not even a host at all
multithreading?
?
Sharding is multithreading?
uh, no?
ok, then whats its use?
Discord or lang docs?
Discord
Sorry to bother
I have this code
But this happens
I,eval client.guilds.get("460680695287906306").channels.map(g=>g.send("TEST"))
Oh bots cant talk there
@dreamy charm don't do that

