#development
1 messages · Page 1920 of 1
i told u :/
and execute it
execute this on console again:
rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i
pretty sure the PATH variable is not persistent on replit
dw we're almost done
on new line ?
perhaps
@azure current did u get any error?
no on console
@azure current did u get any error?
oh fuck my bad
not on the replit console
on replit shell
fucking replit has two diff console
oh
@azure current execute them on shell
optional
ok next step @azure current
execute this on shell again:
rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i
done
@azure current no errors?
yes , i dont have
@azure current can you see package.json? if so remove the scripts: {} and replace them with:
"scripts": {
"start": "node ."
}``` and then start your repl
to check if the version is correct, add console.log(process.version) somewhere in your index.js file
^
done
@azure current start it
which version does it show?
yep it didnt gives me
which version need to be ?
^
just say which version it is
where need to see it ?
im sure its v16
did you add console.log(process.version) in your index.js?
@lyric mountain sorry but it works fine anyway I just didn't think about how I'm going to update it if a new command or plugin gets added to the system is there anything tipped maybe?
because discordjs will return an error if its outdated
do a single insert op then
gotta say, the system you have currently is not scallable at all
why?
use blacklisting instead of adding all commands in a table
lets say you have 30 commands
with 1000 servers that's 30000 entries in a table
with blacklisting you can store disabled commands in the same table as server configs
and for premium commands you can just use a boolean field to decide whether to allow or not
so what would be the problem so i know the load problem can't come from having a lot of entries in a table
the load problem does come from a lot of entries
imagine you update a command's name
or add new commands
you gotta update for ALL guilds
title cant have markdown
neither title nor footer
and markdown includes mentions
or author
which is a smaller title
no mention for u then
command name update does not update anything rather the command is deleted and created which refreshes rather adds line / delete
but embeds don't ping anyway, so just go with user name
but you gotta update available commands on the database
ye
why should?
there is no event that should
all you need to do is create and delete
if you change command name you'll lose parity
and if you create a new command that's O(n) inserts
meanwhile a blacklist would be O(1)
guildid | disabledCmds
1234567 | [1, 2, 3]
instead of
guildid | commandId | disabled
1234567 | 1 | true
1234567 | 2 | true
1234567 | 3 | true
1234567 | 4 | false
1234567 | 5 | false
1234567 | 6 | false
1234567 | 7 | false
1234567 | 8 | false
1234567 | 9 | false
I'm starting to understand what you're saying and it's a nicer solution.
there is a plugin that is not preenium but it has a command that asks for a prenum
so what do i do with the blacklist ??
because I don’t just need to know if it’s on or off
but i need to know if the plugin is turned on i also need to know how to claim this premium
i also need to know that the pranacs inside the plugin are turned on
and asks for this premium
iframe or css
thanks a bunch
Just add a property to the command
const premium = true
this is not usually stored in a relational database
Then when executing the command just check if (cmd.premium && !guild.premium) return;
Make a new column for it
khm 6 tables
Why is that ?
They could be a single column with an array of ids
But let's say you want those tables
Use blacklisting instead of whitelisting
So you exclude commands instead of including
why when cmd_list contains the basic settings of the command server_setting _cmd contains the command settings set on the server
<iframe src=“website url”>
Because you usually don't even need a per-command configuration
Most settings can be reused on other commands
I don't have it completely because the user disables certain commands or even a complete plugin
That's what I'm saying, you don't need to have a "disabled commands" table
Use a single column because it's VERY unlikely for the user to disable more than half the commands
there isn't
It'll probably be 3-4 commands disabled at most
GitHub is not a hosting service. It's merely a storage service where you can keep track of file changes and such stuff.
Server_settings_cmd
Wait you're not saying gitub is a git hub are you? 
Exactly, why have it in first place?
You could just store the disabled commands on a single array column
My brain is fried, I don't know
And premium and type columns can be stored in the commands table
but these are not exactly disabled
What about GITHAB 
now setprefix is disabled
But why have that structure
the premium is true
relational database
Relational database doesn't mean you need to use 30 tables for 30 settings
It just means tables can be related to each other
If you are working with data, we do not store JSON and other array formats in columns
cough codespaces cough
listen, i'm saying you've seen my solutions, i want to see yours so you know what's mine
You can store a serialized array
Good luck using that as a serious hosting plan
i can provide you bot to run host on my server machine
No
okey I just offered
hi
I'm not asking you to convince me I just want to see why your solution is better so that what I control is feasible
Sure, just wait till I get in my pc
my time is like the sea
those are my guild-related tables
I chose to use multiple tables due to the amount of configurations I have inside guildconfig
all the sub-tables (except rules) are blacklists
inside disabledcommands I list only disabled command names (which I check before executing it)
Can I overwrite a css property through a js function?
Like
Function fetches something
Changes the count to whatever the response is
u don't need to ovewrite a css property for that
why i feel like i delete all the table and do it according to your solution
I mean I need to overwrite an already existing text
guildconfig contains actual settings
disabledcommands only disabled command names
Like let's just say I want to change the test "YouTube" on YouTube.com to "Shittube" after fetching something
Is it possible
same for anything else
the master table is guildconfig, which holds all custom settings a guild can have
what kind of database is this ??
php
I use MariaDB
Does chrome extension support php
element.innerHTML = "NewText" or element.innerText = "NewText"
Also I don't want to change any dynamic value
sql is sql, they have the same principle
It's like a changing value
Ima go n study more about this topic myself and come back then
Thanks GoogleFeud and KuuaKu for help
now i am thinking of trying yours
if you already have a well estabilished db it isn't worth it to migrate
because i have to make a final decision i don't want to make 8 kinds of databases
you only need 1 database at all
not ready yet this is still very basic
Ayy I also use byechannel for config for leave message module
or make a converter yourself
the problem is that what you started with the database is very basic so not even half of it is ready and so you can change it at any time
sure, at the beginning you have the freedom to choose where you want to park your horse
yes the only question is where
I also made an interactive embed builder for welcome/bye embeds lul
people have too much trouble writing json for some reason
damn it i can't decide what
postgresql is very scalable, is actively developed and fares quite well against millions of requests per second

I don't have a dashboard for my bot because I'm lazy
because now we should figure out how to store the data
I will stay with MARIADB
sure
your current structure is not bad at all
you just need to switch to exclusive method instead of inclusive
instead of saving available commands, save unavailable ones
you also don't need a commands table, just use files for that
about premium? a single boolean property on each command
me neither, that's actually just a json generator
good but plugins are connected to the commands so if the plugin is disabled then the command if the plugin is not disabled then the command can still be disabled
it just generates json to be used with the command
keep plugins out of database too
make a property on each command to hold what category they belong to
By plugin I mean eg section
random command,
interaction
should i write from scratch or can i still convert?
generates this ```json
{
"title": {
"name": "Look, I am an embed!"
},
"author": {
"name": "This is an author"
},
"color": "#ffff00",
"body": "Damn this is a sick embed.",
"thumbnail": "https://cdn.discordapp.com/icons/264445053596991498/a_8c65db889e7834620df19245d04dda5c.png?size=96",
"footer": {
"name": "Tf an embed???"
},
"fields": [{
"name": "The field",
"value": "Hey am a field!",
"inline": true
}, {
"name": "The what?",
"value": "No I am a field",
"inline": true
}]
}
yes, categories
in my case
then on a command:
i use Node.js
same principle
true
only i would store the categories in the database as well as the commands belonging to the ahot because it is easier to get the commands belonging to the category on the web dashboard
sure, up to you
just keep things minimal
choose the option that uses less database storage
and returns results faster
just how do i start converting my current database and code
I'll leave that to you, but I recommend using an actual database manager for making structure
unless you like writing ddl
i can use the database manager in my database
because I like the look
idea good?
and then nicely [id, id, id, id]
you don't need premium columns
and use TEXT for those data
varchar is not big enough
actually, if you're gonna use ids then it's fine
why is there no need for a premium?
cuz u can store that on master guild table
and command table
just a boolean field with false for normal and true for premium
i will try to do it afterwards i would like to show that this idea is good
anyway how many characters a server id because so far i always give it 255 varchar
for mysql-based dbs I'd not risk more than 191
ye
I store so much information about the server and make a separate table for the plugins like the welcome system
yes I guess so, it's hard to visualize the entire structure without the plan
Prenium
at the moment i am doing this kind of structure because that way I can do things nicely separately
now that it has it i should upload data to the lists and then write it to the bot on the server joint
I guess so
Im trying to randomise a word, well characters of a word
var word = "mother".split('');
_ = require("underscore");
var toguess = "";
for (var i = 0; i < 5; i++) {
var index = Math.round(Math.random()*word.length);
toguess += word[index];
word = _.without(word, word[index]);
}
console.log(toguess)
Output:
[ 'm', 'o', 't', 'h', 'e', 'r' ]
ormeh
sometimes its undefined
I want bot to learn from previous messages and send random output
Well not really but like
For eg - 1+1 is 2 , this is gay and etc
Bot randomly generates sentence by taking random words from each sentence like "1+1 is gay"
Should I use AI or just use a randomise function
How to fetch the name or ID of the user who voted the server?
save messages in json for example, then you can randomise content
e.g. message[2] + message[3]
if thats what u meant
yeah message[random]
Ight thanks
errr...why don't u just use <array>.sort(() => Math.random() > 0.5 ? 1 : -1)?
and please
FOR THE LOVE OF GABE
stop using var
i didnt know sort exists
var is bad, it hates you and you should too
no, like, var is really really really bad
var is just global?
that
that means it gets declared before you even create it in the code
and this leads to VERY weird errors
plus every single IDE will scold you for using it
@lyric mountain
since i thought this doesn't work the previous method so i wrote it but i think this can be simplified as well
let disabled_category = [];
let disabled_commands = [];
con.query(`SELECT * FROM category_list WHERE category_default_type=?`, [0], (err, cat_list) => {
cat_list.forEach(cat_list => {
disabled_category.push(cat_list.category_id);
});
});
con.query(`SELECT * FROM commands_list WHERE commands_default_type=?`, [0], (err, com_list) => {
com_list.forEach(com_list => {
disabled_commands.push(com_list.commands_id);
});
});
con.query(`INSERT INTO server_settings (sid, server_prefix, server_lang, server_prenium, disabled_category, disabled_commands) VALUES (?,?,?,?,?,?)`,
[message.guild.id, '-', 'en', 0, disabled_category, disabled_commands])
you should use for-each instead of forEach btw
for (const cat of cat_list) {
// Do stuff
}
you're also redeclaring the variable inside those forEaches
js is an error
oh i didn't know that
hmm?
cat.category_id
uff
not cat_list.category_id
that just reverses the word lmao
just realised
show how you're doing it
ah i always round it thats why
not only that
but it'll never be higher than word.length
it'll always be a value between 0 and 1
@lyric mountain
HMMM
this is not how it should look
?
it works fine now, thanks
you're probably storing as a single value
I'll give him one more
where is that?
sql: "INSERT INTO server_settings (sid, server_prefix, server_lang, server_prenium, disabled_category, disabled_commands) VALUES ('905339502569086986','-','en',0,1,2, 3)"
stringify it
one minit
it's taking the array as inputs not as a whole thing
nice
to revert just use JSON.parse()
i already know that from webprogramming
sorry I'm asking for so much help but I haven't had anything to do with this kind of storage yet
but is that a good way to think?
sorry for the stupid question but where are you real
How can I make it so it deletes its previous message, so it does not spam in-between messages?
perrty good
@lyric mountain
this is how it looks now
Thank you so much for every help you gave me because it helped a lot. I'm trying to prosper with it but if I have any other problems I hope I can turn to you. Really thank you so much and have a great day 😉 ❤️
any feedback on this?
is possible bot start audio call in dm?
Nope.
oh ok
you're welcome, keep the motivation high and you'll reach great heights
🍺 🤪
what reason of reaction collector doesnt work and i dont get any error logs
Hi
nah nvm, i just forgot about Intent
Hi
I'm trying to store api keys with their associated owner, and then store image ids with the api key which uploaded them, and I can't find how in JS
you need to be more specific
have you got the database set up?
with columns including the image id and api key?
No database yet
I'm stuck between mongo and mysql
what would be best for my use case?
Something like ?
owner: String,
key: String,
image_ids: [String]
Storing in the format
key: XXXXXXXXXXXXXXX-XXXXXXXXXXXXXX
owner_id: 0000000000000000000000
then a different table
imgid: XXXXXXXXX
key: XXXXXXXXXXXXXX-XXXXXXXXXXXXXX```
Use postgres over mysql/maria
Or uploader ID
if you absolutely were dead set on going mysql, use Maria (it's a compatible fork of mysql and is better)
Thats what my webserver uses
One DB, two tables
Make 2 collections if in Mongo
key: XXXXXXXXXXXXXXX-XXXXXXXXXXXXXX
owner_id: 0000000000000000000000``` in the table api
imgid: XXXXXXXXX
owner_id: XXXXXXXXXXXXXX-XXXXXXXXXXXXXX``` in the table images
same database, different tables
That's a good format
Its more how do i do it in js Lmao
What part exactly
Getting the data from it
and saving it lmao
I usually use Python and I'm only just able to use EJS, so I'm clueless with databases
https://www.npmjs.com/package/mysql this may help
<mysqlConnection>.query("Some SQL Here", function(error, results, fields) {
/* Do Stuff */
})
if you really don't know anything about sql/mysql you might want to use the sequelize driver which abstracts the sql queries behind json queries and documents
or just use mongodb
which is schema less and easy to learn
like this
you type your sql query in the string
and then you can use fields to iterate over the rows
yoooo text input component pog
wait i hope that doesn't count as advertising
lemme delete the invite
I'm more interested in that embed actually
That was quite an embed
con.connect(function(err) {
if (err) throw err;
var sql = "INSERT INTO images (imgid, owner_id) VALUES (`${imgid}`, `${result.owner_id}`)";
con.query(sql, function (err, result) {
if (err) throw err;
res.send("etc etc")
});
});```
I see concatenation, no good
plz use promise based db drivers 
other than sql injection and callback hell good start
I also see var
i'm only working on the getting of the data now
also if (err) throw err; is a good way to crash your app
blame w3schoosl
yeah stop using it
oh its already crashed many times
what db should i use then
oh dear
use this library instead https://www.npmjs.com/package/mysql2
it's much better
and supports cleaner syntax
ok
yes
idk where people are seeing this if err throw err pattern though it's really bad
here's another lib i've heard good things about https://www.npmjs.com/package/better-sqlite3
Havent programed in a while so kinda forgot some things
it is a quick way to halt your application and gives you information on the error i guess
only in development though
should I move the function into the command?
people think they can catch that error too which is also problematic
Also this bot is going to have like 1-5 commands
yeah its a good library if you want a sqlite database
doesn't use await yet its non blocking
i've actually never used it before, dont know sql 😬
tyty thats working
it now returns what i need
nice
const fetchedLogs = await channel.guild.fetchAuditLogs({
limit: 1,
type: 'CHANNEL_CREATE',
});
// Since there's only 1 audit log entry in this collection, grab the first one
const channelLog = fetchedLogs.entries.first();
const { executor, type, id, name } = channelLog;
if(!channelLog || !channelLog.available) {
return;
}
why not working but if i did it
if(!channelLog) {
return;
}
only it works
you can thank discord js for that
yep
update your node version to >= 16
ok
because they insist on using the newest features the language has to offer not considering older programs
just gonna use node-fetch with the api
I don't know too much about audit logs but could you try logging the entirety of fetchedLogs
ah
@spark flint help me?
with...
How long is that Waiting?
a few weeks
I think
Tnx
in order to use await, the parent function must be async
which means the function or callback that is the direct parent of your current block of code
Help me please
Error: Cannot find module '../botconfig/config.json'
Require stack:
- /home/runner/jhgfrftgyhzujidkuhdnjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/auth-client.js
- /home/runner/jhgfrftgyhzujidvfdjhednjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/sessions.js
- /home/runner/jhgfrftgyhzujidkoluhdnjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/middleware.js
- /home/runner/jhgfrftgyhzujidkolcvfdjheduhdnjyioqsminfbqheuhizn-1/dashboard/index.js
- /home/runner/jhgfrftgyhzujidkolcvfdjheduhdnjyioqsminfbqheinjsbdin-1/bot.js
async function() {
something(() => {
// this is not async
})
}
whats your folder structure?
ah
and wtf is that indentation
is line 44 supposed to be the end of the err => function, or the end of the post function?
lel
help me pls

