#development
1 messages · Page 1636 of 1
anyway thank you all
use replit lol
link?
0_0
thank you 🌸
here's a pro tip, make a template in photoshop that has circles cut out, then create an image layer in your code that places square avatars in their places and just put your template on top of that
ezpz
less processing and less struggle
i did that when i had my bot
the only thing generated here is the avatar, text, amount of coins and the coin image
the rest is just a template image
You can just clip it on canvas
CRY'S BALANCE
just to cry on
excuse the horrid design this was 3 years ago 😔
weeb
hey, how do i make certain commands not workable on certain servers?
I was thinking about if(message.guild.id == id){ return};
would this work?
Yeah, but you should make sure message.guild is not null and prefer === over ==
If it's going to be a collection of servers, you can have the server IDs in a collection (like an array) then see if the current server ID is in that collection (e.g. [1, 2, 3, 4, 5].includes(guild.id))
aha so strict checking. Okay thanks!
No it's only 1 certain server that needs to be excluded of command usage
let bannedservers = ["id1" , "id2"]
if(bannedserver.includes(message.guild.id)) return;
Then the if condition is suitable
aha thank you guys!
uh.. not sure if anyone remembers.. so i'll start from the top.. with the constructive criticism of (100% of u when i talked about this first), i think i am AT LEAST closer to being able to hide client side script
if u doubt, https://hidejs-example.paultaylor2.repl.co/ it's still in a sketchy phase where you have to ALLOW POPUP
Youre gonna hide the code in a popup? Xd
why does my db save it as
"true"
instead of
true
db.set(`premium_${user.id}`, true)```
it saved as "true"
which results in errors
witchery i guess
Weird
you should probably take a more OOP approach with your database
instead of doing that
wym
also btw if i detected true as:
if(thing === "true")
would booleans suffice
or otherway around
if(thing === true)
would "true" suffice
instead of having an entry for every single property of a user, have a user id linked to an object. this will grant you type safety
db.set(user.id, {
isPremium: true,
coins: 6548949,
gay: true
});
db.get(user.id);
/*
returned:
{
isPremium: true,
coins: 6548949,
gay: true
}
*/
quickdb was built for this kind of structure, it even allows you to access object properties via dot notation
db.get(user.id);
/*
returned:
{
isPremium: true,
coins: 6548949,
gay: true
}
*/
db.set(`${user.id}.isPremium`, false);
db.get(user.id);
/*
returned:
{
isPremium: false,
coins: 6548949,
gay: true
}
*/
people really need to start taking cs classes
Yep
yall need to learn to structure your databases
"why would i drink out of a cup when i can just put my mouth on the tap??"
db.set(user.id, {
money: 1
});```
would this work
cuz if not then its essentially the same thing as
oh wait
nvm
i see
alr ill switch to this
but
is there a way to like transfer all the values
or do i have to manually write
i don't think so, you'll have to either manually transfer it all or write a piece of code that gets all the values from your db and sorts them accordingly
ill just manually do it
cuz
all of it is
like
money_userid, value
item_userid, true
so itd take ages regardless
what's the limit of messages i can fetch in a channel?
100 per request
so i have to make lots of requests if there is more than 100?
wait but
let money = db.all().filter(data => data.ID.startsWith(`bank`)).sort((a, b) => b.data - a.data)```
how would i change this
correct
to fit the new structure
let money = db.all().filter(data => data.ID.startsWith(`bank`)).sort((a, b) => b.data - a.data)
money.length = 25;
let finallb = "";
for (var i in money) {
finallb += `**${money.indexOf(money[i])+1}.** <@${money[i].ID.slice(5)}> - \`${money[i].data}\`\n`;
}```
a leaderboard
that displays values
from top to least
aight thanks
top 25
hey
but im unsure how exactly to fetch each user id's balance and then order it like i did there
r u using mongo
same like you did there, except data is going to be your user object
if you log data you'll get
{
money: some number,
...
}
i'm going to take a shower lol sorry
but anyway, don't be afraid to play around and experiment with your code
im gonna transfer it tmrw and see if it works then
i don't get what is up with so many people being afraid to try code and gradually fix it if it's buggy
i mean, welcome to development honey, that's what it is
trial and error
people thinking that failure is bad LOL
May they are worried about it may explode or if CTRL + Z isn’t working anymore
failure is great. some of the days i learned the most i failed the most
:)
it works tho doesnt it?
Hi, I recently tried to change the preview of my bot page. The problem is that when I saved the new code, the page wasn't completely displayed as it should have been when I looked at the preview, the whole page was displayed correctly.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I get an error saying "Cannot read property "send" or undefined."
log your message in the command
or like we talked about yesterday, make sure the order in index, and the commands execute function are in the same order
the order of the passed values
uhhm whatt happened?
iscordAPIError: Missing Permissions
3|index | at /root/AwsomeModeration/node_modules/discord.js/src/client/rest /RequestHandlers/Sequential.js:85:15
3|index | at /root/AwsomeModeration/node_modules/snekfetch/src/index.js:215 :21
3|index | at runMicrotasks (<anonymous>)
3|index | at processTicksAndRejections (internal/process/task_queues.js:97: 5) {
3|index | path: '/api/v7/channels/722352240203137081/messages',
3|index | code: 50013,
it has no post messages permissions?
It just happened after restart the bot
umm how do i fix this
don't copypaste code and actually understand what you're writing
the error says lock.js not unlock.js
god i hate that combo
you would expect mac users to be rich or at least can afford a proper hosting
i just don't like it
you forgot the third secret element
white theme
Anyone got any idea why my bot says there's 56 members in a server while there's 53?
[link text]([#support message](/guild/264445053596991498/channel/714045415707770900/))
btw how to make this work?
put it in an embed description/embed field value
must use bot?
i see, thanks
Hey
I think it is..
and in the index 👀
alright, try logging message in the command itself
what do u mean in command again?
congrats on trial mod
ty
just above the const embed line, below the execute line
so that it runs when you run the command it logs it
👀
it's meant to do that
quick question, I'm trying to make a bot that detects nsfw messages is there any way to detect them?
im trying to use if message.is_nsfw():
but thats not working
im using discord.py
i don't think that's a thing in discord.py
yeah
U have to make a list of blacklisted words
^ and check them in the message event
i was thinking that but i thought i would just check if this server has any answers
Thats the way through
tldr there is no easy way
there are libraries that try to do that
You can search them up on pypi youll find one
can u send the stack error
i thought discord auto-tagged messages that it thought was nsfw but i guess that's not the case
it depends what you classify as nsfw, if you're aiming at profanity you should just give up now before you rip your hair out - any profanity filter can be easily bypassed on discord because discord allows the full unicode charset
Nop, i mean they do check images but not sure if that's in the api
i agree
And u dont have to check for that if discord automatically detects that so yeah
it all works now
ok great 👍
Is there any other way to check that kind of messages?
generally, no
such filters are only effective where services allow characters like a-z and shit
Yeah i see
discord allows the full unicode charset which has around 143k characters
Dang
so you're looking at 1900^143000 minimum possible combinations to bypass the filter
Damn crazy
yeah, but when you think about it, a profanity filter isn't really... needed per se
discord is a 13+ service
True
Is this allowed?
sure
if that's yours god you need to clear that up
the wording is messy and unprofessional
takes a while to understand
What about the 18+ users that sent nsfw words really bad bad words that's not for 13+
penis?
there aren't 18+ words
in fact, there aren't any... age rated words
words are words
The p word
Don't you understand those 18+ (horny) who sents a 18+ videos link or that website that you will never go to it
porn? lol

again, words aren't age rated
Ahm
Can you please answer my question ^
i did
He said yeah
well, yeah, you can bypass links, but there's only a single way links will show up and be clickable in discord, so it's easy to make detection for them
I meant block
if you attempt to bypass link detection, you'll transform the link in one way or another, it won't be clickable anymore
Yeah ik
links don't have context, it's just a simple structure that a computer can understand
understanding language and detecting bad words is a lot different
so if you ask me, link filter + optional api for nsfw image detection
the rest is useless
Yep
how can i show users that match the query.
m.bot.guilds.cache.forEach(x => x.members.fetch({
query: metin
}))
kullanıcı = m.bot.users.cache.filter(x => x.bot &&
x.username.toLowerCase().includes(metin.toLowerCase()))
.map(o => o)
.slice(0, 10)
im doing something like but it doesn't work
what is m?
message
no
message.bot = message.client 🧠
yeah
it is caching but the command does not work. The command works on my second try.
hey, so I have this blacklist and im working with databases. My blacklist/antiswear is working perfectly well, but waht isnt working is my database. its not recording how many bonks (swears) have been given, any reason why? Please ping me if you know whats up! https://sourceb.in/4jCoHhf4ct
and i do have const BonkData = require(./models/BonkSchema.js)
how do i make my bot online 24/7?
Host it
how tho
I use heroku
and then its on 24/7
Yeah
@flat fog do u have to pay for it?
Not with heroku
Yeah
free is all that matters at this pt
Add a credit or debit card and it's 24/7
ill do what I do rn
if you have a credit or debit card
at that pt it aint free
at that point you might as well be using it
honestly
sites like vultr have a really cheap vps option
like $5 a month
or even less
Ig
@flat fog can u help me
yeah good luck doing literally anything extensive on heroku
ifk how to do it
have you tried googling it
yes
heroku was no help
are you sure
LOL
i couldn't find out how to use it
just mute him bruh
it takes time to learn how to use heroku.
only then will he go and actually read stuff online
Watch the videos
it's really hard to tell you how to do this without literally spoonfeeding you everything
would i have to do it from github?
How to host your discord bot for free using heroku. This tutorial shows you how to host your python bot for free using heroku services. We simply need to setup a few things to heroku, upload our code and turn the bot on!
Text-Based Tutorial: http://techwithtim.net/tutorials/discord-py/hosting-a-discord-bot-for-free
Heroku: https://heroku.com
...
bruv
idk that was the first result
unsubscribed disliked
is that the real tim
is that the free replit hacker plan code guy
its budget tim
Well im not the one with a youtube channel xd
but you’re the better one
xD
rate limit go brrr
Rip
!rename tim budget tim
One message removed from a suspended account.
g
can someone help me to stop duplicating money whenever im trying to withdraw or deposit
https://cdn.obamabot.ml/u/DqOtVLn.png
if(isNaN(args[0])) return msg.reply('This is not a number');
if(args[0] <= user.moneyBank) {
user.moneyBank -= args[0];
user.money += args[0];
user.save();
return msg.reply(`$${args[0]} Has been withdrawn to wallet, now u have $${user.moneyBank} on Bank`);
}
else {
return msg.reply('Don\'t input more money than u have');
}
this is the withdraw command
h
args is undefined
Check how you called the function
guys
The bot sends me THIS:
when the code is THIS
Why does it not add thoe fields?
Too many I would assume

so
you probably need to make a paging system
I just add onather addFields( )
pagging?
like ++help fun?
I tryed
didnt succed..
then whats pagination?
Example
(Wait for reactions to appear)
o
like so
I press on the reactions, no response
yea it is
Kekw
If I was self botting I wouldn't be here.
same..
But regardless.
I already got banned ones so I dont even wanna try cuz.. there will be no way back.
Related to the issue above. You really need to study discord.js docs and in general JS. I'm prettttttty certain things like the amount you're allowed to have is easy to find. Even a quick google would specify that.
Iirc, limit for addfield is 26
😦
Ah 25
d.js didnt even gave a shit about it and just got rid of them on message without even like... telling me
or pagination
nope..
yep.

^ categorization (of a different form)
But I dont wanna do ++help [command], and I WILL need to do that if I do that..
it's not ++help [command], more like ++help [category]
If u want the descriptions of the commands yes u will need to do that.
^
But in general.
Here's a thing
Since I see you ask alot in here about things that seem out of your reach.
Not everything is made using discord.js

categorizing and paginations will use some bits of it, but in general it's a JS thing
so learning JS is a plus
wait
learning d.js != learning js tbh
^^^^^^^^^^^^^^^^^^^^^
I kinda do know some of JS it self
yes
that's not learning
Then stop watching videos
no one said you have to
LEARN the langfuage
best way to learn coding is just doing stuff
^
e.g. pagination
I AM.
ok, then don't be unhappy that you can't do something
because that's what learning is about lol
im not lol
Learning a language like JS and coding

is not asking why a thing doesn't work every time it doesn't.
it's figuring it out yourself
and learning from the mistakes
I did..
thats why u see me here ones a day
and not 25 times an hour like it was a month or so ago
I do recall someone mentioning your passed name doing the exact same thing for quite a while.
not really.
...
so
I don't know JS and can make it np with JS
i think instead of us bashing on someone here
Im doing it for months now and u telling me this?
let's be constructive instead
now, if you had to code the actual ban thing without discord.js, then it'd be hard
but that does sound fun
So im having trouble depositing a specific amount to my bank
as shown here
https://cdn.obamabot.ml/u/68joLnX.png
if(isNaN(args[0])) return msg.reply('This is not a number');
console.log(user.moneyBankSpace - user.moneyBank);
if(args[0] <= user.moneyBankSpace - user.moneyBank) {
user.money -= parseInt(args[0]);
user.moneyBank += parseInt(args[0]);
user.save();
return msg.reply(`$${parseInt(args[0])} Has been transfer to bank, now u have $${user.moneyBank}`);
}
else {
return msg.reply('U dont have money that kind of money to store at your bank');
}
has u see one of the lines that console.log ive gotten this
3005
i'm fl0w.
Ah hi fl0w
me?
is this your deposit command?
uhhhhhhhh

yes
if(args[0] <= user.moneyBankSpace - user.moneyBank)```
for a... while?
i think this is the issue @earnest phoenix
if you're depositing user balance to bank, you should check args[0] to user balance
not bank balance
for... months?
so
I think as a common practice among programmers
It's rather a mutual sentiment that you test things on not your own, and not only this, but regularly refer to docs before coming to a development channel, correct?
but i also dont want the user to put more money than there bank limit
I think people are a little more irritated about how you've opted to this channel instead of trying to necessarily tackle things on your own if that's the right way to word it
Hence why some may seem riled up about you talking in here
Another thing if I may add.
There were passed things about ignoring actual help and avoiding questions sorta like the cat thing
I test my stuff.. and copyed SOME codes but most is mine, and I do refer to docs. Often....
Are you a beginner to d.js?
But I do want to point out.
Sirius Black

