#development
1 messages ¡ Page 1801 of 1
why are u sending ur data to excel, there IS a better solution to what ur trying to do
and client side or server side
i just want to structurize it to excel
that's all tbh.
u can do that in js
how would i do that?
do u mean "strucurize" by changing the data?
I tried reading docs and got a few potential packages but unsure whether they will do what i please
or whats goin on
Importing a generated text file to an excel file
for example a txt file with 5 words. I want those 5 words copied to the excel file that is available in the folder / one that gets made (either option will do)
so, im assuming you've already retrieved the data from the txt file yeah?
yup!
so client or server side
not sure what you mean. The bot is handling and fetching information from an api, so I would say client side.
and saving that info (after escaping the arrays) in a txt file
is it form data?
form data?
It's just a plain txt file
with words each line
okay, well u can be usin https://github.com/SheetJS/sheetjs
@digital ibex I was able to fix some of the errors, but I'm still working on things
In order to fix the initial issue you're having you need to export your class.
Like this
You still have errors, but they're different than before.
oh?
In some of your other files, you do const RandomGenerator = require("../../../index")
But what you need to do there is const RandomGenerator = require("../index.js")
By the way, I highly recommend not having 2 index.js files, as it makes it kind of confusing on yourself
but then i have to create a new instance of the same class
then it'll have incorrect data
I'm not really sure what your goal is here, I just read the errors and attempted to fix it to what I assume you were trying to do
You're trying to create an instance of your RandomGenerator class in the Position.js and Random.js files, right?
so im creating the class in the root index.js. im not creating it anywhere else as i need the data, and if i create it elsewhere it'll have none of the corresponding data
no
i just got the same data from the root index.js
Oh, so you're using the root index.js file to export an instance of your RandomGenerator class, then?
If I understood correctly
yeah
Hey pro discord mod, I tried reading the docs ad have issues understanding how I would get a whole total txt file and push it in a row
because they input it manually
How do i fetch users instead of getting em from the cache?
get it from the rest
Position.js ```js
const RandomGenerator = require("../../../../index.js");
module.exports = class Position {
constructor() {
this.random = RandomGenerator;
}
get data() {
return this.random;
}
}
I believe this is what you're looking for?
what library?
module.exports = class position {}
class bob {}
module.exports = bob;
``` both r the same thing which doesnt change anything
you indeed can
Hm, never seen that before
404 is typically a failed fetch from discord, not getting it from cache.
but you can use the force: true option to force getting from the api.
https://discord.js.org/#/docs/main/stable/class/GuildMemberManager?scrollTo=fetch
Okay for some reason my setup earlier wasn't working with that version of declaring an export
where does it start?
yeah, im trying to send the guild owner a DM
uh one sec
#development message here
ah you want to get the guild, then use .owner.send()
not a function, i CAN get the guilds owner ID tho, how would i send a message using that
Here is anything related to "owner" (ownerID: '574445866220388352')
Thats all i get
how are you getting the guild owner id?
hey is there any way to input the whole file into an excel row using the sheetjs
guildtarget.ownerID
why not just use guildtarget.owner
lemme give it a quick read
Because it does not exist
I can only get the owner ID
So am i
btw what is the end goal u r trying to achieve
Here is my fetch code
client.guilds.fetch(args[0])
.then(guildtarget=> {
//code here
})
cuz u creating & deleting a txt file and exporting it to excel doesnt seem very
uh
good
I am trying to get my whole txt file, and put all contents in an excel file
no i am not deleting it
i removed that part
why are u using a txt file
probably will want to get the member anyway,
guildtarget.members.fetch(guildtarget.ownerID) should give you the guild owner member object(promisified)
why not just store it in ur memory
or in a db
that'll be like a billion times better performance wise
because it is temporary. I could've stored it in a memory ofc.
But it is not really performance bound and needing
it can even have delays of hours, it doesn't matter.
I just need to export whole files to excel
okay
i mean its pretty straight forward since all u have to do is jus add a script tag
@digital ibex which error are you getting still?
I'm no longer getting any errors related to the root index.js file
same, Index is not a constructor
After some modifications
might be straight forward for you ahhaha, but i never really used excel too much,
I have this in the root index file: ```js
const Index = require("./Random-Generator/src/lib/index")
module.exports = new Index();
and ur done
Works fine
And in position.js ```js
const RandomGenerator = require("../../../../index");
class Position {
constructor() {
this.random = RandomGenerator;
}
get data() {
return this.random;
}
}
module.exports = Position;
Works like a charm, thank you
u've got the exact same code, the code is no different apart from the path
The path seemed to be the problem for the most part
it will throw a different error like module not found
Yes, I had a few of those errors come up
i havent
The only files I modified were both of the index.js files, and then the 2 files in structures
Yes
I'm getting a different error now instead, but nothing related to the original problem you had
u have to change the path otherwise the file wont exist
mate
show me ur full path
mine is c:/users/user/deskop/random-generator
u've probably got something like c:/users/user/desktop/something/random-generator
Yes, that's what I've got
so u've got something and i dont
I'm not really sure how to fix the problem for you, seems to not have the same problem for me
so u need an extra ../
I'm not quite sure what to tell you at this point
im trying to say, the path has nothing to do with it
the error is essentially saying that Index is not a class
Let me clone the project again rq, I think something is being weird with the way it's cloning
Alright, I've cloned the project, and I'm not getting the error of Index is not a constructor
Instead it throws this: ```C:\Users\jacks\Desktop\Random-Generator\src\lib\structures\Position.js:5
this.random = RandomGenerator();
^
TypeError: RandomGenerator is not a function
at new Position (C:\Users\jacks\Desktop\Random-Generator\src\lib\structures\Position.js:5:17)
at new Random (C:\Users\jacks\Desktop\Random-Generator\src\lib\structures\Random.js:6:3)
at Object.<anonymous> (C:\Users\jacks\Desktop\Random-Generator\src\lib\core\Class.js:2:13)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\jacks\Desktop\Random-Generator\src\lib\index.js:4:14)```
So I'm not quite sure why you're still getting the Index is not a constructor error
Did you save your new code before running it? That's the only thing I can think of as to why it would still give you that error
Oh, I wasn't aware that you were running it from there
how do i access the second href?
story.querySelector('.heading')
i can't
cuz scraping
what
web scraping
u can still do it
how
wha
.heading > a + a
thanks
i am chill, was just saying lol
how do I automate x?
idk have u tried doing it by hand?
lol
đ
i am scraping links without the full url, they are like /page/ofthesite
but my page automatically adds http://127.0.0.1:5500/ infront of it
is there a way i could get rid of that
Try to explain what you wanna do without using the same words again.
Where did I get it from?
Yeah thatâs a normal behavior of your webserver.
If you donât add a HTTP_HOST or SERVER_NAME to the URL it will be handled as relatively local path.
i tried
doing so like "thesiteiwant.com/" + url
it doesn't seem to work
it still has the current tld in
You need to add the domain name as prefix before the path youâre âscrappingâ
so pull both domain name and the url?
A valid URL starts with the protocol
In that case with http(s)://
yeah i see
My virtual host folder name is the same as the domain name
It would be funny if the web server would think that path would be an URL
(Without the protocol)
no no
i add the protocol
it still doesn't recognize
cuz as soon as it pulls it adds its own tld
so i gotta find a way to scrape it together with its own tld
using vanilla js and it is a pain
Huh? Looks like your script is wrong.
But thatâs just guessing since I donât see any code
const url = story.querySelector('.heading > a').href```
here is how the url that it pulls is like
so at the time that it pulls it automatically assigns its own tld
so if i log url i'll get the current tld and then the page
The HTMLAnchorElement.href property is a stringifier that returns a USVString containing the whole URL, and allows the href to be updated.
url.replace(baseUrl, "")
The HTMLAnchorElement.pathname property is a USVString containing an initial '/' followed by the path of the URL not including the query string or fragment (or the empty string if there is no path).
damn u really got a solution for everything
I mean you're looking to remove the base url from a url and this is how you do it
or just use the correct property that already gives it to you
Yeah I see looks like JS is adding the FQDN to it
hhh
It so just replace your local server name by the remote one
even if you don't know about pathname (which doesn't include querystring so technically not 100% the solution) I'm not exposing some crazy hidden knowledge, this is just how you implement the thing you want to do
As your script knows your exact current server name
i got 200 domain names that are gonna use the same page
sometimes you have a super hidden method like array.copyWithin that you probably haven't heard of and it's like the perfect solution but this is just how you remove things from strings lol
Then use a framework, for example jQuery to fetch the exact value
*element value
$(element).attr(âhrefâ);
element can still be the element you got via Itâs Id
_I hate mobile auto correction _
oh i wont use jQuery on this project
Well not much more I can suggest then
yeah no worries
Yeah nvm didnât even notice Xetaras and Timâs response
ayo pog

I hope you weren't driving!
I was but not anymore
if(message && message.guild) {
message.channel.messages.fetch(client.setups.get(message.guild.id).message_track_info).then(msg=>{
msg.edit(msg.embeds[0].setDescription(`${createBarlul(player)}`)).catch(e => console.log("Couldn't delete msg, this is for preventing a bug".gray));
})
this message is not editing
i can't understand this issue
anyone can solve
please
You should probably create a new embed, and then edit the message with that embed. Also, the first parameter of message.edit() does not take an embed (https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=edit)
Well yes, just saying that it's easier to create a new embed
And actually, I've used the first parameter for an embed before and it's worked perfectly fine, just technically not supposed to do it
I'm assuming you're trying to edit an embed, usually I do something along the lines of ```js
const Embed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL())
.setTitle(Cool embed)
let myMessage = await message.channel.send({ embed: Embed })
// Blah blah blah code stuff until you need to edit the embed
const NewEmbed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL())
.setTitle(New edited embed!)
myMessage.edit(NewEmbed)
line 124
and this dude was making a bot tutorial series
If you're using Discord.js master, you need to edit a message like
message.edit({ content: "content", embeds: [...embeds] });
edit no longer takes a string | MessageEmbed | MessageAdditions
thats good answer
thnq
nice ghost ping
your welcome 
bruh
fuck yeah!