replit folder structure is /home/runner/<repl_proj_name>/...
why isnt it setting the key "foo" to my redis db
const redis = require("redis")
const redisClient = () => {
return new Promise((resolve,reject)=>{
const client = redis.createClient({
url: process.env.redis,
no_ready_check: true
})
client.on("ready",()=>{
resolve(client)
})
client.on("error",(e)=>{
reject(e)
})
})
}
const a = async () =>{
try {
const client = await redisClient()
client.set("foo","bar")
console.log("hi")
} catch(e) {
console.log("error",e)
} finally {
//client?.quit()
}
}
a()
code ^
dont create a connection in a function that will be run often. Make 1 connection or a pool of connections
oh it ?
in which file do you have require("../botconfig/config.json")
thats not what i asked lol
@nova basin try using js require(`${process.cwd()}/botconfig/config.json`)
the "../" arg i mean
its just a matter of using relative paths properly
and even if you want absolute paths, its probably better to use process.cwd() instead of hardcoding it
oh yeah
how
in which file do you have require("../botconfig/config.json")?
yes
yes i have
lmao
french
dans quel fichier as tu ce code ?
dans quel fichier avez-vous le require() ?
ah shit
lol
alr u got this Tim
wait
Poor Tim… trying hard even in baguette language 
omelette au fromage
- /home/runner/jhgfrftgyhzujidkuhdnjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/auth-client.js
- /home/runner/jhgfrftgyhzujidvfdjhednjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/sessions.js
- /home/runner/jhgfrftgyhzujidkoluhdnjyioqsminfbqheinjsbdiquhizn-1/dashboard/modules/middleware.js
- /home/runner/jhgfrftgyhzujidkolcvfdjheduhdnjyioqsminfbqheuhizn-1/dashboard/index.js
- /home/runner/jhgfrftgyhzujidkolcvfdjheduhdnjyioqsminfbqheinjsbdin-1/bot.js
sigh...