well... If you say months isnt a lot then ya
well, the thing is
just because you spent months on something
doesn't always mean you're good at it
tho I took a break between ..... big one,, so kinda forgot smt stuff
so it definitely varies
Indeed.
true
like i've been doing python for about 5 years but i still use .json as a big-scale database

.json dbs 
Well,
Being a JS programmer for months and working with the d.JS API wrapper for "a while" are two distinctively different things.
i still dont understand
When i started with discord.js it took me several days to figure out how to send a message to a different channel
basicly if theres anything after it..
oh... Well... It took me hours sence.. I DID use discord.js guid..
and still use it sometimes today
The guide was not as good back then
I've known Python for over 6 years, but that doesn't make me good at it

And quite honestly i sucked at js back then
so from what i can see, you're depositing user balance to the bank.
but for some reason, you're checking bank balance instead of user balance.
i think that's why you're getting that error
What I have currently gathered as a consensus Smug
is that you've been given help numerous times and recommended to check out docs and debug things on your own accord
but supposedly you go against that advice?
bro
Were you here a week ago or smth?
I was here like every hour
now im here rarly
and I do go to dos..
I just got unbanned 2 weeks ago.
o
well I mean.. I was banned for few months as well...
oops
I'm curious of why
almost a year
LMAO
im checking bank balance and bank space
so basically
if the user is trying to deposit more money than what they can have on there bank
Xd
u saw noithing
um... dont look it up
That's where it kinda became a thing.
ah so you want to do this
- check args[0] to user balance, make sure they're not attempting to deposit more than they have
- check args[0] with an and statement to see if the deposited amount is not greater than bank limit
it's a 2 parter
but you only have one part of it
Okay
good luck
Well it's the first but just come to mind.
Bec I was there 
Is there a way we can accurately prove "growth" by how they ask questions instead of the amount asked?
Messages over time is not an accurate method of determining progression of grwoth.