I have no clue where to start but I'll figure it out 
I'm gonna make a pr removing the entire lib
lmao
either look at my repo, or cake's bot, or the docs recommendations
okay wait, its time to write an article
my repo is good to start with, the docs examples are good to get a basic hang of the lib, and cake's repo is big brain time where u might be scared of the advanced syntax
on detritus
tetris
You're 1 contribution away from 1k this year nice

imagine not knowing how to spell tetanus
gonna start calling detritus tetris
i was joking btw đ
Also gonna look up how to set up a linter cus I've never done that before!
and thats where i come in
eslint is pretty poggers
I have a feeling it's much nicer than the garbage I indent myself đ
git clone that
Yeah I'm looking at that rn
I don't wanna clone quite yet
vscode stronk. I just wish I had access to gh copilot already
I tend to learn a lot more from writing the code itself rather than just going through it and attempting to understand it
Even if it's word for word copying
omg erwin
your github profile picture tho
yes

but anyway, how to get a bot in detritus
git clone https://github.com/erwin1234777/detritus-example.git
rename example.config.json to config.json
edit ur token
press f5
wait
profit??
@wheat mesa
both of u ^^
profit?? No
i think VSC doesnt pickup the correct profile by default
there is still the default profile, where it likes to default to
You mean git clone?
alright, just making sure I wasn't missing something lol
i was installing shit as i was writing that
npm install brain
404
Do I need to install eslint and prettier in order for those to work, or should it work from just git cloneing it?
there are a couple concepts i should explain to both of you, since this is pretty much which you even start with
removed 7482 packages, audited 1. 1 package is looking for funding. type npm fund for more info
alright
does editing a message 3 time under 1-2 sec is api abuse? or wat
What other packages do I need to have installed for this example to work?
The rate limit for the /channels/channel_id/messages/message_id bucket is 5 requests per 5 seconds iirc. So, 1 a second.
@wheat mesa@clear marlin
So, how to start?
Detritus has 4 main "clients". ShardClient, ClusterClient, CommandClient and SlashClient
focus on ShardClient and ClusterClient, since they are what actually connects to the gateway and does "discord" stuff.
ShardClient is a single client thats connected to the ws. A ClusterClient, to but it very bluntly, is just an array of ShardClients. (its not that simple, but this helps understanding what it is). Its just a group of shards.
now that you know that, you either pick a single shard or a clusterClient to run multiple shards for you.
now, to CommandClient or SlashClient. Think of them as wrappers. They can wrap either on a shardClient or ClusterClient. Thats what will do the command handling for you along with all the extra features.
So, if u want a bot, with a single shard, and a command handler, you'd pick a CommandClient with a single shard.
You want a slashCommand with a bunch of shards? you'd pick a SlashClient with multiple shards
const commandClient = new CommandClient(config.token, { //this is a commandClient with a ClusterClient inside
useClusterClient: true,
shardCount: config.shards
}
const cluster = new ClusterClient(token, {shardCount: 10}) //this is just a ClusterClient with 10 shards(each shard being its own ShardClient, hence why i hinted this is basically just a glorified array
const slashClient = new SlashClient(cluster) // notice how u can add the wrapper on an already started cluster/commandClient/shardClient. You only need to do this once, no need for all those declarations. you only need 1 (max 2 if u want slashClient AND commandClient)
woah
yeah
okay then
wait erwin, I got a idea
write the article for me, and then I'll copy and paste it


u do know i sent that cuz its 2AM and im about to sleep right?
and i'd feel bad not replying to your questions as im going away now
I legit thought you wrote the whole article
thats just which u should do
my recommendation
CommandClient with clusterClient true
Evie wrote some small article about it
yeah, theres a bit of misinformation there tho
cuz she got the basics messed up a bit
hence why i posted the bibble above
I'm going to rewrite my bot for scaling, so I'll go with your recommendation
Even though the bot itself isn't very unique
hence
Might as well
correct
Erwin writes the article for me
imma sleep
start preparing for it early, gives you less headache if you need it later
okay, go to sleep

lmaoo
Oh wait, before I start writing this... do most/all node packages work with ts? I would assume no right?
For example, could I use ytdl-core if I was using detritus?
should still work
Not all of them do. TypeScript imports default from modules which can cause cannot read prop of undefined errors. In which case, you'd need to use the require statement and type it as typeof import("mod").
Modules that don't have .d.ts files will also make TypeScript hate you
I see
Yeah, I'd just prefer to use it as a TS lib
default imports and exports was the worst thing to happen to JS. You cannot change my mind
JS didn't have a way to import/export before though
you'd have to cram all js files in the html file OR use a bundler
oh you're just talking about default
yea I agrre
agree
es6 go brr
đĽ˛
I'm trying to make a controllable music system from Dashboard, but I couldn't find exactly how to get the music back and forth, how can I do that?
.seek() worked in v11, but in v12 I play("music", {seek: ms}) but it gets stuck after changing a few times
seek should be still a thing?
Idk why I have that undefined
embed field not valid
make sure you did valid addfield values
.addField('Inline field title', 'Some value here', true)
What does this mean?
show the full stack
?
the full error stack
That is?
But if I do it with this I have to be able to restart a music continuously to fast forward
i make a large circle around Music bots bcs they are annoying. ÂŻ_(ă)_/ÂŻ
hey everyone, anyone else's bot suddenly keep going offline and online randomly?
no errors in the logs, so i assumed its a discord problem, so i am wondering if i am the only one experiencing it :/
that makes sense 
check gateway event logs if something funky happens there (enable debug event, is usually aviable on most libs)
ok, i will do that thanks ^^
maybe its the hosting service i am using experiencing issues
do not keep the event in production tho, if you use pm2 you can fill 25GB pretty fast
oh thanks for the heads up đ
how to take user input for cooldowns
@commands.cooldown(1, user_input, commands.BucketType.user)
let message = {channel:{id:"0"}} message.channel?.send("test")
why does ? only work on vars and not on functions?
<Function>?.()
could you elaborate more?
with message.channel and the ?, you are checking if the channels exist
not the Function, it would be message.channel.send?.()
thx sounds good
guys how can i remove cooldown with command?
is there anyoe here that can help me with sheetjs?
To export data to excel using js
Iâm looking through the discord docs, and there is no way to retrieve a users player banner, am I correct or blind?
but it simply did not make the file
why txt?
I can also just simply push it directly
but stil gives the same issue
did you tried to upload a xlsx and then just manipulating it?
var wbout = XLSX.write(wb, {bookType:'xlsx', type: 'binary'});
``` also tried this one?
yup
does the process got permissions to create files?
yup!
do you get an error?
nope
Awesome, I told u yesterday that ur over complicating things
why am i overcomplicating things
There is a better method to do what ur doing
I forgot what u were doing but thatâs what I remember
what is your goal
i have 3 type of data's.
1 is a string full with linkedin urls
1 is a string full with names
1 is a string with meails
emails
i am trying to push all 3 into seperate rows
to excel
are they already formated in some way
nope i just escaped the arrays and then put \n between each name/link/etc
so the result looks like:
name1 name2 nam33
so you got Name\nName\nName and URL\nURL\nURL?
yeah
i looped through an array to get all the users, and fetch their names etc. I then usedL += and \n after the path to spread them over each line:
const test = datajson.profiles
for (const names of test){
naming += names.name+'\n'
email += names.teaser.emails+'\n'
urlsys += names.linkedin_url+'\n'
}```
why not directly joining them each into sub arrays?
so you have [[name,url,email],[name,url,email]]
would take away some headache i guess
since they are all sorted together
but as it is a loop
wouldn't it get all the names in 1 subarray
all the urls in 1
naming etc is somewhere defined
same for the mails
usually a loop does the stuff for each object in the array you run it over
if you have the array with the subarray you could just push the array to xlsx
okay wait i will try
no but waity i am a bit confused
how would i subarray them all seperately
as the loop will get all the contents and push them together
Error: aoa_to_sheet expects an array of arrays
how exaclty is your json designed?
const XLSX = require('xlsx')
const json = require('./test.json')
const wb = XLSX.utils.book_new();
wb.Props = {
Title: "Test",
Subject: "Test",
Author: "Test",
CreatedDate: Date.now()
};
wb.SheetNames.push("Test Sheet");
const ws_data = [["test","test2"]];
const ws = XLSX.utils.aoa_to_sheet(ws_data);
wb.Sheets["Test Sheet"] = ws;
XLSX.writeFile(wb, 'test.xlsx');
```this works for me to write files
(ignore the json, wanted to test the parsing, but idk how your json is structured
each subarray should create a new line
guys my meme command takes years to respond what can i do (my friend gave it to me btw it was too long so smoled it no errors btw and still the same speed of responding it takes like 2-3 secs to send it)
const https = require('https');
const Discord = require('discord.js');
const url = 'https://www.reddit.com/r/meme/hot/.json?limit=100'
module.exports = {
name: 'meme',
description: 'sends meme',
execute(message, args) {
https.get(url, (result) => {
var body = ''
result.on('data', (chunk) => {
body += chunk
})
result.on('end', () => {
var response = JSON.parse(body)
var index = response.data.children[Math.floor(Math.random() * 99) + 1].data
var redditimage = index.preview.images[0].source.url.replace('&', '&')
var title = index.title
const imageembed = new Discord.MessageEmbed()
.setTitle(`${title}`)
.setImage(redditimage)
.setColor(000000)
message.channel.send(imageembed)
}).on('error', function (e) {
console.log('Got an error: ', e)
})
})
},
}
part of the reason is the content is very large
In fact, a nice 68k (564kb unzipped)
:/
You could download the response once and look through the response for each meme command.
I haven't used Node.js https module though, and I don't think that's why it's so slow
you're only going outdated because you copied that code đŠ
A lot of users just prefer to use higher-level packages to accomplish the same, like node-fetch.
why did you use the preview image and not the full quality one?
also you might want to add some NSFW filtering
x.data.children[1].data.urlshould give you the full quality image
Just started playing with it
wow
You have to use the style tag in the long description
<style>
/* Put all your css in here */
</style>
doesn't work
i used ```css
<style>
body {
background: purple;
}
</style>
but the background doesn't change
@rustic nova
client.on("message", message => {
if(message.author.bot) return
if(message.content.length > 4){
meme(client, message)
}
})```
Hey I want this to send message when message goes upto 4

It does work, you just can't see the change. What exactly do you want to be purple?
the background
the background that you can change to white and black
How to add this?
Try
.entity-content {
background: purple
}
unordered list
Use ```md
- Item
- Item
or* Item
- Item
for Markdown orhtml
<ul>
<li>Item</li>
<li>Item</li>
</ul>```for HTML
ok
i'm getting this
What is this
Invalid CSRF Token. Please refresh the page and try again

Ah, I need to go get glasses
Is this the beta version?
The same any other command, but just with helpful information, like commands and usage
do anyone know how to make greet command?
define greet command
already
did you want the bot to greet everyone who joins or join a mentioned user
delete one left
yes
i disabled it (with the beta version, the theme changer appears above)
that already maded just need to make delete after few sec
node.js
The code I gave you works only in the current version of the site
store the message object in a variable, then set a timeout with the time you want it to stay, then call delete() on the message object
like i told i want to make like nadeko
.greetdel 1
like this
idk how to do it in the beta version
not by typing in code only
this is almost the same, just the ability to customize the timeout for the message.
requires that you use a database
i am using redis and postgres database
did you have a per guild config?
i get this error disabletting the page's beta version
Invalid CSRF Token. Please refresh the page and try again
just add a field for the time you want to use for the timeout
and where you set the timeout call the DB and retrive the value to set it in the timeout
can you give exaMple?
you know how to query the db right?
yes
ÂŻ_(ă)_/ÂŻ
const time = db // value you retrive from the Database
const greetmsg = await message.channel.send("Hello there") //await the message to get the message object and not a unresovled Promise
setTimeout(function () {
greetmsg.delete()
}, time*1000) //by default it uses ms if you store the stuff in the db as seconds, format it to ms
ty
i disabled it but when i refresh the page it's on
switch to the old design
be aware this is not restart save
if your bot restarts while a timeout is running the message will not get deleted
ik
and want to ask one question
how
we can ask to dev for working with us for bot
or we can't ask?
so you want to hire people here to join your dev team?
yes
its not tolerated
i have it disabled
@cinder patio works
in beta mode too
i refreshed my browser
some people trying to enter the server are getting this message
Reason
I don't have permission to add the 860851625169125396 role to them!
but some people have done the captcha and entered the server
oh nice
make sure 2 things are present:
- the Bot got permissions to give roles
- the role the Bot wants to give out has to be lower than the Highest role the bot has
how can i fix this?
use full screen image
thanks for reply - so the captcha bot has all permssions - do i need to give it the highest role on the server then so eg- admin role
?
letme show you an example rq
background: url(URL_HERE) center center / cover;
wait you dont make the bot? if this is the case, sorry for the inconvinience, but you are on the wrong server then
why is my name unmentionable??
idk
bcs your discord name is hard to mention
right so where can we get help with the captcha bot i was sent here rfom support
i used a different piece of code but okay..
you used <hr>?
no
<br>?
i din't use html
yes
Do inspect element
Then use CSS to fix
i just realized, isn't that just the website??
you are on the wrong server, this here is the support server for the botlist, not the bot
how much time does the bot reviewing process usually take ?
check pins
2 weeks or more. See pins in #support.
yes..
Yes. Otherwise we won't be able to review it
yep
the bot has to be always online, bcs you dont know when the review is
anyone knows how to overcome this "byte" problem?
i dont know py, sry
documentation gives me nothing
oof-
same no py
py ezy đ
js easier
nah
#1 decline reason is "offline"
js makes me blind with all the { and ; and ()

yeah i imagine it would be the top 1 decline reason

not every one can host their bots right away
use repl then-
no thanks
then keep your computer on 24/7 lol
more problems than benefits
buy a Raspberry Pi and run it on it
using repl for the first time, not giving me luck, aka the "byte" problem
bro use repl its the easiest way
repl breaks my bot :/
tried it and it literally sucks
ohhhhhhhhhhh did u try the keep_alive.js/py
yes ofc
its something with my "byte" stuff in a hidden respority which i can't access
my bots running on repl and its 24/7
what about heroku ? is it good ?
its good
but confusing
ive seen bots on it that have 30 ping
omg can someone teach me how to navigate the site-
im getting lost
holy my windows security keeps picking up threats after it scanned none, the hell
jesus
or u can keep the bot on github desktop
i can guide u through that
repl gives to much erros
:/
windows security picking a "virus" up again
basically github but desktop version
search is downright broken in win11, :/
it does
hm
github = glitch but better
and freer
can someone name me back :/
ight ill try it out
wow

how do i remove it.. hmm
security and virus protection

GitHub is a code repository. Not a VPS provider... GitHub and Glitch are non comparable
mkay, soz.
windows security sent me another alert.
just switch it off then
well
for some time
not so easy
im confused now can you host code on github or not ??
yep u do
đ¤
My windows defender likes to trigger on a certain emoji in my discord cache. Has a Trojan embedded in the image somehow. Nothing I can do about it, thankfully itâs harmless.
if i inspect a thing it appears EntityPage_
Not sure if thatâs the reason for yours triggering or not
it says its own files is a virus-
win 11 is triggering some messy stuff with desktop :/
Windows 11 is in developer beta
yes
Of course its broken

and typing in any microsoft app is broken
including apps on microsoft store bruh
nooone else seems to have this problem
windows gone too far with the notifications
10 notifications on wanting to remove itself
now 12
..
also can someone help me with the quote_from_bytes() error?
im confused
I think you need to pass a bytes object into it
into where..?
the console doesn't say :/
windows tried removing itself 25 times now
In the function params
hmm
I'm not sure how you're using it even
okay i think me sending a message in discord is triggering windows
every message i get a notification-
nvm
ive quaratined it 15 times, its still tryna relaunch itself bruh
smart
yeah, i started few months ago but it's slooow so i moved to glitch
isn't against the tos to host bots on glitch-
It's against Glitch's TOS I believe
display: none;
you are not supposed to..
đ
niceeeeeeeeeeeeee
omgg change my name to normal
đ¤¨
hmm, nothing going on
tbh discord does a bad job at letting the user actually see what they bout to grant
noone cares about reading the scopes-
Collecting personal data is still not a great thing to do
is getting a premium host worth it ?
no
unless you really know what you are doing
and you really need it
Not sure if itâs against TOS or not, but if itâs not, then itâs still a scummy thing to do without the users knowing
then buy a premium host
No. The function, not your machine
but the users do know
nah
they are ignorant
yeah ?
The users âknowâ because they agreed to a ToS they didnât read. I still donât like the practice of such things
@young rune bro even i use repl
but repl giving me shit
:/
making an economy bot with repl
is giving me shit as i need to make databases for every user
yep i have a economy bot made with repl
can you use json files on repl ?
uhhh why would I need it-
its very easy to use
you said you were using a different database for every user
windows tryna remove itself for the 30th time
i don't use json
:/
how is possible that my bot with 100 guilds consumes less ram that my new 14 guild one?
im more of storing money instead :/
logical choice is a db for meh :///
SQLite or something
json is prone to corruption when it becomes large and also is not able to be written to from multiple processes as the fs locks the files to processes until it's freed. JSON should only be used to store configuration.
Trying to stream and parse data from JSON is also a nightmare
how is it possible that 100 guilds consume more ram than 14 guilds? isnt it kinda obvious?
less**
lel
different libs? different intents?
30k users in total
lots of channels?
yeah i don't understand this :/
yeah probably
Then what are you doing in development
i don't use databases-
but the 100 guild bot is in almost the same server as the new one
you can check how many channels and users both bots have
ok let me see
learning new stuff: learning how to say russian
Libs and intents arenât anything to do with databases-
OMG-
IDK WHAT LIBS AREEEE
dev isn't the place to learn russian
you dont know what a library is?
Discord.js is a lib
libraries dude, place you go to get books
Yes
new one is listening to 552 channels and old one to 15765, but still the big one consumes less ram
yes library i know
maybe is because the gateway intents, because the code is almost the same
which intents are you using?
only server members
do they use different libs or different intents was my question
do you fetch all members?
nope, should i?
Discord.js likes to eat more ram than any other lib
how many users do they have?
i use discord.py :/
small one 30k and big one almost 100k
..
pm2 metrics, the small one is using 356mb and the big one 156mb
does the small one use voice/music?
btw is it normal if my anti-malware is running at the highest cpu of my computer?
and the big one doesnt?
its at 25%
yes, they both do music 24/7
how many active streams?
how do i chech that ?
how many voice channels is your bot connected to
however many voice connections there are
big one 56 and small one 13...
can you log process.memoryUsage() in both?
looks that now is relaxing, but consuming more, the small one is now at 200mb and the big one at 93mb
still a lot for 20 servers for me
You told me you used repl when I asked you about the function itself
As dynamic databases - no. Use repl database or cloud database for that
im tryna make a unique key for each user
Generally speaking you could just use secrets as a substitute for JSON files on repl anyhow
use their user ID
so i used ctx.message.author.id
^
Not sure how repl works with such big ints
You could try saving them as strings and then converting them to int whenever needed
kinda weird how dpy converts them to ints
this is wierd... if i do ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB they both report using 107.97 MB, but in pm2 it says 200mb and 92mb, maybe is a linux problem? The big one is running on windows and the small one on ubuntu
im making an economy bot with a daily gift, and that is that when i check if the gift has been given, it gives me the error
log the full memoryUsage()
not heapUsed
That's not how you would measure memory usage either way
rss - (heapTotal - heapUsed)
wut
big one: main > { rss: 97951744, heapTotal: 72298496, heapUsed: 63276360 external: 20344085, arrayBuffers: 18510720 main > }small one: deKiro > 2021-07-03T18:21:36: { rss: 166109184, heapTotal: 92033024, heapUsed: 75047064, external: 20754566, arrayBuffers: 18925353 deKiro > 2021-07-03T18:21:36: }
ummm
How can I fetch every channel in the server?
I tried: ```js
await msg.guild.channels.fetch().then(channels => {}
But this doesnt work / exsit, so any Idea?
Why doesnt it use the thing?
just logs.send()
did you search it up? Im sure there are many examples.
rss is total alloc space for node. Heap total is for the process space and used is self explanatory.
rss still needs to be accounted for. heapTotal - heapUsed returns the free memory for the process which you would subtract from the residential which gives true memory usage.
Searched it, couldnt find sth
you dont need to subtract that
its reserved by the process, the os cannot claim it
so it counts as the total memory used by the process
its not free if it cannot be used by other processes
yes. You still need to take the residential set into account when calculating usage with node
yeay, but is that normal?
looks like windows is swapping out some of your rss, but the rest looks normal
no idea why the small one uses more
shut up

they are both using the same external memory, but the small one is using more heap, which implies more s storage
if you're sure its not discord.js then it could be something else you're storing in js memory
I was gonna recommend taking a heapdump earlier
canvas maybe?
No one other than you should read it tho since it has your client's token
is it possible for the bot to change its profile picture on its own at a certain time?
discord.js?
client.user.setAvatar iirc
canvas can use a lot of memory if you use high resolution images and canvases
can anyone help me do it?
I just gave the answer. Look at the discord.js docs for an example

@quartz kindle
the gateway intents
use 200mb
i just turned them off and now its going as intended
um anyone can help me with umm import pynput.. like whenever I type it in python IDLE it does nothing
I got this:
if(!logs.me.hasPermission('SEND_MESSAGES')) {
message.channel.send(messageE)
}```
And yet discord still gives me error on console and doesnt reply with the embed.
I thought u have a solution to my problem ;-;
sorry i use javascript đ
well its javascript
ye miss typed.
hasPermission iirc is deprecated tho
btw I use javascript too.. recently learning python
nice.
?
it got replaced by permissions.has()
WHAT