dans quel fichier as tu ce code ?
require("../botconfig/config.json")
i have changed
I had changed with .../.../
if you have:
- bot.js
- botconfig
- config.json
then its ./botconfig/config.json
not ../
you use ../ to go one folder backwards
for example if you have:
- somefolder
- bot.js
- botconfig
- config.json
then you use ../ in bot.js
./ = this folder
../ = previous folder / 1 folder back
hum okeyy
- file1.js
- folder1
- file2.js
- folder2
- file3.js
- folder3
- file4.js
- file.js <- require("./folder4/file5.js"); require("./file4.js"); require("../file3.js"); require("../../file2.js"); require("../../../file1.js")
- folder4
- file5.js
Might be a good idea to set an environment var with the absolute root path of your project at some point
Instead of jumping 1000 times to the parent folder
Imagine changing the structure once

or just use process.cwd()
Now have fun explaining that in French
I fucked up my home server
yes yes hot dog 
Shouldn’t have shopped hardware before experimenting with the limits
Bought NVME drives mounted on PCIE cards as RAID1 OS drive
Turned out the board doesn’t support booting from PCIE
Not without modifying the BIOS
rip
I still lots of other RAIDS also a RAID1 SSD but they are significantly slower than NVME of course
Since they are SATA
Qvo
Having like a dozen VM on SSDs with just ~ 500 MB write speed instead of 3500 is eww
Well it was supposed to run Proxmox
is proxmox based on linux?
Now I’m forced to go with Windows to test if there’s a driver supporting NVME PCIE boot
Debian
if so, then you only need a non-pci drive for /boot
everything else can be mounted in the pcie
Yeah all drives can be used, that’s not the issue
The issue is any other drives are connected via a hardware RAID controller which isn’t supported by Proxmox
rip
And yeah the RAID SATA SSDs should be the database
patch the bios, if anything goes wrong, RMA the boards :^)
Now since I can’t boot from the PCIE NVMEs it will get the database
Which is overkill
And you’re aware of how to do it, enabling PCIE boot support?