By some statistical means of analysis it could be possible
today I solved like 40 errors..
Did you actually count that many errors you fixed
possibly
Or did you just pull that number off the top of your head
no
¯_(ツ)_/¯
I was fixing them for like past 2 hours..
How many of those errors did you also create? xD
Did you actually watch the time that passed
Or did you just pull that time off the top of your head
there's 99 bugs in my code
there's 99 bugs
fix one bug and patch it out
there's now 101 bugs in my code
Wasnt it 127 bugs in the code
im not sure, im pretty sure it literally overflowed
Or some stupid number
lol
bug overflow
i will see thanks
xD
just have a 2 bit number for your bug counter
im surprised stackoverflow hasnt just rebranded to that yet
👀

so this is what i'm getting:
- you used to be very ignorant about d.js at first and opted to only here after watching some YT tutorials
- you were given advice and help on numerous occasions to help with said problems and made steps to grow but kept coming to here
- you now have some disputable "experience" under your belt with d.js and JS respectively, but come to #development asking questions arguably answered by using common sense. (ie.
createObjectneeding an obj/creates one.)
ie create a 4 bit number
I'm going to then say that you are in some way growing and/or progressing in the right direction, however, most if not all of that growth is being fueled by... #development .
- you used to be very ignorant about d.js at first and opted to only here after watching some YT tutorials
no.- you were given advice and help on numerous occasions to help with said problems and made steps to grow but kept coming to here
At some points, yes, but I still read the docs, and checked the links people sent me!
A wrapper class i guess
hm
guys one sec, ill be back later.
stupid method i know, but could you map numbers inside a js number?
ie first 4 bits are x
next 8 bits are y
next 8 bits are z 👀
almost like managing memory at that point, and totally terrible but 🤷♂️
bit wise of course!
bitwise logic is nice. Discord does a pretty good job at providing an example, but it's starting to get to the point where they'll overflow the JS max safe integer which is why they're switching to strings which would require BigInt logic
Bigint would kinda be better for bitwise
Bitwising bigints is 500x slower than bitwising numbers
But strings are 2000x slower
Does bitwise logic against strings coerce the strings into numbers first?
Ye
You need to go back and forth
You need to string split before converting to number
To avoid overflow
yikes
Bitwise only supports 32 bits
Not even the full js 52 bits
Any number bigger than 32bit will be truncated when bitwising
But bigint bitwise has no limits
Its just slower
The time consumption is negligible
wb
?
no pagation
man i hate pagination
i got it to work with my bot and never again am i touching it
I hate it from the using perspective
Pagination
It is nice, but requires one hell of mind computing to make it work properly
Icarus KuuHaku pagination system when 

