#development
1 messages ยท Page 1034 of 1
Making and publishing a package is not as hard as it seems
Yes package
an npm package?
inside d.js? you could make a exported function
No, in general
if you want to write a package for another package, you have two options:
- require the original package in your package, add/remove/inject stuff, export the modified version
- create a function that does ^ and export it, and ask people so call the function and give it the original package, and have the function return the modified one
constructor and classes is what i'd go for
[socket.io]i want to send some data from my client only to my server, the other clients should not receive it until the server passes it to them. i found nothing on google, how would i handle this
extend some classes from d.js and add on it
where? what context?
https://www.w3schools.com/js/js_object_constructors.asp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends
I'm trying to think of a context
lets say you want to add calculate() under the message
@coral stirrup use some sort of authentication
For example
Structures.extend('Message', (Message) => {
class RiceMessage extends Message {
constructor(client, data, guild) {
super(client, data, guild);
}
async ask(content, options) {
if (typeof content !== 'string') {
options = content;
content = null;
}
const message = await this.channel.warn(content, options);
return this.channel.permissionsFor(message.guild.me).has('MANAGE_MESSAGES')
? Util.awaitReaction(this, message)
: Util.awaitMessage(this);
}
}
return RiceMessage;
});
This would allow me to do message.ask('question')
the constructor block there is optional
you'd need to learnt he things i sent above
you can omit it
Okay
class extensions and constructors
Alright I'll sleep on this and then decide
use classes if you need to keep some sort of "state"
for example if you want to create a number, then add/remove stuff from this number, but always keep the number updated somewhere
otherwise if you just want to do some operation then forget the number, use functions
isnt that related to how stateless bots work
not exactly, not in this context at least
i see
const events = fs.readdirSync("/home/container/src/events");
events.forEach(event => {
chokidar.watch(`/home/container/src/events/${event}`, {
awaitWriteFinish: true
}).on("change", (file) => {
const commandName = basename(file, ".js")
delete require.cache[require.resolve(`./events/${event}/${commandName}.js`)];
client.events.delete(`/home/container/src/events/${event}/${commandName}.js`);
const props = require(`/home/container/src/events/${event}/${commandName}.js`);
const cmd = new props();
client.events.set(commandName, cmd);
client.on(commandName, cmd.run.bind(cmd, client));
console.log(`${commandName} from ${event} reloaded.`)
});
});``` this sets the event as much times as i edited it how do i make it only one time
bots could be considered "stateless" if they are able to operate without caching
hmmm i see
but inside the discord libraries, each individual object still needs to store some kind of state, so its never fully stateless
especially the websocket
i wonder how slow it'd make the bot if it needed to request everytime a command is fired
i cant even picture how you'd do that though
the problem wont be performance, it will be rate limits xd
but most typical operations can be done without a request
have a main file to distribute the tasks around to other files
hmmm though that'd need caching too
for example the message event includes user and member information, so if you have no caches, you'd only need to request something, if you wanted to get channel or guild data
yeah i cant picture a cache'less bot
would be using that cached data only while the data is being proccessed fair?
im aiming to make all my bots pretty much cacheless
that'd be fun to try actually
djs-light is fully operational even with guild cache disabled for example
i'd be interested in trying that later
the only problem is that you will have no way of knowing how many guilds your bot is on
unless you have an integer stored to count it
or something
could do a simple db for stuff saved on disk
ye
instead of running on ram
you'd be exchanging extra processing and disk storage in favor of ram
could be pretty easy to just store numbers and statistics as integers, and not cache anything else
you could then use guildCreate/Delete and channelCreate/Delete for example, to do guilds++/-- and channels++/-- lmao
hmmm taht too
but thats not what im wondering
i forgot the term
you can use disk as ram
swap?
i think so
im wondering what'd be best, increase ram by using disk as it, or storing the cached data in a db while using disk
whichever uses less footprint
swapping ram will most likely be bad for the entire process's performance
theres that too
while offloading data to a db will keep the process itself fast
i have an idea for a discord caching system
'ive never tried swapping so im unsure about how it works
but i dont really want to make yet another discord lib lol
i still want to try making a lib, though its a bit far ahead from what i can do rn
its not hard, at least at first
it gets annoying once you start dealing with uploading files and connecting to voice
voice support might be a nono in my case, its poorly documented
i tried once mapping the video bit of the api, but didnt go too well
sorry to jump in but is their a way to send a channel link (example like #announcements ) in a embed with discord.js?
kinda wanted to see how it works and if its possible for bots to connect to that endpoint
<# >
thats the format for channels
ok thanks
<#IDHERE>
thanks
np
i might just make a bot and put the src on github
but use a yaml file for config
to mess these people up
why though
but why not
just use env
i despise environmental variables, a json for configs becomes a necessity after a short period
To keep my accounts open
why do you need multiple instances of the bot?
not for bots but for my own account
d.js isnt for normal accounts
selfbotting isnt allowed
i knew this was smelling like raid bots/selfbots
@round owl js let Clients = []; let tokens = ["<token 1>", "<token 2>"]; for(var i = 0; i < tokens.length; i++){ let client = new Discord.Client(); client.login(tokens[i]); Clients.push(client); }
@chilly bison not for bots but for my own account
he's running normal accounts
not bot accounts
selfbotting
using your own account in bots might get you banned
Thank you @chilly bison ๐
@opal plank hey its ok if its bot accounts
the above code doesn't work with self-bots
he said not for bots but for my own account
you'd be surprised how easy d.js makes it so selfbot
both bots and users connect to the same gateway, the only difference is the endpoints each can touch
You login the same way lol
Or use d.js v11...
Literally v11 works with self bots
Has a lot of now deprecated features that selfbots used
he was asking for multiple instances logged into one script. It clearly smelled fishy, why would you help that?
it smells stronger of raid bots than a dead fish
Whats wrong with running multiple bots with the same code
nromally you'd have instances running on different files or using smething like IPC to talk to eachother
Steven, he said it wasn't for bots
not for bots but for my own account
It was for user accounts
i specifically asked why beforehand to check if it was sketchy
if you give a reason for it, i'll help
but just handing out code for someoen to possible break tos?
no thanks
endorsing that is a big no no
Discord saint here
We werent endorsing it either
You can have legit reasons to run the same code for multiple bots
hey, is there anyway I can mention roles in an embedded message in discord.py? cos i tried <@&roleid> and it didnt work
Are you sure the role ID is valid and the role is in the same server you displayed in the embed in
You should be able to
@earnest phoenix you can't mention anything in an embed, no mention will work in an embed
oh wait you mean like actually mentioning it so it mentions the people that has the role or normal mention as it shows the role
?
Question for devs of larger bots (10k+ servers): any of you currently using djs and plan on moving away from it to a different lib? Or previously used to use djs but now using a different lib (ex. Eris)? I've been asking around getting opinions for the next major version of my bot
No sane dev uses d.js past 500 servers
Okay that's what I've been hearing
And I know exactly why cause I've been having similar issues scaling
(memory management)
I personally know a couple devs using discord.js both have 25k+ servers
I've been able to handle memory better though in some ways
I'm support for @humble echo which uses discord.js v12 on over 41,000 servers
seen bots with over 2.5million users on djs
User count is somewhat irrelevant
Since cache keeps a fraction of the total stored
iara (the mod) has a bot in over 33k servers aswell
What's wrong with djs in lots of servers?
discord.js eats up memory
mudae is d.js and has 500k servers
memory is the main thing i've been hearing people left djs for after scaling
I guess for that they basically disable d.js caching and implement their own cache
A lot of bigger bots modify their library to fit their needs
true
"how much stuff does d.js cache?"
"yes"
i've been exploring different options, so i'm trying to get the best idea on how i should go forward with things
say i have a password string
what sort of regex would i need to check it has at least 1 number, at least 1 lower case letter and at least 1 upper case letter
as i've been planning for the next major version of my bot
so i'm trying to get the best advice from the best sources ya know
also - i used djs on my bot and it was on 40k, and it chewed up under 8gb, moved to eris, now 2gb
mudae is a trashy ass bot
mine is between 8-10GB
Irrelevant @earnest phoenix
say i have a password string
For uppercase:[A-Z]
For number:[0-9]
For lowercase:[a-z]
@sick cloud
Idk how to mix them tho
it isn't - developers were stupid and modified the lib i guess? they kept on ignoring ratelimits causing the bot to get api banned on several occasions
string.match(/[A-Z]/g)?
which just proves that not all large bots are necessarily good bots
That'd check only for single-character uppercase letter
There's tons of password regex on the internet
So basically any word with at least one uppercase character would match
how is network bandwidth as well since you moved to eris? @sick cloud
Now you just need to add the other 2 checks
@stark terrace too much because that's all my bot does, uses external apis and such. but its a bit better
also
if (!password.match(/[A-Z]/g).length) return res.json({ success: false, error: `Password must have at least 1 uppercase character` });
if (!password.match(/[a-z]/g).length) return res.json({ success: false, error: `Password must have at least 1 lowercase character` });
if (!password.match(/[0-9]/g).length) return res.json({ success: false, error: `Password must have at least 1 numerical character` });
not the best but should work right
๐
so put each [] group in a ()
yeah ig
oh nm you don't have to
the character set acts like an encapsulation because there's no extra regex
&&
& Ig
&
wait
no difference
Try with ?
Lul
thanks for the opinions y'all
oh i got it
Look at the cheatsheet at the side
helps with my "research" for the next major version of my bot
one * at the end
You could use ? After the asterisk I guess, it'd match the least amount of characters as possible
also i prefer to code things myself and learn if anyone considers telling me to just get one online
ok
nope
That'd match all
matches them all
Like, any character
I don't think it would
oh
Oh, just found something
you can use the conditional
Try ^.*[A-Z].*[0-9].*[a-z].*$
is there any other way to change color in .md files rather than using html
no
thought so

thx
Nice
why dont work?
else if(command === 'testawait'){
message.channel.send('testing')
let filter = m => m.author.id === message.author.id;
try{
let msg = await message.channel.awaitMessages(filter ,{max: 1, time: 10000, errors:['time']})
}
catch(e) {message.channel.send(`Error ${e}`)}
message.channel.send(`test: ${msg.first().content}`)
}
v12
nvm
How can I make my bot play a mp3 file in a voice channel
@earnest phoenix rename e to e.message to see actual error
Lavalink (or lavaplayer if you're using java) @spare mirage
There might be other audio libs out there
if i want to add changing status
what is the best interval to put
10 secs
or ?
what do you mean?
yes
like playing with soething
just use setPrecense
it will change to some thing like playing catch
i know
i am asking the interval
to set it
What!?!?!?
i mean if iset it low it will considered api abuse
like it will change every 10 secs from playing something to >> playing minecraft
Make them change around 10 seconds each
bad idea to do that btw
its not recommended to use the api for constantly changing status @distant bramble
though if you are going to, set it to at least 2 minutes or something
the general api rule is:
dont do stuff every x
@Danny automating the API in that way /is/ abuse. Automatically doing "X" every N is generally not a good idea. Where X could be posting a message, changing someone's nickname, renaming a role, changing a channel topic, etc...
Generally bots should only react to user actions...
Although, for very large N we generally don't care. But for small N, we do care. Think rainbow bots, etc....```
oki
might be better to keep the prefixes on memory instead
@opal plank you have instagram?? i need for test ig command ๐
oh ok
just use some famus duds instagram
i not use instagram๐
https://www.npmjs.com/package/discord-leveling is using something like this an good idea?
nvm
why make it yourself when there's a npm package that's a literal dumpster fire to do it for you