Modding the BIOS
not really, but i've seen plenty of universal uefi bios patches for nvme related stuff
does it use AMI bios?
Yeah
Let me get the name real quick
lol saw that article a few seconds ago, too
Can’t open it
Blocked by pihole

Yeah the board has an Intel gen 6 chipset
you and your pihole
It’s supported since gen 9 or something
if you dont want to mod the bios
Alternative methods to use an NVMe SSD as bootable drive with older systems (no BIOS modding required):
"Clover-EFI Bootloader Method" (the related guide written by our Forum member Nyctophilia can be found >here<)
"DUET-USB Boot Method" (the related guides written by our Forum members noInk resp. mireque can be found >here<, >here< and >here<)
It is no problem to get a PCIe or M.2 connected NVMe SSD working with any Intel Chipset system from 6-Series up without modifying the mainboard BIOS, if
a) the NVMe SSD will be used for the storage of data (as drive D:, E: etc.) and
b) an appropriate NVMe driver is present within the Operating System (either natively or loaded/integrated),
but the usage of such SSD as bootable system drive C: (incl. the boot sector) usually requires a special mainboard BIOS EFI module, which has to be loaded while booting.
quote goes wrong
There’s probably no appropriate driver, that’s the issue I mentioned
That’s why I said I will need to test Windows
Note: Some NVMe SSDs like Samsung's 950 Pro SSD are natively bootable in LEGACY mode (CSM and loading of Option ROMs has to be enabled within the BIOS), because their Controller chip contains its own NVMe supporting Option ROM module.
Also tried that
But no
I’ve got 870 Evos Plus
Err 970
Gonna investigate the rest later after some sleep
Found another good article as well as this one
Looks like it could work, maybe
Oh gosh I see it’s getting complicated
Could use the small SATA SSD as bootable device installing grub and moving the boot partition to the PCIE
Since I don’t need the small SSD anyways
Well I guess I can only fuck it up since I haven’t tried that before
You could avoid doing fetching as much as possible if you check if the string matches /\d+/ and if you deconstruct the ID, the timestamp should be less than the current timestamp (0 is Clyde's ID, so it is valid. Discord's Snowflakes start at 0 which is when Discord's Epoch was.) If either of those return false, then you know it isn't an ID. Otherwise, you will have to try to fetch it via client.users.fetch(id) and handle possible promise rejections appropriately.
If you know how, I think HEAD requests work on /users/user_id
when i do kill("SIGINT"); on a child process (child process is started with: const { err, stdout, stderr, kill, pid } = exec('funny_child.bat', { async: true, silent: true });), does anyone know why it outputs "TypeError: Cannot read property '_handle' of undefined"
(its an error)
was the child already killed? Are you using some kind of child_process wrapper?
The process will exit when it reaches end of code execution

bru
cant kill whats already dead
killing children intensifies

i hate my life ill figure it out
(if you wonder why it says error, i made it an error lmao)
spawn("taskkill", ["/pid", pid, '/f', '/t']); because its windows .-.
bru
thx
snake_case_in_js 
what_in_the_python_fuck
discord_js_users 
you used djs until recently 
question:
in this react component:
function Timer() {
const [time, setTime] = useState(0);
function start() { /* ... */ };
function stop() { /* ... */ };
return (<div className="container has-text-centered">
<h1 className="title is-family-monospace is-1">0.00</h1>
<div className="buttons">
<button className="button is-black" onClick={start}>Start</button>
<button className="button is-danger" onClick={stop}>Stop</button>
</div>
</div>);
}
the start and stop functions are recreated every time the component rerenders
how do I make it so they're only created once?
bulma didn't even center the buttons
i use this ```xml
<body class="has-text-centered has-background-white-bis">
you can use this too ```xml
<div class="box has-text-centered">
`totalmembercount = len(guild.members)
membercount = len([m for m in guild.members if not m.bot])
botcount = totalmembercount - membercount
if botcount > 100:
await guild.leave()`
Can I use this in owner only command ?
Const out of the function?
Aka file-level functions
Because they're using hooks you generally keep the hook variables within the rendered functional component.
Ah
You don't that's how these work.
Not familiar with hooks personally
You can read about useEffect and useCallback or useMemo if you really want to get into keeping track of state and preventing rerenders based on specific inputs.
Thanks
ok thanks
`@client.event
async def on_guild_join(guild):
totalmembercount = len(guild.members)
membercount = len([m for m in guild.members if not m.bot])
botcount = totalmembercount - membercount
if botcount > 30:
await guild.leave()`
i used this
but still my bot havent left any servers
i just discovered property files and they are awesome 
pls dont ignore this pls
i have to verify my but if someone not invited my bot to any bot farms
no errors?
not left any servers
nope
on_guild_join will only work if the bot is invited in new guild
oh

try creating a new server and invite your bot
so
ok
but it not gonna leave as it dont have 30 bots in my server
can i make a command ?
@earnest phoenix
my friend has 30bots+ in his server
yea
ok
tell him to invite
@dense flame can i send them the server invite
if they asked for it then sure
nope
counted as help
: )
@earnest phoenix oh wait, dm me your bot invite
ill invite it
ok
hello only i experience that node js in the client.memers.cahce.size / guild.memers.cahce.size does not return the real value?
returns the number of the word but the real one
pl
the bots are filtered, 4 of which are on the server
but isn't that a good number?
Does anyone know anything about this?
what it is and how it can be remedied
You also have a typo in that
client.members.cache.size
It's cache
It's almost never correct
jQuery?
i got it 15 seconds ago yea
and how can I solve it to be correct

