#development
1 messages ยท Page 940 of 1
@viral spade Do you cache all ur querys btw
what do you mean exactly? i cache only info that is necessary. and i think the mysql engine caches queries per default.
@modest maple
You might not have to pass discord entities by using some js magic
you can also use ```js
${member}
I mean do you actually Prepare all your statements rather than sending the DB a query string every time
nope, but thanks for that top i will look at it
bruhhhhhh
thats like
Speed DBs 101 lol
Preparing Querys reduce the number of round trips to the DB server per request
especially when you're calling alot of querys
thats the SQL version
MySQL's prepared system is dumb af tho lol
Compared to Other systems where you can store it as Vars and just do execute some_name and then some values with just one query request
How to make like this?
Yeah but what about the base infratsructure?
assume 2000 shards. Assume each bot server can handle 100 shards, so 20 bot servers, each database server handles 200000 guilds, so 10 database servers. And 1 coordination server that holds the guild to database locations info, which are then cached to clients guild objects.
I have to retrieve and cache each guildmember on first text or voice activity.
How would you assemble these connections between shard and guild db? @modest maple
i wouldnt assume a single instance can take 100 shards
okey so how many?
200,000 Guilds could easily be handled by a single Server and a DB server with cache db partnering it
okey then imagine the same question, but with changed values, like 40 bot servers and 10 database serves..
How would you assemble these connections between shard and guild db?
can someone help-
my code
client.on("message", (message) => {
if (message.author.bot) return;
if ([message.author.id])
[message.author.id] = {
xp: 0,
level: 0,
};
db[message.author.id].xp++;
let userInfo = db[message.author.id];
if (userInfo.xp > 100) {
userInfo.level++;
userInfo.xp = 0;
message.reply("Congratulations, you level up");
}
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
if (command === "info") {
let userInfo = db[message.author.id];
let member = message.mentions.members.first();
let embed = new Discord.RichEmbed()
.setColor(0x4286f4)
.addField("Level", userInfo.level)
.addField("XP", userInfo.xp + "/100");
if (!member) return message.channel.sendEmbed(embed);
let memberInfo = db[member.id];
let embed2 = new Discord.RichEmbed()
.setColor(0x4286f4)
.addField("Level", memberInfo.level)
.addField("XP", memberInfo.xp + "/100");
message.channel.sendEmbed(embed2);
}
fs.writeFile("./database.json", JSON.stringify(db), (x) => {
if (x) console.error(x);
});
});
is getting a error (will paste in now) the bot powers online just fine but when someone is suppost to level up my terminal says:
[WS => Shard 0] Heartbeat acknowledged, latency of 277ms.
C:\Users\Jon\Desktop\SpiderBot Project\index.js:383
[message.author.id] = {
^
TypeError: undefined is not a function
at Client.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:383:25)
at Client.emit (events.js:224:7)
at MessageCreateAction.handle (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Jon\```
what library is that?
discord.js
version?
If i was scaling across machines i would use a SQL server farm and a load balancer between the DBs
12.2.0
combined with a Cache DB
However
I would mostly just Make Auto Scaling Database running on a single Dedi
and have the other Multi machine bot connections go to the Api
nvm its fixed
kk
assuming each cluster group had its own Cache DB like Reddis that API could scale to insane numbers
fs.readdir("./parts/", (err, files) => {
if (err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js" && f !== "Part.js");
if (jsfile.length <= 0) {
console.log("Couldn't find parts.");
return;
}
let indexn = Math.floor(Math.random() * jsfile.length);
part = jsfile[indexn];
console.log(jsfile, jsfile.length, indexn);
});
```Little help here? It only logged jsfile and the rest is undefined. Any idea why?
K thanks
Who uses DiscordGo here ?
@modest maple and have the other Multi machine bot connections go to the Api what do you mean by this? Why do you need an api? i mean you can directly connect to the databases, also redis, no?
in discord.js @earnest phoenix ?
@viral spade
Assuming Each Machine had its own Cache Db
the API could be anything
its just a general term for interacting with the DB
Ok and with cache db, you mean a db on localhost? on disk or memory? Does this have to be a db or do you also mean stuff like a simple in-code javascript collection with this?
i Mean an actual Cache DB
like redis?
yh
You would send all requests to the cache DB for reads, if the Cache hasnt got a recent value for the request it fetched from the DB server
ok and the one "backup" db behind the api is also redis, with persistency or what would you take there?
the DB in that diagram would be somthing like postgres or Mongo etc...
which is not cache
The Cache Dbs (Assuming for multi machine scaling you would be on some big dedis) would be using alot of ram
so they would handle 95% of all read write traffic
reducing the overall requests a sec on the DB itself
Depends what Cache Db u use
guess i will post later since my question is 99% gotta ignored because of a conversation happening
Some support Writing also and then manages sending it to the main DB anyway
which would work along the lines of every X amount of minutes it would bundle all writes its had and execute a bulk query to the Db
Okay that sounds nice. thank you very much so far.
What i still dont see.. When a guildowner resets the stats of a guild in my bot, it deletes all data of all guildmembers and this takes some time, as its possibly hundrets of thousands of rows. i cannot image how this works out with only one single persistent database.
It would Dump all the data for the Guild in the Cache DB (Which cuz cache takes seconds) and then the Cache DB can control dumping data from the main Db
things like PostgreSQL support bulk deleting rows in single querys
i am deleting in a single query, and it takes long and i think it is normal to take that long for hundrets of thousands of rows.
i think it is so expensive, because the primary key is clustered, so it needs to rearrange the rows on the disk. idk
I think that just comes down to Size of Data and MySQL's lack of efficency
Also, with the reset, i do not really save much by writing it to cache first. Yes i can even out the update progress, but i dont have less to delete, aside maybe a few who in the meantime wrote something.
Refers more to downtime
Cache can Dump data faster than IO bound DB
which gives the Db a buffer period
I mean IDK how you have you system setup
thats what i meant with even out the update process. still i dont have less to delete, the deletes take long and theres reset commands coming in every minute.
so that will be every second in not so long
How big are the datasets per guild?
i tried to make bot status it usually like
console.log('Your Text Here');
client.user.setActivity('Text here', { type:"WATCHING"}).catch(console.error);
});```
but my new code has delete const client instead of
```const {
Client,
Client: { plugin }
} = require("");```
after i using that my bot activity not shown up.
but if i tried putting const client back it still the same not showing up, i tried change client.once to plugin.once but it shown error about not a function.
what are you even trying to do?
let parts = ["Zeta", "0"];
let indexn = Math.floor(Math.random() * parts.length);
let part = parts[indexn];
console.log(parts, part, indexn);
``` little help here? only parts can be defined using console.log and I don't quite get why
What?
?
only parts can be defined using console.log and I don't quite get why
i mean like the console only outputs the parts variable
part and indexn are both ignored
Ah
Permissions.every(perm => message.member.hasPermission(perm))
Permissions.every is not a function
Hi, in discord.js, how can i get an user object by user id?
If you're using v12 discord.js
client.users.fetch(user_id_here)
Thanks
how i can hide a link behind a text
You need more commands, or you have some idea. Join the [Support server](https://discord.gg/Q2eZs6A) and Tell us
i tried this but not working
i called the text from a json file
oh
oof
Noice
Fun fact: You can send links like that in plain text through webhooks.
hi, i'm a big confused how i need to do this
i'm trying to do something like, {repeat:text-here} and then my bot will send text-here, how would i do that?
ik i have to do something with regex, not sure how though
in js btw
split the instruction to operation and operand (via the :), parse out the brackets and send the operand
oh
thats easier than i thought
ty
@white anvil , i'm a bit confused, i came up with js '{repeat:eeeee}'.split(':')[1].split('}')[0] but what would i put where eeee is?
why did you tag me
it was a mistake
๐ค
well now that you've seen my mistake i can remove it and clear up the chat
why not just parse it as a js object (if it's json)?
why go through the hassle of splitting
its not json
you can only await in an async function
yes
Why is it structured exactly like {repeat:text} then
where.... on line 33???
idk whats line 33
i'm doing it for my custom commands
the error
so its like
@turbid bough line 33 is where the error is
cc create helllo {repeat:ee} e
line 33 is the beginning of the function...
that won't work at all lmfao
Anย async functionย is a function declared with theย async keyword. Async functions are instances of the AsyncFunction constructor, andย the await keyword is permitted within them.ย The async and await keywordsย enableย asynchronous, promise-based behavior to be written in a cleanerย ...
Hi can someone help ? I'm trying to use better-sqlite3 but i can't find any tuto and i don't understand anything TwT
Pls T-T
docs
Yea but it doesn't work
yea
how are we going to help you
db.prepare('INSERT INTO test (name, age) VALUES (@name, @age)')
^
SqliteError
ยฐ-ยฐ"
hi, quick question. how can i make my bot still respond? i mean like if i do !ping it will respond, if i do !ping ee it won't respond. how can i make it respond even wid `ee on the end?
use startsWith
yea
kk, thanks
I've also put ```sql
sql.prepare("CREATE TABLE scores (name TEXT, age INTEGER);").run()
ok, so
^-^
I'm just dumb ๐ฆ
can I use a forEach on channel.updateOverwrite
i done js if (args.join(' ').startsWith(a)) { /* & message.content.startsWith(a) */ /* do whatever i want here */ } but nothing responds, any ideas why? before i was just doing ```js
if (a) {
/* do whatever i want here */
}
yes @earnest phoenix
aight
@pale vessel any ideas why?
a is command name right?
yeah
and the args don't contain the prefix
nope
kk
when i do ;;ping, args.join(' ') logs ping
when i use a cc, like ;;p it logs { name: 'p', response: 'p' }
otherwise a logs undefined
what even is a lol
guild.commands.find((e) => args.join(' ') === e.name)
when i was just doing if(a).. it would work fine
when i do if(args.join(' ').startsWith(a)) and if(message.content.startsWith... nothing responds
that's an odd way of doing that
I made a setNSFW command and i have no errors and it says "The channel is now NSFW" but its not? my code is:
client.on("message", (message) => {
let args = message.content.substring(prefix.length).split(" ");
switch (args[0]) {
case "setNSFW":
if (!message.member.hasPermission(["MANAGE_CHANNELS", "ADMINISTRATOR"]))
return message.channel.send(
"**error** You need the manage channels permission!"
);
message.channel.setNSFW;
message.channel.send("โ
I have set the channel to NSFW! โ
");
break;
}
});
won't message.channel.setNFSW be a function?
I was typing message.channel. and it had auto fill and setNSFW was a option
so i created a new command for setNSFW
i meant three lines before the break
oh so i need a function insted of setNSFW
do u know why my thing aint responding? no clue why its not
no @still merlin
setNFSW is a function
ok
${Permissions.join(", ").replace("_", " ")}it's not working properly
You sure you don't want to make all those permissions a bit more readable? Such as making it in title case form?
<style> html, body { background:#232323; } </style>
I've tried to use that to change my bot page background but it isn't working?
omg tysm!
bot.shard.broadcastEval(`this.users.cache.get("335490587740471297").send("${embed}")`)```
2 times sending messages
I want it to send 1 time
I think the User has different shards
Where do you use?
eval
You can get some guild (includes the User), get the user then send message.
hmm
When implementing a simple cache for guild settings and i am starting up a shard, then big guilds will cause the cache load "at the same time" as one event comes in before the other events cache load is finished.
What is the best practice to prevent this? should i not care and simply let it overwrite? or introduce a "loadingGuildIds" set (events getting ignored if the guild is currently loading)?
or just add !important
I am trying to learn discord-akario
pls just use normal css
where should i put it?
when u want to load the commands
class PingCommand extends Command {
constructor() {
super('ping', {
aliases: ['ping']
});
}
exec(message) {
return message.reply('Pong!');
}
}
module.exports = PingCommand;```
i make ping command
ok
where should i put it?
ยฏ_(ใ)_/ยฏ
or example
yeah i'm read
doesnt seem like u did
cuz u cant even use a framework which does everything for u
I use my own
same
sorry my bad english
even tho its just a command handler
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
whats wrong with the code, its not working
error maybe?
And error logs?
"name": "beats",
"version": "1.0.0",
"description": "Beats bot.",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Austin",
"dependencies": {
"beautify": "0.0.8",
"discord.js": "^11.4.2",
"fs": "0.0.1-security",
"js-beautify": "^1.11.0",
"util": "^0.12.3"
}
}
thats package
and I thought it's never RichEmbed(), but
v11: Discord.RichEmbed()
v12: Discord.MessageEmbed()
ok use Discord.RichEmbed(), not just RichEmbed()
Still, any errors?
U can do it like {} this iirc
ok @nocturne grove ill try
const { RichEmbed } = require("discord.js");
yes leave that
discord isnt defined
what is it doing and what does it not do?
i gave u the scri[t
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new Discord.RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new Discord.RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
What's the error
embed
Give me some kind of error log
k
^^^^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)```
why is there a d
@indigo flax d.RichEmbed()
k
d wouldnt be define tho
just do RichEmbed what you always did
I dont think it needs to be there if you only defined RichEmbed
don't do the d
Remove the d.
because you just deconstruct Discord
const d = require("discord.js");
d.RichEmbed()
They defined RichEmbed itself
yeah it wont work still
my current script is
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
error?
logs say
let embed = new .RichEmbed()
^^^^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
remove the dot
yes but I don't see a dot in your code ๐ค
its coming from somewhere
There's one
maybe add the . 
this correct tho
message.channel.send(embed);
right?
SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
Yes thats correct
omg whats wrong
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
i dont understand
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
@earnest phoenix I don't get where u sre saying the .
Im trying to turn my bot online, I type node . and this happens:
i dont use that on my other bots
i just go node . on my index.js and it turns online-
read a tutorial on how to run node programs
right so node index.js
ok
I did node index.js and same error
still same error
did i install node.js wrong. (i had to reinstall)
plottwist: he doesnt have node installed 
maybe thats the case
go ahead and install it then
I'm actuccly asking for a friend- they sent that error but no one responded and so i asked for them
help pls
"discord.js": "^11.5.1",
if its installed then this could be the problem
my friend dosen't have a path and dosen't know what that means
It could be since the message was a DM, rather than in the server.
but they have node modules file
@still merlin send them this https://love2dev.com/blog/node-is-not-recognized-as-an-internal-or-external-command/
Me and my friend are rly happy rn thank u for that link!
how do i fix it?
hmm
if (msg.guild.id === '264445053596991498') return console.log('Will it be like this?')
Hi, I am trying to using shoukaku, how do I search for a song?
I couldn't see it there
it still doesnt work
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
ID
idk
it doesnt work
:/
let embed = new .RichEmbed()
^^^^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
there is no .richembed
???
look at the code
const beautify = require("beautify");
module.exports = {
name: "eval",
aliases: ["e"],
description: "Eval command.",
usage: "<code to eval>",
execute: (bot, message, args) => {
if (message.author.id !== "503641535342968832") {
return message.channel.send("You don't have permission to use this command.")
.then(m => m.delete(5000));
}
if (!args[0]) {
message.channel.send("You need to eval _**SOMETHING**_, please?")
.then(m => m.delete(5000));
}
try {
if(args.join(" ").toLowerCase().includes("token")) {
return;
}
const toEval = args.join(" ");
const evaluated = eval(toEval);
let embed = new RichEmbed()
.setColor("#00FF00")
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setTitle("Eval")
.addField("To evaluate:", `\`\`\`js\n${beautify(args.join(" "), { format: "js" })}\n\`\`\``)
.addField("Evaluated:", evaluated)
.addField("Type of:", typeof(evaluated));
message.channel.send(embed);
} catch (e) {
let embed = new RichEmbed()
.setColor("FF0000")
.setTitle("\:x: Error!")
.setDescription(e)
.setFooter(bot.user.username, bot.user.displayAvatarURL);
message.channel.send(embed);
}
}
}```
example from the discordjs docs
where is there .richembed
doesnt work
What is the search method in shoukaku?
@golden condor just read up an example implementation https://github.com/Deivu/Kongou
please ping if u know something about mongodb/mongoose
I can't see where it is
you're really not checking are you?
@earnest phoenix I am tryna
@earnest phoenix add me, can we discuss in dms?
I can't see it
check in the commands presumably?
Is it the rest thing?
could be
Can you just give me a straight answer ffs
now index is having an error
at Client.emit (events.js:189:13)
at MessageCreateHandler.handle (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/discord.js/11.6.4/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/discord.js/11.6.4/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
at WebSocketConnection.onPacket (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/discord.js/11.6.4/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
at WebSocketConnection.onMessage (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/discord.js/11.6.4/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
at WebSocket.onMessage (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (/rbd/pnpm-volume/9fa0b08b-19da-4e92-aaac-b7e3b1931a40/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/websocket.js:789:20)```
Client.bot ?
do i look like someone who knows/uses discordjs/Shoukako
i just look at the docs and understand it

i'll try that see if it works
plus the codeblock the error refers to
Is there a way to check where your bot is in the verification queue?
no
Guess more patience it is.
if you submitted it and haven't recieved any dms from @gilded plank apart from the "your bot was submitted" one, it wasn't reviewed yet
unless you're talking about Discord verification, then nope
No, I'm talking about the verification in this server. I've only received the submission message from Luca. Any idea how long they take on average? Not that I expect everything to be verified instantly because there's definitely a high influx of usermade bots.
1 week or more
Aha. That makes sense, thank you.
My bot is being a bit buggy-
I have the the code
client.on("message", (message) => {
let args = message.content.substring(prefix.length).split(" ");
switch (args[0]) {
case "setNSFW":
if (!message.member.hasPermission(["MANAGE_CHANNELS", "ADMINISTRATOR"]))
return message.channel.send(
"**error** You need the manage channels permission!"
);
message.channel.setNSFW(true);
message.channel.send("โ
I have set the channel to NSFW! โ
");
if (!message.channel.NSFW)
message.channel.send("**error** This channel is already NSFW!");
break;
}
});
and i have a channel called testing and its marked NSFW and my bot sends channel is already nsfw as well as set channel to nsfw? anyone know why? (bots response:
you're checking if the channel is nsfw right after you set it
so it obviously returns that message because you just set it to nsfw
ohH so i need to put the checking thing before?
I mean u could try
} else {
if (!message.channel.NSFW)
//rest of code
}
};```
I havent used `} else {` in a while so could be wrong could be right
Wait no it is wrong
Nvm
Ignore that then
is there a way to make the bot filtered all possible way of saying bad words like Dyno ?
because typing every possible words is a little bit tiring.
i suppose you could get like a internet pre-list of every bad word
and then paste that list into your not allowed words thing
@fickle arch https://github.com/zacanger/profane-words
oh god thanks a lot.
https;//discordapp.com/oauth2/authorize?client_id=NO_SPAM&scope=bot&permissions=0
what is scope?
@earnest phoenix I already put module.exports = require ("./words.json") but it still doesn't work.
download the npm package to already.
what is scope?
when you create your oauth2 key, it can be used for a whole lot of different purposes
thanks
it's lowercase though.
Discord offers these scopes. scope=bot means that that oauth2 key is used to authenticate a bot
u have if(!message.content.startsWith(prefix)) return; ? @fickle arch
yo
@fickle arch you should only ask for the permission your bot actually needs
what that mean ?
if(!message.member.hasPermission("ADMINISTRATOR")) {
const n = new MessageEmbed()
.setColor("#ff9900")
.setDescription(":no_entry_sign: **You don't have the required permission to do that!**");
message.channel.send(n);
return;
}
let rChannel = message.guild.channels.cache.get(args[0]) || message.mentions.channels.first();
if(!rChannel) {
const n = new MessageEmbed()
.setColor("#ff9900")
.setDescription(":no_entry_sign: **You need to specify a channel to do that!**")
.addField("Corect Usage", "lt!prefix [channelMention/channelID] [announce]");
message.channel.send(n);
return;
}
let ann = message.content.split(`${bot.prefix}announce ${rChannel.id} `).join("")
if(!ann) {
const n = new MessageEmbed()
.setColor("#ff9900")
.setDescription(":no_entry_sign: **You need to specify what announce do you want to make!**")
.addField("Corect Usage", "lt!prefix [channelMention/channelID] [announce]");
message.channel.send(n);
return;
}
const _ = new MessageEmbed()
.setTitle("**New announcement!**")
.setColor("#ff9900")
.setDescription(`${ann}`)
.setImage('https://cdn.discordapp.com/attachments/711268662048456785/713840607575015504/announcement-wordpress-plugins.png')
.setThumbnail(message.guild.iconURL({ dynamic: true }));
rChannel.send(_);
message.delete();
Why everytime a use the command the bot said that i didn't specify a channel even if i did
i did ask
just say your problem then
ok
111py
@bot.event
async def on_member_join(member):
with open('data.json', 'r') as f:
users = json.load(f)
await update_data(users, member)
with open('data.json', 'w') as f:
json.dump(users, f)
@client.event
async def on_message(message):
if message.author.bot == False:
with open('data.json', 'r') as f:
users = json.load(f)
await update_data(users, message.author)
await add_experience(users, message.author, 5)
await level_up(users, message.author, message)
with open('data.json', 'w') as f:
json.dump(users, f)
async def update_data(users, user):
if not f'{user.id}' in users:
users[f'{user.id}'] = {}
users[f'{user.id}']['experience'] = 0
users[f'{user.id}']['level'] = 1
async def add_experience(users, user, exp):
users[f'{user.id}']['experience'] += exp
async def level_up(users, user, message):
experience = users[f'{user.id}']['experience']
lvl_start = users[f'{user.id}']['level']
lvl_end = int(experience ** (1/4))
if lvl_start < lvl_end:
await message.channel.send(f'{user.mention} has leveled up to level {lvl_end}')
users[f'{user.id}']['level'] = lvl_end
this makes my other commands not work
but ^ it works fine with the exp
@old plinth-bot
@limber flume you need to add await self.bot.process_commands(message) at the end of your on_message block
otherwise it stops commands from processing
oh, and also you seemed to use a client decorator in one place, and a bot decorator in another place?
(also, just a little nitpick but for the level_up function there's no point in defining message and message.author because author is an attribute of message, so you can just pass message and still extrapolate message.author)
how to make 8ball answer to any of question >
i tried asking how are you but it said
ok
@primal slate now this happens
File "C:\Users\xdswe\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "bot.py", line 426, in on_message
await level_up(users, message.author, message)
File "bot.py", line 451, in level_up
function()
NameError: name 'function' is not defined
oh i did that
nvm
lmao
np ๐
u make me have best day
In discord.js: Is there a remove NSFW by any chance as ik there is setNSFW but i tried removeNSFW and it dosn't exist
@still merlin https://dbl.is-stinky.wtf/wmjixdpvys.png
you can simply use true or false for that
oh, so if i go .setNSFW false would that remove NSFW from a existing nsfw chat?
ok tysm
if the docs are correct tho 
it works tysm!
np 
if im using quick.db (yes ik its trash dont bring it up) why is my friend and i recieving this error
(node:29852) UnhandledPromiseRejectionWarning: SqliteError: file is not a database
@astral yoke delete json.sqlite idk why when you delete it, its fixing. (your friend's and your datas are there, so be careful about deleting)
ty
Hey can someone help with with extracting the invite link code with regex?
like after the discord gg and when it comes /<code> eg => "/dsadsa" But the message can be like
www invite gg/dasda hello plz click
@fleet mason u can split it, its not regex but its more simpler
yea, could work and i would have to split / and " "
we deleted it then reinstalled quick.db and same error @earnest phoenix
wut
tf was that?
ffs
if u wanna use regex imma try and find a way, otherwise its just 'discord.gg not a discord link'.split('/')[1]
there
@astral yoke idk then :3
XD
@fleet mason u wanna use regex or ^^?
ye
i can just use regex to test before then do that
Im getting a error in this code even when I put a semicolon in.
can someone help me please?
ok ty
I got it to work
let invite = (msg.content).split("/")[3];
invite = invite.split(" ")[0];```
boom
nice
@digital ibex i put it in and
what error r u getting
@still merlin )})}}) put it in end
wh
what the hell have you done how can it look like that
if you properly indent your code, you wont have problems like that lol
magic trick: right click -> format document
Hold up that exists
yes it does
Well im only using vsc for about a week now but how have i not noticed
it took me way longer than a week trust me
nah thats vsc
i was relying on eslint for too long
i never got eslint to work, it always screams at me that some dependency or config file is missing
im killing myself, i always went to beautifer io LMAO
How would I add a cooldown pre guild in Discord.JS i have done some searching online and couldn't find anything.
Example(User runs a command in a guild. Another user cannot run the same command for a certain amount of time in the same guild.)
a double map
check current time against the timestamp for the command
wait nvm yea it would probably have to be a doubled up map
is for users, but you can definetly apply the same way on guilds
Ok, thanks. I didnt see that when I was looking.
just change out message.author.id with message.guild.id
yep
There is a problem in Discord now?
I'm trying to get users from a message reaction, here is my code:
D.JS Version: v11.6.4
const channel = message.guild.channels.get("673268507999207479");
const msg = channel.messages.get("711062341097357422");
const reaction = msg.reactions.find(r => r.emoji.name === ":tada:");
reaction.users.array() // Output: []
reaction.users.size // Output: 0
reaction.users.length // Output: undefined
reaction.count // Output: 23 (23 reacted)
log reaction.users to console
upgrade
.fetchUsers();
upgrade
@pale vessel soon I will. It is problem because of v11?
no because v11 will stop working soon
thanks
client.ws.ping have fun
Little help here please? I am trying to get all the files in the parts folder into an array. The array is formed but parts.length somehow is undefined.
getting a ping is not that hard
so basically client.ws.ping returns the ping to discord from your client
you can implement that to display delay between recieving and sending
anyone using schemats for typescript? trying to generate a ts file, but i cant seem to generate it. And im getting this error when executing schemats generate
https://gist.github.com/ThomasAunvik/8f8c97615a325fc7d137d6d075275cba
-]
can someone help me with klasa i got error saying my "exported structure is not a class"
and i got this sort of error.
thats alot of random info you sent there
the class fixed.
What is music
what.
what is music
.