Working with it myself, not a fan 
I mean, we can try to migrate to p-utils
I think Dwight had "some" issue with it conflicting. Idk what tbh but something
But certainly an idea I'd be down for.
Will talk with him later to see if it's viable
Tbh I was joking but tbh we don't have a "system" i don't belive since our stuff is different for the task at hand

Tho ur stuff likely will resolve our reaction issue
We did try to do more work on it yesterday poking around with commenting things out, trying it differently.
Icarus really really hates emojis appearntly.
can u chat here for help about discord.js etc?
cause just incase anyone needs help
ill try my best

wait nvm sorry my bad
bot.roles.fetch('811732497472684032').then(role => {
console.log(role)
})```
anyway to fetch a role by its id directly like this?
guild.roles.fetch works, not sure if you can do all roles though
Within the next 2 weeks I reckon
ight
thanks
why use =>?
because it doesnt require you to cache the role as it pings discord's api for the information
or like javascript in general?
wot
r u talking about this lol
hi everyone, I made an npm package that generates the basic structure of a discord bot using discordjs library, I based it on the discordjs.guide website, please let me know if this is something you'd use, what could be improved, bugs, anything at all, it's my first npm package
https://www.npmjs.com/package/create-discordjs-app
feel free to ping me or dm with any feedback you may have
wdym it is called log.js
@tall flame make sure this is off https://woo.pics/images/fd4b039aae.png
@solemn latch is that on developer portal?
yeah
It does say mention
@craggy pine = mention | 160679942319767552 = id
but its shoud work also with id
@solemn latch and 1 more question, how can i verify my private bot?
private bots dont need verification
https://scs.twilightgamez.net/3F9vV.png wouldn't this imply mention
i don't see by id
after the ||
gotcha i see it now
private means only i can add but we need to verify coz people's think verified bot are safer
well, verification isnt possible for private bots.
so why is this not working?
like u want to add in ur server for test right
we dont handle discord verifications, which is what im guessing your asking for.
I don't know JS well I just didn't see the id part of it. I'm not a good person to ask. Apologies.
Ohh lol i thought this is discord verification, Im dumbest
thx anyways
is this in a try catch?
heres the discord dev server if you need help with it. https://discord.gg/discord-developers
or the link i posted above
is args[0] !m or the user id?
I think that'll just give you an error like "cannot get X of undefined"
the user id
what exactly is anime search
Like .search death note
like looking up anime info from name?
Yes
you can use an api or some npm package
Which api
explore man 😔
wikipedia might have a good api
be careful with some anime api's. lots of animes have nsfw cover photos, easily can start sending nsfw stuff in sfw channels if your not careful.

(hm idk python sorry maybe someone else might help)
Np
@dark crest
try {
let tomute = message.client.users.fetch(
message.mentions.users.first().id ||
message.guild.members.cache.get(args[0])
);
} catch (error) {
message.reply("please mention a user");
}
this will get the user mentioned or by ID, but absolutely put it in a try catch
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')
client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
if (oldMessage.content === newMessage.content) return;
const data = await logs.findOne({
guildID: newMessage.guild.id,
channelID: newMessage.channel.id,
MessageUpdate: true
});
console.log(data)
if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
const embed = new Discord.MessageEmbed()
.setAuthor('A message has been edited!')
.setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
.setColor('#FF0000')
.addField("Edited by:", oldMessage.author.tag)
.addField("Edited in:", oldMessage.channel)
.addField("Edited at:", oldMessage.createdAt)
.addField("Before:", oldMessage.content)
.addField("After:", newMessage.content)
.addField("URL:", `[Click Me](${oldMessage.url})`)
.setTitle('Message Edited!')
.setTimestamp()
client.channels.fetch(data.channelID).then(c=>c.send(embed))
} else {
return
}
})```
um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
wow
no wonder
i did console.log(data.guildID) and it sent that^^
how to fix it?
first, bad, second, bad
first, each message can only have a total of 6000 characters, and each field can only have 2000
second to that, addFields() is a thing
you arent checking for any of that
also by default discord.js has channels cached
no need to fetch it with requests
that wont scale at all
also you're checking if data was returned, but you are not checking for anything inside of it
yeah
not sure about footer
Time to dig up the good ol' R.Danny tag
the general rule is 2000 per field, with a total no longer than 6000
imagine removing the bot that literally did the same thing