because if I write client.members.size it will return an error anyway
yes but i would like to filter out eg only online users or not to bots in etc ...
my code
not bot
guild.members.cache.filter(member => !member.user.bot).size```
not offline user and not bot
```js
guild.members.cache.filter(member => member.presence !== null && !member.user.bot).size
does not return an error but returns untrue numbers
exactly
I understand but it is possible not to get it from the cache and be able to filter it
Not all members are cached at any time
The presence requires an privileged intent btw.
There’s a property you can access called memberCount with the guild object
yes i just can't filter it
The current member count is only being sent in the ready event or guild_create
You can… using reduce to add the memberCount together of any cached guild
But how ?
That array is useless
If you already loop the guilds, simply access the property
Just use the channel search, it’s useful sometimes
One of 1000 examples
How can I do like that?
I need to force the bot to wait and if it got any other embeds to send it send them all in the same message
there's a setInterval rerendering it every millisecond ofc I want to memoize it
i think they meant batching multiple logs into one message
just to let you know if you don't import jQuery $ will become document.querySelector
$$ => document.querySelectorAll
const logs = [];
setInterval(() => {
logChannel.send({ embeds: logs.map(log => new MessageEmbed()) });
logs = [];
}, 5000);
and you need to remember to only send the first 10 items
Oh ty
.shift the array 10 times
and delete only the first ten items
yeah
forgor
pushing to an array doesnt modify he whole variable. Unless he is totally modfying what logs is, he can use const
logs = [];
let logs = [];
setInterval(() => {
logChannel.send({ embeds: logs.slice(0, 10).map(log => new MessageEmbed()) });
logs = logs.slice(10);
}, 5000);
I hope I put the correct indices
👌
@quartz kindle I'm fucking DOING IT!11! Wish me luck modding the BIOS
what can go wrong

