#development
1 messages · Page 2026 of 1
ur problem is not using google
I made much file but after 1 day it getting not working
And now iam stucked here
Idk what happened
What happening
You didn’t give a valid token when calling client.login()
The error is fairly self explanatory
But i did
Not working in qnytoken
Idk why
I also made another bot
And didnt worked
I’m going to tell you that you did not give it a valid token otherwise it would be working
Ok
The error tells you what’s wrong, regenerate your token and try again with that token
Can you show what you’re doing in the code? (With hiding your token obviously)
Ok but where is the client.login() call located
The json is meaningless if it’s not loaded correctly
index.js?
Ok

💀
Then?
Did you make this bot?
i think his not
yea
It is for my friend he dont know how to host i tried like i hosted mine
But dodnt work
Me py
Again, his setup might not be like yours
Where to search in index?
You have to look for the call to client.login()
💀
What should i use?
import the json file
I cant paste the client?
const config = require('./config.json') at the top
client.login(config.token)
You can but it’s not good to keep the token directly in your code
mhm
I’d recommend using replit’s secrets feature
That puts the variables into the env
And it should work after that
no
Where
What? Just keep the code as it was, and use secrets
I puted in client.login what u said
On the left side of the website there should be a “secrets” tab
Change it back to what it was
Ok sec
And then go to the secrets tab, make the key token and make the value your token
Ok and in the config file?
The config file is irrelevant for the token after that
Replit is slow, but I don’t know why it’s loading slowly. I do not have the code
Can u help me?
I think you should learn some js before that :p
also use screenshots please
Iam not logged in pc roght now my ping slow
oh sure
It’s very difficult to help someone with something that could be a complex problem if they’re essentially asking you for a step by step by step explanation
We don’t spoonfeed code here if that’s what you’re expecting :p
Just see code u cant edit
💀
Personally I’m not going to look over your friends entire project to try to fix the code he wrote. You need to ask specific questions. Ambiguous questions will receive ambiguous answers
Iam not reiciving
just help the man bruh 😔
whats the problem tho
Idk
what?
Not logging
logging what?
Bot not going online for no reason
prolly slow
Oh worked it was replit problem
Tysm all ♡
U made my day cz me and my friend each one ckded a bot to grow a community
How can i get the project link for uptime robot? Last time i did errors started
Oh i got it
Uptime robot good for replit 24/7 ?
I keep getting DiscordAPIError: Missing Permissions when I tried to send a message even though I checked these permissions
[
Permissions.FLAGS.VIEW_CHANNEL,
Permissions.FLAGS.SEND_MESSAGES,
Permissions.FLAGS.READ_MESSAGE_HISTORY,
Permissions.FLAGS.USE_EXTERNAL_EMOJIS,
Permissions.FLAGS.EMBED_LINKS,
]
Which permissions that im missing to prevent getting that error again
files
the bot doesn't send file in messages it sends
did u account for channel overrides?
do you mean that did I check for channel perm?
ye
I did
24/7?
literally showed u the code block like 1hr ago
?
well, idk then, are u sure it doesn't show what permission it lacks?
if anything, go adding one perm at a time to see when it stops erroring
Give the bot all permissions then test permissions 1 by 1
Like remove a permission if didnt show error back it
When u reach the permission that without it
Bot send error
Add it as requirement
hmm, okay I guess I have to go the hard way
Ya
quite dumb that discord doesn't show which perm it needs
do the other way around
No other way
add perms one by one, it's a shorter path
Ya
that's what I find weird, cuz for JDA I always get what perm it lacks
maybe it's d.js that's not showing
Btw hiw to be sure that my bot will still online using uptime robot
Oh ok
@lyric mountain sorry for ping but after I checked, it only needed VIEW_CHANNEL,SEND_MESSAGES,EMBED_LINKS
I also checked the channel that giving the error, it does give the bot those permissions as well
did u try with every perm?
is it possible to fix a flexbox under the screen?
I tried those 3 I mentioned, after having all 3, it was able to send the message
like this navbar
position: fixed; bottom: 0px
flexbox
u mean the navbar is inside a flexbox?
yes
result:
it breaks the navbar
fixed works like absolute, it ignores wherever it is
if anything put it inside a div
yea, double checked the result is still the same
💀 why this is so weird
so what do I do now?
If you want your bot to be active 24/7 you have to buy a vps
count[id] = {
opt1: [],
opt2: [],
opt3: [],
opt4: [],
opt5: [],
opt6: [],
opt7: []
}``` Lets suppose the opt variables all hold a number from 1-4. How would i get the number that's the most occuring?
const ones = [...count[0].opt1, ...count[0].opt2].reduce((acc, n) => n === 1 ? acc + 1 : acc, 0);
const twos = [...count[0].opt1, ...count[0].opt2].reduce((acc, n) => n === 2 ? acc + 1 : acc, 0);
const threes = [...count[0].opt1, ...count[0].opt2].reduce((acc, n) => n === 3 ? acc + 1 : acc, 0);
const fours = [...count[0].opt1, ...count[0].opt2].reduce((acc, n) => n === 4 ? acc + 1 : acc, 0);
this whole code fucks my head lmao.
wouldn't this basically just categorize the numbers?
I am just trying to get the number that is most occuring in all opt variables
const most = Math.max(ones,twos,threes,fours)```
if(most === ones){}else if(most === twos)```
it counts the occurrence of each number
ah i see! Let me try!
[...count[0].opt1, ...count[0].opt2]
this part will need to include all the opts
and just do that once and save it to a variable
bag?
a bag is a collection like a map, but it groups values by a common property
tricky
and it always keep track of the amount under a certain key
not really, it's just a map where u can have more than one value under a key
but it's made exactly for cases where u want a count of each group
i guess one could use that same type of logic with js
{
"ones": []
"twos": []
}```
populating that would be annoying
const occurenceCount = Object.values(count[id]).reduce((a,c) => {
c.forEach(x => {
if(!a.x) { a.x = 0; }
a.x++;
});
return a;
}, {});
const highestOccurence = Object.keys(occurenceCount).sort((a,b) => occurenceCount[b] - occurenceCount[a])[0];
@earnest phoenix do you happen to know how to solve this
for some reason on node 18 from a package that uses superagent every request gets logged in console and completely floods it
dont know if its a node issue
oh i think its just an unhandled rejection very badly presented
apparently the new fetch in node 18 is pretty bad
also missing a lot of features
and its seriously screwing over a lot of browser-compatible libs that use native fetch detection
rip
anyone know an api where i can get the closing price of bitcoin or any other cryptocurrency in a weeks time
if anyone else if interested i found this great api someone posted and its very simple to use (prices element contains an array of arrays and the second index of that array is the closing price, i set the currency to btc with the value shown in gbp in a day interval)
https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=GBP&days=7&interval=daily
but with bags u don't create any group
it's like ```java
var bag = new HashBag<Integer>(Integer::compareTo);
bag.add(1);
bag.add(1);
bag.add(1);
bag.add(2);
bag.add(2);
bag.add(3);
bag.add(3);
bag.add(3);
bag.getCount(1); // returns 3
nice, that is fancy
i made it ```js
function HashBag() {
this.add = function(thing) {
this[thing] = this[thing] ? this[thing] + 1 : 1;
}
this.getCount = function (thing) {
return this[thing];
}
}
const bag = new HashBag();
bag.add(1);
bag.add(1);
bag.add(1);
bag.add(2);
bag.add(2);
bag.add(3);
bag.add(3);
bag.add(3);
bag.getCount(1);
whoops
tfw you decide to use the old way of making classes instead of the new way
smh at least use prototypes correctly if you're gonna do that
it's wonderful
suppose its more verbose
you are making a "new" instance of the class
aka calling the constructor
you're the type of guy to use structs to make a class in c++
youre dunking on class syntax but you just did methods wrong
so clearly the syntactic sugar is helpful
anyways random message but i often see when people move from js to c++ or any other similar language they use new instead of just making the class by "calling" it which will actually allocate a new object on the heap leading to leaks
okay if you're gonna do function syntax pls learn what prototypes are
i always use arrows even though it's less verbose
it's not an arrow problem
your example here creates a new copy of those 2 methods for every object. Class methods are not copied across different instances, only fields
how does this make you feel?
function HashBag() {
return function HashBag() {
this.add = function (thing) {
this[thing] = this[thing] ? this[thing] + 1 : 1;
}
this.getCount = function (thing) {
return this[thing];
}
}
}
const bag = new new HashBag()();
bag.add(1);
bag.add(1);
bag.add(1);
bag.add(2);
bag.add(2);
bag.add(3);
bag.add(3);
bag.add(3);
bag.getCount(1);
if you wanna do it correctly you gotta use HashBag.prototype.add = function(){...}
💀
and it sounds like you didn't know that so I don't get why you'd rip on class syntax
function HashBag() {
const map = {};
const add = function (thing) {
map[thing] = map[thing] ? map[thing] + 1 : 1;
};
const getCount = function (thing) {
return map[thing];
};
return Object.freeze({
add,getCount
})
}
const bag = new HashBag();
bag.add(1);
bag.add(1);
bag.add(1);
bag.add(2);
bag.add(2);
bag.add(3);
bag.add(3);
bag.add(3);
bag.getCount(1);
even better than prototypes
i know about prototypes
saves a tiny bit of memory
lmao
That just looks like a very annoying and inconvenient way to write classes for no reason
create a closure for every method pog
this guy is the equivalent of me in c++
Classes are there for your convenience, you are not better off not using syntactic sugar because it saves a tiny bit of performance
I mean you might as well just remove the new in this case
since that's just a factory function
If you cared about that tiny bit of performance, you’d be using a language geared towards performance
I do prefer factory functions over classes tho because no this
class HashBag {
constructor() {
this.data = {};
}
add(thing) {
if(!this.data[thing]) { this.data[thing] = 0; }
return this.data[thing]++;
}
getCount(thing) {
return this.data[thing];
}
}
``` here, is this what you guys wanted to see?
I don’t see what the point of making something more unreadable is though tbh
I think you should scrap the function class overall and just make each of the class elements without the parent class, saves a bit of memory and performance
Because 15 bytes of memory overhead really matters when you’re using a runtime that already takes 40+mb of memory to even run 
that's what you'd do in c anyways since there's no classes
i can mutate this object once i get it
trying to micro optimise in a language like js 💀
yes thats me
I don't even care unless it's a large difference
in c++ tho I stick to c apis
std::cout? streams are slow af and take up memory im sticking to printf
std::vector? allocates space on heap + is a literal class so overhead 101 im sticking to allocating c arrays on stack
just don't pass them to another function because for some reason stack overflow occurs
depends on your use case
the standard lib is meant to make life more convenient by not having to do things manually like you would in c
yeah though I see a lot of things are overcomplicated I would say
C++ just feels like standard lib overload sometimes though, I agree
and it all costs performance and since I don't need the features they offer I stick to c apis
does it make my shift key not sticky after the coffee I spilled on it?
data isn't private
only add and getCount should be public
put a # on it
who cares
or use typescript
kotlin isn't too bad. does that count as j**a?
no but that's a jvm lang so kinda close
that's good enough for me
unoptimised use web assembly instead
web assembly is basically bytecode 💀
@proven lantern
private fields in typescript can be destroyed just by accessing object[property] with a string just types as string and not as const
only real way
my eyes are burning
Does intent matter to people who want to fuck with internals
is there a reason that might be causing this?
v12
Or probably a user that doesn't exist
you have an uncaught promise
Something like that
That stack trace tells us nothing because they don't modify the stack
you need to properly catch the promise to obtain a proper stack trace
I saw 404 and my mind went to non-existent route... Agh
it could also be an await call that isn't in a try/catch
not too bad, but this is used.
why are you so against this?
i mean, what other alternative there is?
some hacky closure?
i never use it. i just do map/reduce type stuff for everything
i'm not making a lib though
if you want something that is reusable, but at the same time independent from its own copies
you need some kind of this
how would you create multiple instances of HashBag each with its own counts?
i'd do something like this
thats not what im saying
i'd solve the problem a different way
sure you can programatically solve everything you want, but what if you dont want to necessarily solve X, but to create a structure to use for X
then i'd create classes
well i'd make my type of class
lel
but u gotta extend list
now extend collection
and you've re-created a hashbag
(well, not really a hashbag but anyway)
I mean, the HashBag is list-like, but it's grouped by hash I guess
it has everything a list has
I think the name HashBag was inspired by Weezer
nothing to do with maps
or hashmaps
oh it's a actually a java collection naming convention
HashSet, HashMap, HashBag, etc
there are also Tree___ and Array___
it does have to do with hashes and maps, since hashing is a requirement to check for equality and incrementing counts
and map for storing the count values
i choose to believe the weezer thing
you can always figure out a way to solve the problem with composition. you dont need to create inheritance structures that are always broken
inheritance is good if ur dealing with generics or superclasses
which is like, 99% use-cases for java collections
When it comes to collectors like these, should I be filtering the user or should I also be filtering the message, too? I'm talking in pFilter.
It tried to read int.message.id === p.id but that threw the error of TypeError: Cannot read properties of undefined (reading 'id') in the first int.message.id.
I've tried debugging for a while, can't seem to figure out which line I should stop at since I'm trying to figure why .id is on an undefined value??
try removing int and just use message
const pFilter = message => message.id === p.id && ...
What, why so?
Fair, the above user doesn't check if message id is same or not.
Is there any bots that can verify my rocket league account
yep, but there isn't that nesting
What does nesting mean
So when you say there isn’t that object inside a object taht means
Uh I don’t know if taht has to do with what I was saying about a bot
I there and can I have link
i was talking to the Hamoodi
Ohh... well I figured out the issue that there is no ID on a ButtonUpdate. ;-;
Yes or no
This is a channel for asking about help with programming/development. This is not the channel to ask about that
Ok where is the channel for that
Read the channel topics, #general is probably the place to ask, but just remember that if people don’t answer your question, asking it over and over again might annoy them so use it sparingly :p
The channel is dead
Well, it’s one of the few appropriate places to ask about that
¯_(ツ)_/¯
Nobody is entitled to answer your question immediately, you might just have to sit patiently for a bit
Or ask around some rocket league servers too
¯_(ツ)_/¯ ™️
Oh ok
Could you answer my question in general
that's mine now
Huh
Nobody is entitled to answer your question immediately, you might just have to sit patiently for a bit
¯_(ツ)_/¯
Ok I will look at rocket league server
Tim i know i said your code made my eyes burn, but could you look at my code and see why it might be caching the server count?
last time you showed it, it should not be possible
btw how do you know its being cached? how are you checking that the value is incorrect?
it never changes
i did ctrl + alt + l, but undid it
are you kicking/inviting it from guilds to test that?
May I ask why do u have 7 try-catches?
i log every 4 hours and it's always the same response, but when i run it locally it'll show a +2/+3 guilds
Because type is expected to have channel/user/message/etc properties
btw, how is this not spamming your console?
To have such properties you need to make a class
my logs rotate
U could remove the superclass, but then you'd need to conform with new Type(id)
I know nobody cares but I just used prolog to solve a riddle 😃
-The first number is even
-The second number is half of the first one
-the third number is double the first
-the sum of all three are equal to 14
this is actually so fun
do you have the leetcode link?
Xet
My mornings as well. 😂
you run the function on all shards, and you expect it to fail on all of them except the last one, but even the failed ones still create an interval, so you have one interval running for each shard anyway, which should be executing the update function multiple times
Fair, since it is throwing multiple errors.
it's not leetcode. Just a normal riddle/math problem
Which ones?
Is it possible to put empty constructors?
Ah, then js doesn't allow inner classes
oh, that's not good
you can do Type = class { ... } and that should work
but it's an incredibly stupid idea
Context: he wants to be able to do something akin to From.type(id).channel
just don't export the class from the file and it's pretty much private
should i lift that function out into the index.js?
Bonus points if u manage to remove the From part
To be honest, I'm doing the above but replacing the final value of GUILD_CHANNEL to like This is a guild channel.
it would be better to have the top.gg thing in the sharding manager yes, you can use shard.eval() for obtaining the guild data
the shard you get from manager.on("spawn")
im still very confused with what you're trying to do
can you show some examples?
Tim.
i know that, and i askd the same question back then
I believe it's a jack-of-all-trades util function
You did? I may have not noticed since I was out and I was trying to find an explanation.
because type(id).channel doesnt make sense because you cant know what kind of data it is from an id alone
I would know since I would be putting the value of id.
What I suggested is either throwing on wrong usage or returning null
I'll be the one putting it (in the code, not in the user interaction).
how you would use this class/function in an actual piece of code
The original values of channel.type is all capitalised and I don't think users would want to even spend time trying to understand what it means.
It's why I want to convert them to understandable english.
Indeed.
just use an object
I mean, probably, in other cases can be a message,.
I was thinking of that, yup, so each property would be the channel type and the value with its actual english sentence, type of thing.
I'll need to use this object across multiple files, so...
const types = {
GUILD_TEXT: "This is a text channel",
GUILD_VOICE: "This is a voice channel"
};
types[channel.type]
yes
Can I export this object and use it in file a.js supposedly the file containing this object is in types.js.
sure
It would be export const types or is that for functions?
yeah, if you're using ts
then its just module.exports = { ... }
in { ... } would be the properties, right?
yes
Sweet.
then you can do const types = require("./types.js")
I'll be adding nested objects (I think that's what it is called).
... like types.channel or types.message, etc.
yeah you can do that
Fair enough. 👍
then use it as types.channel[channel.type]
For sure. :)
manager.spawn();
setInterval(async () => {
const data = await manager.fetchClientValues("guilds.cache.size");
const total = data.reduce(...)
...
}, 4 hours);
if you want to delay until everything is ready, you can do something like this ```js
manager.once("ready", async () => {
do stuff
});
manager.on("shardCreate", shard => {
shard.on("ready", () => {
if(manager.shards.every(x => x.ready)) {
manager.emit("ready");
}
});
});
it seemed to work when the manager was passed in
i think the spawn method wait until all shards are ready before returning
How can I convert times like "30min" or "20d" into seconds? Is there a function or something?
untill all are spawned, not necessarily ready, but since the manager waits 5 seconds before each spawn, its mostly the same thing, just a few seconds difference
no, you'll need to create your own, or use an existing package
okay thank you^^
ah, that could be a problem
for example this one
Check Ms 2.1.3 package - Last release 2.1.3 with MIT licence at our NPM packages aggregator and search engine.
thanks <3
Is there a simple way to simplify this?
const capitalise = (value) => {
let each = value.split(" ");
let final = []
for (let e of each) final.push(e.charAt(0).toUpperCase() + e.slice(1));
return final.join(" ")
};
console.log(capitalise('hifi wefwfe'));
Capitalising the first letter of each word.
Like Title Case?
this is what I have for mine: ```ts
export function toTitleCase(value: string): string {
return value
.replace(/_/g, ' ')
.split(' ')
.map(word => {
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
})
.join(' ');
}
value.replace(/\\s[a-z]/g, v -> v.toUpperCase())
I'm building an NPM package and want to use prisma for an sqlite database. Now if I publish it and install it on a separate server it first needs to initalize etc. Can I make this automatically? Like when the user installs the npm package it auto initializes etc.?
how about this?js export function toTitleCase(value) { return value .split('_') .map(word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()) .join(' '); }
?
The idea is that the value is split by spaces, but underscores are handled as spaces with the .replace call
.replace(/_/g, ' ')
.split(' ')```
so that you could pass something like i_love_js and i love js and they would both be converted to I Love Js
.split(/[_\s]/g)```
too much of an unreadable mess to use that much regex
I'd prefer to keep regex out as much as possible
Mine barely has size
And it'd be faster than splitting and joining the string on a loop
you sure? regex is hella slow
Only when you do big regexes or use it on trivial tasks
String is immutable, so every single operation you do is creating a new string
And for those who dealt with low level languages, strings are hell behind the curtains
regex is hell behind the curtains and in front of the curtains 
Nah, they're fine when u understand how to read it
personally I hate regex, I use that function sparingly and only when performance does not matter
I don't like having to look at a regex for 10 mins to figure out what it does, nor do I want to spend the time to learn to read it just to figure out what a simple task does
That's why u comment regexes
And really, unless ur doing data validation, regex doesn't get too big
Repeating yes, but each segment is small
For that code I wrote, / [a-z]/g is just "any lowercase letter after space"
https://sourceb.in/eBTmiytFU7 i was trying to recreate my leaderboard, but the problem is its returning as undefined
Is there a way that an NPM package has a persistent data source which I can automatically install/configure? So the user doens't have to do anything?
Better-sqlite-3 maybe?
When u instantiate it, if the file doesn't exist it'll create one
Well I already have an SQLite DB in my package which gets automaticall initialized. But when I update the package it resets it
even if the file exists*
It shouldn't, what lib is it?
I use Prisma, so prisma generate and prisma migrate to load the schema
That's essentially a flaw if you lose the whole db when updating the lib
Yes I know that's why I try to fix it xD
Why don't u go with better-sqlite?
Like, it's quite simple with not much fancy features, but so is sqlite
Configuration and usage are pretty simple
I agree but I wanted to take a look into Prisma and get started with it.
I wouldn't trust a lib that drops my db without notice
Maybe I can configure something in Prisma that doesn't overwrite it.
Welp, gtg now, gn
bye
https://sourceb.in/n7QkouxiSv how can i transfer my current wallet amount to a member? i tried so far like js data.wallet += message.author.id[data.wallet] didnt work xd
Does the Discord OAuth refresh_token expire?
if they revoke access in settings
okay
oh so prisma isn't a standalone database it uses mysql under the hood
why tho
at this point just use sequelize or something honestly
don't know what any of that means
orm means object relational mapper which just a fancy way of saying that you'll interact with your relational database in an object oriented manner similar to how the language operates
orms may also provide a way to get typings out of your database
I made my own, but realistically it's just a simple sql query builder and provides typings. I guess I could also say that it includes a buffer feature because postgres is cool which allows me to de-duplicate prepared statement values and batch insert queries together
Can I use an SQLite DB in my NPM package?
ah
sure
what for may i ask
i wouldnt want a random package making a database inside of itself for no good reason
am tempted just to setup node-ipc
whats all the hype about node ipc
not hype
is it the obfuscated malware
its the fact that it puts a random file on your desktop
and wipes ur pc if you're in Russia or some other country
i think
belarus
thats it
if that isnt ignorance i dont know what is 💀
lol
punishing people that have nothing to do with the war is terrible
i doubt any government agency is using node ipc
also destroyed his career over something that helped nothing
💀
if i was using oss packages in a critical sector i'd stick to a version that works
Is it possible to get the number of members in discord.js from the server invitation?
do note thats a cached and inaccurate version (mostly accurate though)
I don't find it in docs 
then you can get the count with <invite>.memberCount
tysm ❤️🔥
💀
they have a point but like its their fault
they shouldve stuck to a specific version and only updated when its necessary
FINE THEN I'LL MENTION THE FACT THEY SHOULDVE STORED DATA ON ANOTHER SERVER
updated the production server, npm i node-ipc would have gotten the latest version 
i mean
my backup point
they mention they usually back up
and if the traffic/communication increased by 50x then they wouldn't have backed it up yet
as the war started on 27th or some shit, and this all happened between 1st-10th
it’s pretty agreed upon that that’s fake anyway
if there was actually data loss of that calibre it would for sure have been picked up by the news
true, you still shouldn't force-push malicious shit as an open-source developer
which basically killed off any trust towards node-ipc, aswell as any other open source projects made by that particular user
yeah
and to change his details 💀
peope don't trust node-ipc
oh hes already gone too far
his entire family was doxxed on doxbin
yeah kinda expected, though kinda dont want this conversation to go towards that direction 
@quartz kindle need some advice - so im adopting the technique you mentioned (storing dynamic data in another file with the main record having a seek pointer to it) but i dont know if i should hash all dynamic data that gets written, or at least leave a blank space for it and not remove the space
- its easier to query the data
- leaves space for a possible hash without having to relocate the record if the user decides to enable hashing for that data length
- it takes up an extra 4/8 bytes depending on architecture
i mean kinda stupid because its better to leave the space there
much easier to query and better performance because you dont have to calculate lengths (whether to include hash or not)
say less
lol
oh yeah found it 💀
thats deep
they went in
i assume they got some of the data from a data breach
yeah
Hewo, so i am facing this issue while pushing my code to heroku, i get this error.
The error says no module named glfw was found.
But this package is mentioned in the requirements.txt file so it should install like other modules.
Any Idea?
yeah you can do that
most dbs do that
there is always some fixed length header containing various things
like data size, prev pointer and next pointer if using separate chaining, sometimes also a copy of the key if its a key-value store, sometimes a backpointer to the table row
glfw is a C library, the system needs to have it installed, otherwise the python package wont be able to find it
look for it in the heroku build packs, or check if there is a way to build it
im going to store the hash and size of the string in the main data file so if the hash & length matches it will seek to the other file
anyone know how to catch these properties
you mean how to count them?
yes
for each guild check the size of guild.channels.cache and guild.emojis.cache
then add it all together
do note tho that it'll be an approximation, not the actual value
but close enough for whatever reason u need it for that
the value will be correct if using djs with default settings
djs caches all channels and emotes?
yes
not with default settings
have experience - will work you just need to have a big enough budget for ram:)
oof
One message removed from a suspended account.
yeah and iaras paying an arm and a leg for hosting
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
honestly such a waste considering you can make some tweaks and lower that significantly
without having to switch libraries alltogether
bro thats like a data science rig
or video editing
probably also has a shit ton of clusters because node can become unpredictable with high enough memory usage
I mean at that size a dedi makes sense of course... and 256gb of RAM aren't that expensive
at least over here
there is a way to find the invite of a server inside a long text in discord.js?
I mean, in a partnership message
You could use regex to match server invites in the content of the message, a server invite would be
/(?:https?:\/\/)?discord\.(?:gg|com\/invite)\/\w{8}/
I can check with regex, but it return true || false or I can also get the invite
You can use the <String>.match() method to match against the regex and get the invite
tysm