Are you sure msg.guild.music is a property.
only msg.guild.
then
oh wait.
how do you define your queue?
How do I check an arrayโs length if array.length doesnโt work? (JavaScript)
you can't
array.length does work
it doesnโt for me sometimes
wdym if array.length doesnt work are you sure its an array lmfao
then you're doing something wrong
i cant see shit
you mean the queue ?
you mean jsfiles.length?
@fickle arch you define guild.music somewhere, right?
neither jsfile.length or parts.length work
i also did Array.isArray(parts) and its a true
where do you define guild.music?
he does not define it anywhere i bet
at my join function.
???
@earnest phoenix when you console.log(parts, part, indexn), what does it say?
@earnest phoenix an array length cannot ever be smaller than zero, so no point checking if its smaller than 0
you're multiplying something by array.length, which if zero, will return 0, and if 0, the index 0 will be undefined anyway
@sudden geyser ["Zeta", "0โ]
i think i didn't define the msg.guild.music = music yet.
then of course anything under guild.music will throw an error
i need to adding it above it ?
it's big brain time
big copy time
msg.guild.music = {playing: true, ...whatever properties here} @fickle arch
maybe try that?
@fickle arch if guild.music doesnt exist, guild.music.whatever will throw an error, because guild.music doesnt exist, and you cannot get whatever from something that doesnt exist
by adding a bot to top.gg
@earnest phoenix read #502193464054644737
i already define it as const { music } = msg.guild.music = music but now it shown error about "Cannot access 'music' before initialization"
no u dont
because you're trying to access it
there is no such thing as msg.guild.music in the normal docs, unless you are assigning it before run(msg)
in the command handler for example
also { music } there makes no sense
because doing {music} = guild.music is exactly the same as doing music = guild.music.music
let me read the docs i'm kinda confused because my friend told me about this.
did your friend tell you to "copy this code"?
no he suggest me about the code.
isnt that the same?
is that the only file you only deal with music?
what have you added on startsWith?
You said your command responds to any prefix? then it would be something wrong with your prefix detection
sure, just send it in this channel
you never check if the message starts with the prefix
message.content.startsWith(config.prefix)
where you think it would be appropriate
did you write the rest of your code, or did you just copy it?
then it should be easy to find out
did you write without reading a guide?
just think like this
if message starts with prefix, continue the command, else stop the command and return
no, in your message event
if you read a guide, and used the exact code from the guide, then the answer was 'yes' ~ you did copy the code.
idk how he copied it wrong either
Does anyone know how to make bot commands case insensitive with discord.py 0.16.12 ?
can someone tell me how to install discord.js again i forgot
you could try lower()
i have node installed
@naive mantle npm i discord.js
i wanna install version 11.0.4
oh
@steel drum I just don't know where to put
also my node keeps giving me error messages when i download it
"bundleDependencies": false,
Array of package names that will be bundled when publishing the package.
Incorrect type. Expected "array".
@hollow basin when you're checking to see if the command exists
you could throw a (lower)
there
someone help
try placing an empty array?
LOL we all have brainfarts
ive nvr ran into this problem but just basedo n the error type and whats there
its been like months and i still only knew basics lmaoo
i think a [] should fix the problem
ok
id try googling around though
hes active here
lol hi
"bundleDependencies": ["false"],
its not giving an errror
also i just it
npm install
wait
i said
npm i node.js
i dont know the version
node --version
ok
i wanna install discord js version 11.0.4
and you want to install discord.js 11.0.4? why?
because a lot of the commands that i remember and that i was taught dont work in v12
or whatever
version
we are on
discord.js v11 will stop working in october
npm install discord.js
ok
When in October?
it will stop working when discord makes intents mandatory, and afaik they said they would make them mandatory when they make verification mandatory
i only have 3
but idk what they will actually do
index.js package-lock.json and node_modules
id recommend setting up intents while developing your bot
is it just those three? or
those are the only ones you need
but its generally accepted to break your code up among different files
for example, i have all my commands placed in a plugins folder so its much more modular and i have alot of globally used functions in a tools.js folder
is there a way to look at your copy history
like all the things you previously copied
or smthn
and a database.js folder for communicating with my database
not sure, thats something you should google
so i have this code right ```const { Utils } = require("erela.js");
const { RichEmbed } = require("discord.js");
var servers = {};
const ytdl = require("ytdl-core");
module.exports = {
config: {
name: "play",
description: "play a song",
aliases: ["p", "pplay"]
},
run: async (bot, message, args) => {
let premium = bot.db.get(premium_${message.guild.id})
if(!premium) return message.reply("sorry! This server doesn't own premium! Buy it today!")
if(premium) {
function play(connection, message) {
var server = servers[message.guild.id];
server.dispatcher = connection.playStream(
ytdl(server.queue[0], { filter: "audioonly" })
);
server.queue.shift();
server.dispatcher.on("end", function() {
if (server.queue[0]) {
play(connection, message);
} else {
connection.disconnect();
}
});
if (!args[0]) return message.reply("sorry. I need a link!")
if (!message.member.voiceChannel) return message.reply("join a voice channel!")
if (!servers[message.guild.id])
servers[message.guild.id] = {
queue: []
};
var server = servers[message.guild.id];
server.queue.push(args[0]);
if (!message.guild.voiceConnection)
message.member.voiceChannel.join().then(function(connection) {
play(connection, message);
let embed = new RichEmbed()
.setColor('RED')
.setDescription(`๐ถ Now playing ${args[0]}.`)
.setFooter(bot.user.username, bot.user.displayAvatarURL)
.setThumbnail(bot.user.displayAvatarURL)
});
}
}
}
}
anyone know why
oh
it kinda dosent send the embed
yeah im a dumbass
did you ever call play()
@astral yoke
if(!premium) return message.reply("sorry! This server doesn't own premium! Buy it today!")
if(premium) {
this is kind of repetitive
if the server isn't premium, the function will exit because of the return keyword
hi
yo
make them big
how
how can i create something like, {+role:role id} and it'll add a role to a user, idk if i'm making sense, so i like, {+role:123456789} and it adds that role
why not the traditional way of adding roles? (a method)
you can make a function for that but it would be pointless is it not?
i am typing the description to add my bot
and i want large letters
but idk how to do it
use capitalized letters or toUpperCase()
well, yeah. although i'm confused on something, so, i don't want to use only the ids, so i can also do {+role:@role}, {+role:name-name} and so on, and i'm gonna need a role resolver, which isn't hard. my one is message.channel.guild.roles.find((e) => e.name === args[whatever]
and with a cusotom command, when creating it its something like
;;cc create command-name command-response and anywhere in the command-response they can have it
so, idk which args its gonna be
which is the bit i'm very confused about
or you mean headers? use # for markdown and <h(1-6)> for html
you mean you want users to be able to add a custom command and have the custom command add roles?
yeah, if they want to add that
get the id from the object
i don't think the isue is the me giving the role, its just idk which args i'm meant to look for the role
i think the easiest way would be to define a bunch of placeholders
they can do ;;cc create command this is a test command which will giv u verified role, {+role:verified} or they can do ;;cc create command {+role:verified} this is a test command which will giv u verified role
oh
i really would avoid giving users the ability to add their own code to my bot ~ without first adding severe restrictions and limitations on the ccode that can be used.
for example ;;cc create addrole %ADDROLEFROMINPUT%
and you can simply define a bunch of those placeholders as building blocks for several functions
i'm not giving users the ability to add their own code to my bot btw
yeah
is there an easier way to do it without hardcoding it?
cuz my role resolver is kinda big and its just gonna get a lot spammy
looks for role name, id, name, names includes & its lower case
its not that big, only like, 4 or 5 lines
you can make all of that into a one-liner
||
yeah
thats what i do
lol, but the prettier extension i use makes it go onto a new line
i need help
it makes my code looks nice, thats y i use it
what do you need help with
guild.roles.get(arg) || guild.roles.find(role => role.name.toLowerCase() === arg.toLowerCase() || role.name.toLowerCase().includes(arg.toLowerCase()))
OH
When I go to the
https://app.invitemanager.gg/guild/701437690943504414/settings/joinMessageChannel
I donโt think that it is the people who enter by someone whoโs going. I want to put a rum so that all the rum does not appear to me, but some of them
@pale vessel
go to their support server
I never knew i can do args instead of args[4] or something like that, i was thinking of something like js const role = guild.roles.find((e) => e.name === args[2] || guild.roles.find((e) => e.name === args[3] || guild.roles.find((e) => e.name === args[4] || guild.roles.find((e) => e.name === args[5] || guild.roles.find((e) => e.name === args[6] and so on
i'm dumb lol
click the support server button on their topgg page
thank u tim
that looks bad lmao
yeah
@digital ibex i mean
if you have a bunch of different args
then, no you cant check them all at once like that
you need to check which of the args is supposed to be the role
and you need your command builder to identify that
oh
thats where i was getting a bit confused ๐คฆโโ๏ธ
would i need to use regex?
let the user define the command like this ;;cc commandname %datatype% %datatype% %datatype% for example, then resolve those data types to their position
no
if datatype is let say roleinput then assign that arg number to your role resolver
if data type is a channel input, assing that arg number to a channel resolver
lol, dont think your supposed to try promote your bot here ๐
and so on
oh
basically, what you're trying to do is quite complex
but there are a lot of ways you can accomplish something like that
wth for some reason my cronjob didnt automatically renew my ssl ๐ข
it would make these kind of things a lot easier :((
anyways, i'm going to try that out for like
the next couple of hours and see where i get to
thanks again tim
good luck
fml, and now my embeds arent showing the images from my site cause previoiusly the ssl was 'insecure' (out of date) :/
didnt you get an email about it?
do you use certbot?
yea i got an email saying it was due for renewal like last week, but not one saying it had expired. i didnt renew manually cause cronjob shoulda did it itself
yea certbot
why not use certbot's auto renewal instead of a cronjob?
if you get an email saying renewal is due, that means the autorenew failed
my certbot runs in a docker container, the cronjob launches container is all.
autorenew renews i think 30 days before expiring
they only send you emails like 1-2 weeks before expiring, it only gets there if renewal fails
interesting. idk you could just leave certbot running and it would auto renew :/
it does autorenew, but its not always easy to setup
i had to change my cronjob a couple times for it to work
everything i read when setting it up suggested i had to manually renew myself, and it was best to have cron do it for me ๐
like, cron launches the certbot container, which only renews the ssl and then dies for another few weeks
i dont use containers so idk how those are supposed to be setup
tbh its probably more hasstle than its worth if you already have a dedicated machine for things, but for making things easy to port to new hosts, its super useful
~ docker that is.
this is my sudo crontab -e:
43 6 * * * /home/username/certbot-auto renew --nginx-ctl /usr/sbin/nginx --nginx-server-root /etc/nginx --renew-hook "systemctl reload nginx" >> /home/username/cert.log 2>&1
lmao
oh, maybe lol
๐
Parmesan is online
my cron job runs this file:
which runs a docker container for certbot
which runs that certbot command at launch, then turns off again.
welp idk, never used docker before
ehh, its all good, it took 2 seconds to manually launch the container and have it renew my ssl
there are a number of reasons it could have failed atm tbh
the host its currently on is trash af
1core,1gb ramz. ๐
so the machine is constantly running out of ram and crashing lol
i've been rewriting the bot, and the database also, and havent bothered moving it to my new host till ive finished the changes, cause database needs migrated also
o0 wth lol
almost all of my ram is taken from my 1 bot
wth
83*
1gb for 80 guilds?
idk exact lemme see
Must be caching a lot of things
are you using fetchAllMembers:true?
Mine is 20mb with 18
atm 350 mb of ram for my bot
ah that sounds more normal
could be calculating wrong
It doesn't cache anything
calculating ram and processing power in node is a pain
Using java
JDA has options to disable the cache completely which helps lol
does discord js have options to disable cache? or would i have to change to something like your lightweight d.js thing @ tim?
there are my pm2 processes lol
there are some caches you can control
for example message caching can be controlled in client options
presences can be disabled by using intents
yeah its for the positioning thing
what do you use for a database?
sqlite
its on the same machine?
each bot has its own sqlite instance
interesting
on the same machine yes
Like schema? Or full instance
full instance
hell, my mongodb container uses almost as much ram as your entire bot when its been sitting idle for a bit ๐
isnt mongodb configured to use like a minimum of half the machine's ram by default?
mine has never used that much lol
yea im thinking the ram must be from some sort of cacheing
ooft
12
that is excessive af
lol
tbf, mongo is used by some big companies running some big data
well, mongo is designed to be a primary remote database which is supposed to be sitting by itself in a single dedicated machine
hhhhhhh
yes, except sqlite
xD
man
ive never looked much at sqlite, whats the benefits of it compared to regular mysql?
this is why i would like to stick with sqlite
its faster as its on your hard drive
sqlite is designed to be used on a per-app basis, built into the app's process
there is no connection, no remote, no server
o0
interesting
so its basically just a module for writing to and getting data from files?
arent all db's like that?
yes, a stupidly optimized one
or am i be bad
pretty much most dbs are like that
its all about indexes and caching hot data in memory
yea all db's do that in some way, but how they do it is what makes the difference
which they have been perfecting for decades
nah i still be bad
tbh sqlite is probably a better option for a discord bot
yes, unless your bot grows into multi-machine scale
i wanna use mongo but im not cool enough to understand anything like dbs on different servers so 
im just so used to using mongo now so i'll be sticking with it ๐
you can limit its max cache size
tbh im probably still a total mongo nub ๐
ahh nice ๐
i know but i feel like im not doing things the optimal way
ty โค๏ธ
but whatever i'll just
i was planning to look at the wired tiger stuff when im moving to my new host as whenever i build my container is gives me warnings about the wired tiger engine and w.e
fuck its already 3am