KERNEL.SUS
Omg thought I’m dead after fan spin and 4 th reboot
Back in BIOS
But still doesn't mean it worked
Need to figure that out yet
do what
I swear I’m sweating… 
I'm being gaslit
don't use static types then
good idea
and please do not use python
use js
best dynamically typed language
yes but python is more terrible
and you're forced to use js for browser cuz there totally isn't smth that starts with web and ends with assembly that can run any programming language in the browser
since when does js have a purpose
other than annoy
How can I pop out an attachment after following up when updating using the .update() method?
It's for testing?
When I added an attachment, that's fine, but when I .update(), I have two attachments, how can I remove the old one?
can you even edit a message's attachments?
you can't add a new one to the same message
I'm just trying to pop out an attachment. 
You can.
When you are editing, check my code.
How can I remove an attachment when I do .update() since it sends with a message and I don't want that.
Basically when I attach something to send with a message, I want to edit it afterwards and use a different attachment, but the previous attachment is yet there, how can I remove the previous one?
is the page broken for anyone else too? https://www.oracle.com/java/technologies/downloads/
im trying to download jdk but the page is just white
Whats the error
its task not tasks
It's just white
use terminal
when
Go to one of those filehippo URLs
Real and legit
is that sarcastic
i am downloading it and slightly concerned
For some reason:
oh their archive page works
thank you
i thought i had to login
i usually make a new oracle account each time
How yall doing?
res.send is not a function
What’s your code for that
Maybe you put (res, req) => instead of (req, res) =>
Oh, never used axios. Thought you were using express
I’m going to assume that res is not the type you think it is though
I am
I'm using Axios to sent requests
Try logging res
(In your .then())
Also pro tip: use ESLint or something similar and set it to format on save so your code looks consistent, that was a life saver for me when I started to use a linter
await is usually the way to go
how do i break out of a foreach loop
guild.channels.cache.forEach(channel => {
if (channel.type === "GUILD_TEXT" && channel.permissionsFor(guild.roles.everyone).has("SEND_MESSAGES")) {
channel.send(cum).catch(err => {
if (err) {isErr = true;}
});
}
return;
});
Can you guys suggest to me a good hosting provider
MVPS is a European VPS company which aims to offer high quality VPS services by using high performance hardware. Get your cheap VPS for only 3 EUR!
why do you want to break?
so it doesnt spam every single text channel
so you want to find the first channel that matches the if statement?
use find then, not forEach
go look at all the array methods on mdn, you very rarely need for loops or forEach
the only way to stop a forEach is to throw an error
foreach if you do not stop i will have to take drastic measures
concat is slow
passed like 1 month since i did a question here
then?
the spread operator is faster
the ...?
array = [...array1, ...array2]
ok
thx @quartz kindle but
(node:787) UnhandledPromiseRejectionWarning: TypeError: array5 is not iterable
what does mean that?
let array5 = db.get(leg_${message.author.id});
so theres your answer
thx
👍
or just use elvis (or a null coalescing operator)
or null coalescing assignment
There is a much better place 🙃
array5 ??= [array5]
js never fails to surprise me
^ need node > v16 for it
yet noone invented a sqrt operator yet
squirt operator 
bonk