Oh god what do you have stored there?
You better don't ask

Guess that will take the entire day
the hdd should actually manage to get around 100mb/s
weird tho, might be my network
idk
school projects
that starts with "s"
panda pictures, yes
funny how quotations would change the entire meaning
"school" projects
lmao
homework wtf
xD
School is like 20y ago
fucking old
NaN
also don't blame me, Tim's a few days older, he's the grandpa here


I'm still concerned why the fucking speed is so low
I feel like it's an issue with the unmanaged switch
probably not prioritizing the traffic correctly
that out of context... (imagine)
just because you're too lazy to scroll up
what kind of isp plan are u using? 1 Tb/s?
I’m talking about internal traffic my gosh
my pov: 🍿 💻
still
do ur cables even support those speeds?
those "panda pictures" have to stay there
No no that’s still running
Guess for the next 12h or more
I don’t trust those windows time calculations
FakE be purging some things before getting exposed on Twitter
lol imagine being on twitter

Oh you're trying to tell me you're not? If not I'll create one with your IP address strapped onto it as a banner
Let the chaos unravel
Of course 

Nope I’m not
Literally got no time for that bullshit
But you got time to drive for 9 hours?
Oh wow, damn
dem
Yeah don’t you know, some years ago it was cool to drive an expensive car, now it’s to refill your entire gas tank at a gas station
I know, but I've forgotten to fill your car with some atomic bombs hahaha
And to refill the chaos
where are you from?
eu
No day without FakE driving
true
FINALLY
i made postgres run on port 6969 (i did 6969:5432 when starting the docker container)
it's detecting the usb device over the PCIE card
took so long, my gosh
now the question remains how to pass it through to the VM
guess there aren't any proxmox experts here? hmm
ffs
I would need to reboot the device which currently is moving the 511GB of data
great
nvm
I'm stupid
hay thanks for the input, also i can't find any build pack for it online smh
How can I fix this?
Postgres is running on port 6969
Is it running on your local machine?
hmm
i sorted it now
i thought { ordered:false } would have done it
but nope
anyways i just checked if it already existed
pug is so nice
mmm no
was waiting for someone to tell him
???
Anyone know of a bot that will strip a users role if they move, delete or make a role/channel?
can you elaborate
So
I wanna give someone manage roles so they can use a bot to give roles
But I want it so if they delete, move a role/channel or delete a role/ channel it removes all their roles
And pings me
@turbid canyon very specific i doubt theres a bot that does that even if there is it will probably shut down very soon like most of them
maybe try using a bot that allows you to "program" features
i think carl bot has that (not sure if it has events though)
or make your own bot that does that
god next.js images are such a pain in the ass
I want to import an image without specifying it's height and width
the fact that next.js can't just fall back to a regular img if height / width is not specified is annoying as fuck
And there's no other sane way to serve static images
so your server can be ran on vercel
@quartz kindle speedydb officially has findall support
tho its just a copy paste of findone with a few things changed
might need to make things more modular
dont think repeating myself will go down too well considering its a project
\o/
nice
are you copying prisma syntax tho?
lmao
[^\w:/.-]
i never knew prisma existed until today
theres not much you can do with an object honestly
so it might look similar to a lot of json based databases/drivers
for conditions im thinking something like
{
where: {
one: { lt: 5, gt: 2 }
}
}
pretty standard
string based special queries might come later or might just not add them at all
ew mongo syntax
at some point ur just writing sql but with json
i'd rather have something like js one: ["< 5", "> 2"] or ```js
one: "< 5 AND > 2"
BETWEEN 2 AND 5
yeah
or at least use more descriptive keys
like one: { lowerthan: 5, greaterthan: 2 }
and inverted
yeah thats what im planning
greater, lower
was thinking about something like that but i'd rather not have to fish out data from strings, makes it look rather messy
yeah you're not wrong
is this guy right?
oh fuck
right after an email that my github account may have been involved in a breach
imagine spending money to google
password changing time
"may"
always set budget kids otherwise you won't know until its too late
no risk no fun, sir
use uuid() for your passwords
base64, totally save
then memorize it
i think its because google cloud again updated their fucking tos which means my free tier is no longer free tier
hehe
they do a little trolling
gonna see if i can get it credited
nothing is for free, sir
nope, u spend energy to have time
I'm excited to learn what happens after death
you will be reborn as cat
probably very similar to before life
yeah well we don't know before life
you were a cat
oh
ofc we do
the moment when u notice ur a scoped variable
there never was nothing. how could there be? there would still be nothing
end of scope reached, memory freed 😩
she really is 💀
She was created with the new keyword
should've been attached a smart pointer
how do you edit a message using a messageID?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
what
fetch the message and edit it?
and how do i do that?
you gotta give us more information.........
you could use a program like postman to test it out
i got a messageID variable that has a message id to a message i want to update
... what language are you using? what library?
We're writing to let you know that the names of the organizations your GitHub account is a member of, if any, were likely viewed as part of an attack campaign against GitHub customers. Unless you have received a separate notification from GitHub indicating otherwise, we do NOT have evidence to suggest that the attacker used your account to view other private information, such as repository names or content.
LETS'S GOO
I'm so confused
discord.js question: Are all channels and roles of a guild cached by default?
a domain I got for free thanks to my github student pack is always sending me to the github's 404 page saying "There isn't a GitHub Pages site here." but I'm not using discord pages at all 🤔
yes if you dont disable their caches
do i smell retrieval failure via interference with that last part "discord pages"
I am a failure lol
wtf ur using the topgg package
shame on u sir
im confused @boreal iron
i use axios for the rest
is that bad he is using it?
im not advertising!
shameless ads, ban now!
i use this command to start my bot sh pm2 --name NAME_HERE start npm -- start --watch --exp-backoff-restart-delay= 100 --time
also... why tf do I see djs-light
I thought you dont wanna deal with a gateway connection anymore?!
once message intent goes away
i want to respond to !help for now
and tell them to use slash commands
if i use discord.js i'd need at least 1MB of ram
it's crazy that discord lets bots have access to the messages
by default
its crazy how easy u can sell personal data 
i mean GB
-b
You need to provide a member to ban
Done
👀
noooo!
Seems sus
I wanna speak the manager, now!
this is the discord.js-light code that adds the guild. does client.guilds._add add it to the cache?
the same thing is used for ready, so it should work the same. idk
Hey guy's, someone know how i can send data to my second nodejs app?
either make an api or use websockets
yes if the guild cache is enabled and not limited
._add respects the client's caching settings
they are on the same server,
still
no easier way so? 
you can use unix domain socket
easier than websockets?
._add respects the client's caching settings
imagine respecting an user's choice wtf
i never use websockets i'll look
i have the guild set to infinity
do note, tho, that you'll only be able to transfer simple data
like string, numbers, bytes, etc
no objects or fancy stuff
unless u serialize them (like by json stringify)
ah
look into ipc libraries
ipc stands for inter-process communication
most of them use unix domain websockets and tcp sockets as a fallback
those are 1 level lower than websocket, so they are faster
like node-ipc 
yup, the infamous node-ipc ex dee
i made an ipc library myself, feel free to check it out
i see it look funny
i'll look that before making something
so, for ipc libraries you can send any type of data?
data will always need to be serialized
because i have to send something like that
let s = {
author:userid,
mmr:1000,
message:r // message event from djs collector
}
your message object will need to be serialized into a plain object, without references, classes, methods, functions, etc
maybe i could move the server count logic from the persistent ec2 instance to a lambda that is triggered every 4 hours by a step function.
then it cant cache it
i still dont see how your issue is even possible, there is no caching anywhere in those functions