ikr, why code a bot when theres github and stackoverflow to copy code from
though, on a real note, you should probably use a database @spare mirage , most of the stuff i see here is simply replacing the database calls for methods
alright, I guess
most of the stuff i see inside there i did with roughly
scared Justii noises
whats that command?
i just dont endorse using pre-made code that its simple enough to be done
a is my prefix for admin commands
currency command
the blurred command :P
acheck
ok
Leveling isn't super hard to do
Can u give me a rough explanation of how it works?
I use raw xp for calculating level
Same
Or xp = level ^ 2 * 100 for required xp calculation per level
those are basic functions you'd want to have it handled, which is all done in that file, its almost the same as that lib you showed me
ahh I see
Then I give 15 xp per message to users
The rest is up to you what will you use the levels for
that should give you at least a rough idea on what you'll need
/**
* * Get XP required for a level.
*
* @param {number} level
* @returns {number} xp required for level
*/
xpReq(level) {
return 6 * level ** 2 + 80 * level + 100;
}
this is mine
i purposefully hid the code, but you can see a bit how the structure is
Note that there isn't a "better formula"
Slightly based off MEE6's xp formula
It really depends on how hard you want to be levelling
indeed
it's hard to design a good system
In my case, from 1 to 10 is quite fast, but 11 and above it starts to get a bit vertical
the strcuture i showed is the bare bones behind it, the thing you'd want to get is the adding of the exp
you need to count in exponential growth
Yep, that's my case
i think i added a cap on mine, but thats cuz im storing it in int, not bigint
i dont plan on having exp/currency going above 8 digits long
doing math in bigint is annoying af
umm
you can mix exponential growth and add a cap where it starts linearly and then goes exponentionally again
you can also make it parabolical but that's not a good idea
quadratic
you can also make it parabolical but that's not a good idea
@earnest phoenix reaching vertical wall be like:
Level 5: 500xp
Level 6: 45764947xp
thats just mee6 level 9 to 10 lmao
hmm
Make it prime numbers * 100
Insane xp-gaps during levelling
disabling cache helps
ah
1.4gb? wtf
last time i saw this much RAM usage was when i had Enmap running
how come onclick only works once then i have to reload the page
@earnest phoenix what is <% that for
if I just do
<button type="button" onclick="pressTest();">Click Me!</button>
it works multiple times
I'm just doing console.log('pressed')
const { MessageEmbed } = require('discord.js')
module.exports = {
name: 'userinfo',
description: "This is to quickly get your **username** and ID without having to have dev mode , checking profile,getting the id",
execute(message){
const taggedUser = message.mentions.users.first();
const embed = new MessageEmbed()
.setTitle('User Information')
.addField('User name:', taggedUser.username)
.addField('Player ID', taggedUser.id)
.setThumbnail(taggedUser.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
if (!taggedUser)
setTitle('User Information')
.addField('User name:', message.author.username)
.addField('Player ID', message.author.id)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0x0000ff)
}}
ok ty
if(!tagUser){
const embed = new discord.MessageEmbed()
//Your Embed
message.channel.send(embed)
}
<button type="button" onclick="<%pressTest();%>">Click Me!</button>
only works once
then i gotta reload page
@earnest phoenix taggedUser.id.username isnโt a thing
why else do you think i shrugged
.
if(!taggedUser){
const embed = new discord.MessageEmbed()
//Your Embed
message.channel.send(embed)
}
@hazy sparrow
Oh wait
please give him context
Itโs taggedUser
I still don't understand why you're using <% or where you're using this
that's ejs
ah
right
sorry me dumb and tired
well I've never used ejs so I have no idea why this simple thing wouldn't work, but can you do an event listener instead?
erela.js?
Botum onaylanana kadar aรงฤฑk olmasฤฑ mฤฑ lazฤฑm
Because no one is mentioned
You said it x)
First, message with mentioned user, second, if not mentioned, user itself
A big problem x)
how?
It's your code x)
i want it to display the details of the author if no user is mentioned
Put those two blocks in different conditions. The first if someone is mentioned and the second if not
ok
๐
Not outside, inside
ok
yo !
so a if statment or else if
If taggedUser
Information about tagged user
else
Information about author himself
yo
Yo
so would this work
execute(message){
const taggedUser = message.mentions.users.first();
const embed = new MessageEmbed()
if (taggedUser){
setTitle('User Information')
.addField('User name:', taggedUser.username)
.addField('Player ID', taggedUser.id)
.setThumbnail(taggedUser.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
}
if (!taggedUser)
setTitle('User Information')
.addField('User name:', message.author.username)
.addField('Player ID', message.author.id)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0x0000ff)
}}
@earnest phoenix
Yeap
Tysm??
thank you so much
same error
@bot.command()
async def problem(ctx):
print('hi')
await ctx.send('are you sure you want a staff to join and help, you have 30 seconds to react. REACT WITH ๐')
reaction, user = await bot.wait_for("reaction_add", timeout=
nope
not at ALLl
and im still getting this
File "main.py", line 52
async def problem(ctx):
^
SyntaxError: invalid syntax
๎บง
@earnest phoenix im getting this error
@hazy sparrow see what you've done with your code
it's .setTitle
oh
I assume it's an embed
@median star yeah ๐ but you have the error now, I think, it's not the code you're showing is the problem, but the upper code
@hazy sparrow you want to call functions from nothing...
i read the whole thing
well if you copy/paste that embed it should absolutely work
wait
the code example
const { MessageEmbed } = require('discord.js')
module.exports = {
name: 'userinfo',
description: "This is to quickly get your **username** and ID without having to have dev mode , checking profile,getting the id",
execute(message){
const taggedUser = message.mentions.users.first();
const embed = new MessageEmbed()
if (taggedUser){
.setTitle('User Information')
.addField('User name:', taggedUser.username)
.addField('Player ID', taggedUser.id)
.setThumbnail(taggedUser.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
}
if (!taggedUser)
.setTitle('User Information')
.addField('User name:', message.author.username)
.addField('Player ID', message.author.id)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0x0000ff)
}}
@median star I can't without more information... And I think you need to review the entire syntax around the line 52,it will give you the problem you searching for
this is my whole userinfo code
nope, you need to add the "embed"
@hazy sparrow you need to call functions from the right point...
embed.setTitle()
oh i see
const exampleEmbed = new Discord.MessageEmbed().setTitle('Some title');
if (message.author.bot) {
exampleEmbed.setColor('#7289da');
}
like so ๐
and just add stuff to it
How can I make the bot ignore pinned messages when bulk deleting?
hmm discordjs?
yes
but now the bot wont do anything when i dont mention anyone
there probably is a "pinned" value, would have to check the docs
not even a console error
i cant find it in the docs
@hazy sparrow what's your code now?
wait
const { MessageEmbed } = require('discord.js')
module.exports = {
name: 'userinfo',
description: "This is to quickly get your **username** and ID without having to have dev mode , checking profile,getting the id",
execute(message){
const taggedUser = message.mentions.users.first();
const embed = new MessageEmbed()
if (taggedUser){
embed.setTitle('User Information')
.addField('User name:', taggedUser.username)
.addField('Player ID', taggedUser.id)
.setThumbnail(taggedUser.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
}
if (!taggedUser)
embed.setTitle('User Information')
.addField('User name:', message.author.username)
.addField('Player ID', message.author.id)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0x0000ff)
}}
You didn't send the embed
X)
lol, you miss stuff sometimes, it happens
just gotta check twice
or three times ๐
๐
thank you guys
No problems ๐
@mild flower try console logging a message and see if there's a "pin" option
or something like that
hmm
You have launched it 2 times maybe ๐ค
how do i fix it?
Prolly?
it works
yea
what did you change?
what
๐
@mild flower if you don't find a pin option in the messages then just fetch all the pinned messages in that channel channel.messages.fetchPinned();, and then check that the message you're deleting is not a pinned message
eh
you're not running it locally and on a server or something like that?
no extra node tabs open?
@hazy sparrow close vsc
ok?
X)
h
You have launched your bot whit cmd too @hazy sparrow?
wut?
Check task manager
node?
Maybe
always sending twice? that's weird
Do you have an eval command?
are your if statements working properly?
eval client.destroy()
destroy 
Then see if that's the error
Why is that funny
this is the whole code
const { MessageEmbed } = require('discord.js')
module.exports = {
name: 'userinfo',
description: "This is to quickly get your **username** and ID without having to have dev mode , checking profile,getting the id",
execute(message){
const taggedUser = message.mentions.users.first();
const embed = new MessageEmbed()
if (taggedUser){
embed.setTitle('User Information')
.addField('User name:', taggedUser.username)
.addField('Player ID', taggedUser.id)
.setThumbnail(taggedUser.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
}
if (!taggedUser)
embed.setTitle('User Information')
.addField('User name:', message.author.username)
.addField('Player ID', message.author.id)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0x0000ff)
message.channel.send(embed)
}}
ok?
so just .setTitle?
no,you definitely need that, I don't understand what shitdev is trying to say
all commands run twice? like, even a !ping?
ah I see the issue
the second if doesn't have brackets
yeah
I haven't see that ๐ญ๐ญ
it finally works
The brackets are extremely important when you do else if statement
haha there you go
ty erick
np
So not user
guildmember
how?
And there is fonction that I don't remember
;-;
which docs
On Google ๐
ty
Glitch is gay
ik
Make another project
It is just a code editor