sus
I guess so
thats comments lmao
/*/
really it makes no sense
just use √ duh
stop bragging abt ur keyboard with sqrt symbol
++, --, ** are all math operators, why the fuck is // a comment
what i just copy pasted from the ascii table 
But preprocessor directives 
tim you would singlehandedly make millions of js programs fail
lmao
Tim, Finisher of JS
for fucks sake
i was downloading a huge file on my slow internet and it kept going "network error" and i accidentally clicked cancel
Lol
this is why i use torrents
rip
i am downloading intellij idea ultimate to flex my student subscription
jet gang
actually, they could make a sick ads punchline with that
"Why XXX when you can have a jet!"
i just renewed my license altough i graduated university last month 
yeah i just renewed it too
cause my email is still valid
still in school though just higher
ffs being an adult is going to be hell
not only am i not able to take full advantage of my work income due to salaries being taxed to hell in the uk but i have to manage tons of other things
corrupt government
#taxtherich
thats why people become pirates
Traceback (most recent call last):
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\application\command.py", line 424, in sync_application_commands
cmds = await self._state.http.bulk_upsert_guild_commands(
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\http.py", line 365, in request
raise Forbidden(response, data)
diskord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
what does this mean?
bruh
salaries are probably like 4k euros
lmao
uh hello
missing access
thats not much
you tried to access something that you have no access for
have you tried googling your error?
There’s this thing called the American tax: your entire bank account is emptied when you get injured or have a condition that requires treatment
for example a message in a channel that the bot cant use
i was kind not to include america
hi
some people rather would die than face the medical bills
i'm still learning
Google your error
they pay like 500 bucks a month for health insurance and still get hit by 100k+ medical bills
ouch but isn't american healthcare better than the nhs?
what do you consider better
thats what they say lmao
I don’t know what the nhs is but it’s probably far better than American dogshit
but its likely not true
if they manage to fix you up thats all that matters lmao
I’m a diabetic and until recently (when they passed a new law in Texas) my family was paying $800 for 1 month of insulin supplies
And that’s WITH insurance
better by doing something rather than being like wait a week and call back if you still have the same issues
that is a fucking scam
For insulin that costs companies $70 per year per patient to make
It should be completely illegal
To sell insulin at that high of a profit margin
Good money though
as long as the economy is thriving they dont care
Literally can’t
They have politicians in their pockets too
america is a corporation and its people are its assets/products
That’s why nothing ever gets done about it
It’s ridiculous that people should even have to pay for medicine that they require to live
It’s putting a price tag on your life
still nothing
Google harder
and still most people really dont realise how cruel the world is
What is your error
Insulin is only the surface of overpriced medicine
scroll up
Traceback (most recent call last):
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\application\command.py", line 424, in sync_application_commands
cmds = await self._state.http.bulk_upsert_guild_commands(
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\http.py", line 365, in request
raise Forbidden(response, data)
diskord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
People get into 100s of thousands of dollars of debt because they have a heart attack and require surgery and stuff like that
What exactly are you trying to do
Conspiracy theory!
Cause you clearly don't have the correct permissions to do it
what happens if you get put in a coma
Even if you get saved by the doctors your life is essentially condemned into death by debt
yeah i saw tons of news documentaries about these
this
What?
It’s ggs
and a lot of the time the insurance refuses to pay more
there are tons of people who beg doctors not to save them, but doctors do it anyway
Should probably move to general
because people in this chat have more developed brains
PS C:\Users\DragonGod\Downloads\Dragon_bot_demon> c:; cd 'c:\Users\DragonGod\Downloads\Dragon_bot_demon'; & 'C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\python.exe' 'c:\Users\DragonGod.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\python\debugpy\launcher' '59266' '--' 'c:\Users\DragonGod\Downloads\Dragon_bot_demon\main.py'
Loaded addrole.py
Loaded ban.py
Loaded giveaway.py
Loaded hackban.py
Loaded kick.py
Loaded mute.py
Loaded muterole.py
Loaded purge.py
Loaded slowmode.py
Loaded unban.py
Loaded unmute.py
Logged in as Dragon Castle#1377!
Traceback (most recent call last):
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\application\command.py", line 424, in sync_application_commands
cmds = await self._state.http.bulk_upsert_guild_commands(
File "C:\Users\DragonGod\AppData\Local\Programs\Python\Python310\lib\site-packages\diskord\http.py", line 365, in request
raise Forbidden(response, data)
diskord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
trying to do this with slash commands
So ima assume you don't have the correct scopes then