even less for the other fields it seems
so yeah, that wouldnt work at all
it'd break easily on large messages
that command is full of holes
you also arent even checking if the fetch was successfull
Was looking through this and I'm confused why this is an npm package and not just something hosted on GitHub where people clone. npm is usually only for peer dependencies; Not a module with no exports or interface.
Next, I read the index and I liked the usage env vars.
What I didn't like was the fact that you assign client.commands to an instance of import("discord.js").Client instead of extending the Client class and using that. Arbitrarily assigning values to instantiated Objects is not type safe. Users who use TypeScript or VSCode's implicit project type checking (CheckJS) or any other editor which has TypeScript based static type checking will run into errors where there will be an error stating that client.commands does not exist. This is almost non-negotiable as static type checking is something a lot of people use/should use.
I then checked the commands folder and was immediately gravitated towards the reload command. I don't think you were effective when it comes to memory management, since simply dropping the require cache and re-requiring the file is not good enough. Timers which are instantiated from a reloaded file will keep ticking. Chances are that users won't provide references outside of that file either. listeners may also stack. Adding an EventEmitter which emits dirs to reloaded files so that users can unreference timers and listeners is crucial.
That's all I bothered to look at
Woohoo I'm doing weird stuff with guild data


at that point you're much better off using detritus.js which handles all that internally
commandClient handles everything for you
I like lower level interfaces
ratelimits, parsing, custom prefixes, literally everything you need
just take a single look at what detritus offers
this is just per command, everything is optional
you have more options on the handler itself
its all neatly done
and its hard for me to praise something
Hey Erwin,
You used eris before?
nope
oof
only d.js and now detritus
Seems rather bloated for my use case
and after detritus, i dont plan on moving
Was wondering if you would know if I could change whats store in presences in eris to lower ram usage
its an all in one lib
Just took over shiro so am handling 20k guilds now
i would recommend not caching it at all tbh
detritus has cusomizable caching, not sure about eris
I might look to see what might require presences
if it doesnt need it I'll disable the intent
um, not sure about your 1st point, I decided to do it there because that's what create-express-app and create-react-app do
about the client.commands, that's what the official discordjs guide uses that's why I went for that, as I never use typescript I was unaware of it, I refuse to use it but I don't mind fixing it so typescript users don't find issues there, tho I'm not sure what the fix would be for that
as far as the reload command goes, I did not understand a word you said, again, that's what the guide uses, but as I am including pm2 there the reload command is just not even necessary so I think I'll simply remove it
thanks for the feedback
I havent used d.js in fucking forever
because eris-sharder took over my life for like 3 days
running shiro on a devOnly instance rn
and even with everything cached
its using like 2.5GB ram
for 20.3K guilds that aint bad
what??????
i read
i did not understand
and whatc exactly did you not understand?
eris-sharder is near the same btw
detritus would probably save a little bit more
but tbh we dont need it
Shiro used to use 16GB of ram
so 16GB -> 2.5GB is uh
yes
everthing
like nothing was related
then you arent ready to make a discord bot
i felt
what we explained what quite simple
bruh i have made many cmds and it is also verified
sooo yea......
you are lacking basic js knownledged
Like I mentioned previously, I like lower level libs. I moved to modular interfaces for gateway, rest and caching is almost finished being handled in Postgres as soon as I can bring myself to write an event processor.
I'm all for libs which do insanely good memory management out the box, but I like the granular control I have currently.
Working on finding out how to make less of a memory footprint in my apps.
I've learned a lot. Suffered a lot. Perhaps I enjoyed the suffering.
like thats anything to brag about
if you're pride is that arrogant that you're willing to refuse help based on oh my bot is verified, you shouldnt be asking for help
LMAO
not remotely close
eris usually is compared to d.js
if thats the case, it doesnt come nowhere near detritus
Also, I'm trying to make a lib which handles JSModule/npm module reloading and methods to add temporary listeners/NodeJS.Timeouts
Object.assign is stronk.
Manually managing references and ensuring results are synced with peers is frustrating.
do not crutch pm2. pm2 is actually garbage if you're watching for file changes. You can EASILY retain years of uptime with updates if you know memory management well enough.
uptime is very important
if you wish to use file changes i would say to use nodemon
even though i particularly despise it
im personally using a custom forever script
and my monitor is via my dashboard
I wouldn't even want a module to trigger my app to restart if a file changes. I have no use for it since I already have something that manages module changes
so what then? any actually good package that does the same than pm2?
fs.watchFile is good
right but this is aimed for less experienced people who just want something to work out of the box not for someone who has a whole process for it already
so is pm2 good enough or what else can I do instead of that
How long is a user in that stage, though? What happens when general user base becomes more knowledgable? Would you want them to regard your software as useless down the line
Totally not biased or anything here. Objectively, I like this https://github.com/AmandaDiscord/Reloader
not really, eris doesnt have an issue thats been open for a year and 8 months to fix a bug causing ratelimits