U can host on ur pc
how
Using node
Bruh
there, you started a server
node app.js
node whateverit'scalled.js
and the bot loads
how to start in terminal
How do u start terminal?
i have made a project server.js and pasted file there
node server.js lol
@restive pebble
Remove lol
lol
Lol
Where
in the terminal
Is it js or py?
running py on node
big yikes
Ok
uh, ok
u can run py on glitch tho
Hmmm
thats it
But it is closed
i did
any type of console?
he uses py if i see it correctly
show code on ready event
show code bruh
server.js?
yes

no need for anything afterwards
wheres the login?
U are not logging
it is there
client.login(token)
At last
bottom?
Yeah ik
yeah why would he share the login lol
just remove the token part
but keep it there so i have an idea
Code:
});
bot.on("message", message => {
conx(bot, message);
if (message.content.startsWith(bot.prefix)) {
let args = message.content
.substring(bot.prefix.length)
.trim()
.split(/ +/g);
let black = new (require("megadb")).crearDB("blacklist")
if(black.has(message.author.id) && message.content.startsWith(bot.prefix)) return message.channel.send("You are blacklisted.")
let cmd = bot.commands.get(args[0].toLowerCase());
if (cmd) cmd.run(bot, message, args);
}
});```
**Errror:** "conx" is not defined.
Can someone fix this?
aight perfect

@earnest phoenix conx is not defined
Lol
uhm
Obviously.
not my area
@opal plank now
How do I define it?
Is a function?
ok
U are not logging
@restive pebble
client.on("ready", () => {
console.log("Bot was logged in");
he didnt share that bit
it is already there
Ok
thats not in the code you sent me though
client.on("ready", () => {
client.user.setActivity(`#help`, {type: "PLAYING"});
});```
this is what you sent me
OkK
just remove the token from it
everything is correct
if everything was correct it be working
U cloned from glitch?
const client = new Discord.Client();
const prefix = "#"
client.on("ready", () => {
client.user.setActivity(`s!help | s!nitro`, {type: "PLAYING"});
});
const embed = new Discord.MessageEmbed()
client.on("message", message => {
if (message.content.startsWith(`${prefix}updates minecraft`)) {
const help = new Discord.MessageEmbed()
.setFooter(
`command by ${message.author.username}`,
message.author.avatarURL
)
.setFooter("MineCraft Updates Java")
.setTimestamp()
.setColor("#FF4500")
.setAuthor("Help Commands")
.setDescription(
"1.16, the first release of the Nether Update, is a major update to Java Edition announced at MINECON Live 2019[1] and released on June 23, 2020.[2] This update overhauls the Nether by adding four new biomes, four new mobs (the piglin, hoglin, zoglin, and strider), and a multitude of new blocks, including many variants of blackstone as well as the respawn anchor used to set the player's spawnpoint in the Nether. It also adds a new netherite tier of equipment, obtained through ancient debris found rarely throughout the Nether."
);
message.channel.send(embed);
}
});
client.on("error", err => console.log(err));
client.on("ready", () => {
console.log("Bot was logged in"); // Output a message to the logs.
client.login("u think i m nub lol")
});
oof

client.on("ready", () => {
client.user.setActivity(s!help | s!nitro, {type: "PLAYING"});
});
client.on("ready", () => {
console.log("Bot was logged in"); // Output a message to the logs.
twice
you have listeners on the same event twice
client.user.setActivity(s!help | s!nitro, {type: "PLAYING"}); is for status
merge them into one
ok
done
client.user.setActivity(`s!help | s!nitro`, {type: "PLAYING"});
console.log("Bot was logged in");
});```
Run lol
Yes it still dosent matter

I have like 4 ready events
yea
Still it runs
but then also
Hmmm
it is not running
Ookkk
Don't directly clone
Did u changed the library?
const Discord = require("discord.js");
const client = new Discord.Client();
client.on("ready", () => {
console.log("Bot was logged in"); // Output a message to the logs.
client.login("u think i m nub lol")
});```
run this
i wanna check something
Can someone write me a command to tell how many servers my bot is in
oh, right
Yea
const Discord = require("discord.js");
const client = new Discord.Client();
client.on("ready", () => {
console.log("Bot was logged in"); // Output a message to the logs.
});
client.login("u think i m nub lol")```
run this
No spoonfeeding dude
me?
the other guy
Yes
I think he changed the library
Ultron, move the client.login outside of the event
My music bot keep giving me leaving the voice channel and this is in the console
Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
it is outside
its inside
Can someone write me a command to tell how many servers my bot is in
the link to add the bot to a channel tells you that? or are you trying to flex and put that on a website or something?
the code you gave me is inside the ready event
Hmmmm
Mhm
client login is inside the event emitter that only happens when you login
see the issue?
const client = new Discord.Client();
const prefix = "#"
client.on("ready", () => {
client.user.setActivity(`s!help | s!nitro`, {type: "PLAYING"});
console.log("Bot was logged in");
});
const embed = new Discord.MessageEmbed()
client.on("message", message => {
if (message.content.startsWith(`${prefix}updates minecraft`)) {
const help = new Discord.MessageEmbed()
.setFooter(
`command by ${message.author.username}`,
message.author.avatarURL
)
.setFooter("MineCraft Updates Java")
.setTimestamp()
.setColor("#FF4500")
.setAuthor("Help Commands")
.setDescription(
"1.16, the first release of the Nether Update, is a major update to Java Edition announced at MINECON Live 2019[1] and released on June 23, 2020.[2] This update overhauls the Nether by adding four new biomes, four new mobs (the piglin, hoglin, zoglin, and strider), and a multitude of new blocks, including many variants of blackstone as well as the respawn anchor used to set the player's spawnpoint in the Nether. It also adds a new netherite tier of equipment, obtained through ancient debris found rarely throughout the Nether."
);
message.channel.send(embed);
}
});
client.on("error", err => console.log(err));
client.login("lel")
;
this is new
one
that should be fine now
though i prefer to put the login before the ready event to chain it
but thats just visual
Ur ram is not enough then
@restive pebble rip i guess i donโt have enough ram
Yes
How much ram tho
Bruh
||confusion goes around||
you technically need available memory for every operation you do
If u don't have enough ram left
If bot is running in many servers
It might be the issue of ram
right, makes sense
||why my bot is not on9||
**i told you **
||what||
read above
Stop sending like that
I'm not certain if that's how music bots work since never made one properly myself, but I believe the music buffer remains in memory until the dispatch is over
That spoiler tag
ok
My bot is running on 250 guilds and hosting on repl.it cause I have no money
So thatโs why
Yea
dang
Yes
yeah ok makes sense
It completely ram issue
ask for donations 
how much ram would you need for that?
For?
250 guilds music bot
Hmmmm
tryitansee
not
i did
Is enough
send new code
yeah ok a decen amount
Except the music code
im trying to use a new host so i used my packages and im getting this error how would i fix this Error: The module '/home/container/node_modules/rex.db/node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 64. This version of Node.js requires NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).
With enough effort your bot doesn't have to use much memory
node-gyp rebuild
that dosent work with my host
const client = new Discord.Client();
const prefix = "#"
client.login("nub")
client.on("ready", () => {
client.user.setActivity(`s!help | s!nitro`, {type: "PLAYING"});
});
console.log("Bot was logged in");
okok chill
U are in 12
const Discord = require('discord.js');
const client = new Discord.Client();
client.login('nub');
client.on('ready', () => {
client.user.setActivity(`s!help | s!nitro`, { type: 'PLAYING' });
console.log('Bot was logged in');
});```
this
then it must've been upgraded against your will
And it was compiled for 10
forced upgrades ๐ฎ
I did
so how do i switch back what can i do in my package json 
engines
Do you have access to the console?
You don't have to necessarily downgrade too if you can rebuild
oh
"engines":{
"node":"10.x"}
okay wait so if i have something like this in package.json what would i need to have it as cause i used to have this in it
"node": "^10.20.1"
},```
you'll need to be able to use the console so, wait till the bug is fixed?
did u downgrade?
i mean npm rebuild and shit wouldnt work i tried that on glitch before moving to a better place
Glitch is gay
it was erroring like that with "engines": { "node": "^10.20.1" }, on it so i just took it off and got the same error
exactly
Use 12.x
so just put 12.x?
Yeah
"engines": {
"node": "^12.x"
},
It automatically uses latest
Yes
If ur node modules were compiled in v12 then only it would work
npm unistall
And install again
Or just npm install
Glitch is gay
@restive pebble what do you mean?
I'm too lazy to scroll up but okay fine
Glitch is bad host
^^^^^^
๐
Btw boeing what do I need to play SoundCloud
Play from yt dude
nO
Search for some packages
oack