legit tho, take a look at detritus if you're worried about scaling

Nah, not worried about scaling at all
detritus pog
considering rn ram is stable and thats will caching everything
not only for caching, but for future proofing as well
see all the reload commands they are talking about?
yea
I built that myself already
i've build rolling restart and a load more too
so
detritus is this
commandClient.clear(); //clears all commands
commandClient.load('./commands/',{subfolders:true})
this is it
it handles everything internally
including subfolders
and categories
show it the path it needs to load the commands from
and it'll import it
no idea, I mean unless you're actively looking for this type of stuff I don't think they'd ever learn that, you start caring about all of this stuff when you're actually hitting ram limits or whatever, but 99% of people making bots won't be in 30k server like y'all
was wondering why chat is all about api wrappers and found out this was in development lul
one line
instead of lenghty command loaders with require() and cache deleting
cleaner, better and lighter
I wonder if NodeJS.Module has peer deps listed
this is the reload command i have
import { BaseCommand } from '../commandBase';
import { Command, CommandClient } from 'detritus-client';
import { Permissions } from 'detritus-client/lib/constants';
import { config } from '../../index';
export const COMMAND_NAME = 'reload';
export default class MainCommand extends BaseCommand {
constructor(client: CommandClient) {
super(client, {
name: COMMAND_NAME,
permissionsClient: [
Permissions.SEND_MESSAGES,
Permissions.ADD_REACTIONS,
Permissions.EMBED_LINKS,
],
metadata: {
description: 'Admin reload',
examples: [COMMAND_NAME],
type: 'admin',
usage: `${COMMAND_NAME}`,
},
});
}
async run(context: Command.Context) {
if (
!((config.WHITELIST as unknown) as string[]).includes(
context.message.author.id
)
)
return;
context.commandClient.clear();
context.commandClient
.addMultipleIn('../src/commands', { subdirectories: true })
.catch((...e) => console.log(e))
.then(() => {
context.message.reply('Reloaded');
});
}
}
Now I'm inspired to get back to work on Reloader
the only important part is this
context.commandClient.clear();
context.commandClient
.addMultipleIn('../src/commands', { subdirectories: true })
.catch((...e) => console.log(e))
.then(() => {
context.message.reply('Reloaded');
});```
tfw system has a user ID
"643945264868098049"
never said it could
I want #0000 tho
Ik. I went for next best thing. 0110 is 6 in binary
if i recall
lets see if i can find a source
i recall some idiot that legit made thousands of accounts to test discord's generator for discriminators
and there were hundreads of them that couldnt eb generated
That defeats the purpose of 0-9999
you cant get repeated numbers n a lot of shit after a major update
I couldn't think of any reason why they'd reserve them
1111, 2222, 6969, 3333, 9999
they ARE reserved
its been confirmed
im not sure where the data sheet was
for Nitro? Because you can definitely change your discrim to those
no, for normal generated accounts
no matter how many you gen, you'll never get reserved tags
some of the ones i posted above are examples
i was a huge talk a couple years back, someone made thousands of account and got data based on all the rolls
Never heard of this experiment before
yeah
i'll try to ask on dapi
thats where i got the source from
but its been a few years
like the old 1337 discriminator
Like some fancy ones
i dont think you can get that anymore
One message removed from a suspended account.
Prob og accounts
@sage bobcat do you have the source? ive been looking but i cant find it
iirc b1nzy has it
Why is 1337 important?
One message removed from a suspended account.
1337 is before we had discriminators
ok so I'll extend the class for the client.commands part, and removed the reload command, and I'll also remove pm2 and instead I can use the one you sent "Reloader" to watch all the files and reload like that right? @lament rock
so they all were default to 1337
that means you're basically 5 yo account
Can't u get it with nitro?
Not default?
but im talking about normal generation
It's impossible?
The lib I linked you was just something I work on. You don't have to use that one specifically, you can base work off of it since the license is MIT. Some of what it has to offer is mostly what I would look for in a lib which manages stuff for you. If the goal was to handle rate limits, restarting an app goes towards your gateway identify limit which isn't good
UNLICENSED is usually for non-permissive proprietary software. That's not what I'm trying to distribute.
when i start the bot it looks fine but if i dm him i get this error
PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master> node src/index.js
Starting Modmail v3.3.0 (1047528) on Node.js 14.15.4 (x64)
Loading configuration from config.ini...
Configuration ok!
Using an SQLite database:
C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\db\data.sqlite
Preparing plugins...
Connecting to Discord...
Connected! Waiting for servers to become available...
Initializing...
Loading plugins...
Loaded 16 plugins (16 built-in plugins, 0 external plugins)
Done! Now listening to DMs.
Error 50001: DiscordRESTError [50001]: Missing Access
at RequestHandler.request (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\rest\RequestHandler.js:61:15)
at Client.createMessage (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\Client.js:550:36)
at Thread._postToThreadChannel (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:101:25)
at Thread.receiveUserReply (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:405:37)
at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\main.js:168:9
at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\queue.js:10:9
PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master>
ok so what do I do? all I want is to have the option to reload the bot whenever there's a change, so that I don't have to kill the process and restart it
or I guess I'm fine with that in dev enviroment but I'd like to have something that restarts the bot on push to my github
for when I put it in a vps
good night, does anyone know how to make a vote checker for me to give prizes to whoever votes for my bot on the site?
so I guess I can just use github actions and do some shit there
if you want to require a file at a later time and then sync the result to a reference on change,
you'd use reloader.watch(path)
then require the module normally,
then reloader.sync(path, referenceObject)
if you wanted to just watch a file and have it auto get required and don't care about casting to a reference, reloader.watchAndLoad(path)
also, for future reference, VSCode (which is what you use) tells you suggested methods/properties and also gives you type info and comments made on the methods/properties. VSCode uses TypeScript internally
on your dev enviroment you could use nodemon (if you use node.js) this will restart your bot if you save a file,
for automatic github stuff there is probably a way but idk how
wait how do you know I use vscode?
yeah I know of nodemon but I want something that can be used in production







