#development
1 messages · Page 1979 of 1
it should be the exact same way you add a button to normal messages
tim never misses a chance
thank you lord thor
Aye... he's continuously fighting for his title & badge, "The ultimative development troll"

i dont need to fight for it, its just who i am :^)
:P
TypeError: Cannot read properties of undefined (reading 'send')
Getting that error when I do:
let server = await client.guilds.fetch("678717822406492187");
await server.members.fetch();```
This is in my ready.js file
full error and code: https://srcshare.io/?id=620a590e23709311a0a19b69
Discord.js v13
That error has nothing to do with the code you showed
I don't see any send method in there
its from GuildMemberManager lmao
Also if you ever wanna verify your bot, permissions: Discord.Permissions.FLAGS.ADMINISTRATOR that will prevent you from doing so
There's no need for admin perms for a bot
whats your discord.js version?
Its not a bot that I want verified, what does that error exactly mean though?
13.0.0
is your bot sharded?
No, its only in one server
and its the server you're fetching?
whats your intents?
show your client options
And yes thats the correct server I'm fetching
btw client.guilds.cache.fetch is not correct
its either client.guilds.fetch
or client.guilds.cache.get
Yes I just noticed that, someone from another server mentioned changing to cache.fetch and i never changed it back
in your case client.guilds.cache.get should work
couldn't they just abstract that into client.guild.get?
v11 was like that
ik but why add a new word when u could just keep the .cache part internal?
the idea was to make people aware
because people didnt know which methods called the api and which methods didnt
so they made the separation like that, everything under .cache does never touch the api
Its working now, thanks for the help
np
Hi I have a problem that I can't solve.
I basically have this bot that creates 3 rooms for me.
2 textual and one voice, to which it sets permissions to hide them from the everyone role.
Some times none become private, some only 1 and some only 2.
When it deletes them it can only delete the public ones.
I can't understand the reason, giving the admin role disappears the problem, I even tried to give all the roles that discord offers, but nothing changes.
show code
Okay nevermind, my issue is happening still for whatever reason
did you change anything?
I removed a console.log but other than that, no
your bot might not be able to see the channel
try updating discord.js
latest is v13.6
this.guild.shard.send({
op: Opcodes.REQUEST_GUILD_MEMBERS,
d: {
guild_id: this.guild.id,
presences,
user_ids,
query,
nonce,
limit,
},
});```
this is where the error is thrown in GuildMemberManager, if that helps at all?
Alright
your issue is that guild.shard is not defined in the guild you are getting/fetching
guild.shard only exists when the guild comes from the websocket
so you need the GUILDS intent, and you need the guild to be cached at login from the websocket
if you fetch the guild and for some reason the guild is not already cached, it will not have the .shard property
or could be a bug in the older v13 versions that would remove it for some reason
basically if(guild.shard) exists, then guild.members.fetch() will work
if for some reason it doesnt exitst, then you need to get it from client.ws.shards
can I make a command to follow, outages channel of the bot support server?
any idea how?
Anybody?
I have precisely 0 comments in 108 lines of code
My bot’s code is so freaking bad that I would need to make an documentation for myself to see how to use a function
tHiS iS WhY wE uSe TyPeScRiPt
You should look into self documenting code
Also jsdoc
https://en.m.wikipedia.org/wiki/JSDoc
JSDoc is a markup language used to annotate JavaScript source code files. Using comments containing JSDoc, programmers can add documentation describing the application programming interface of the code they're creating. This is then processed, by various tools, to produce documentation in accessible formats like HTML and Rich Text Format. The JS...
using comments containing jsdoc
I upgraded to 13.6.0 from 13.0.0 and now Im getting this error: [INTERACTION_NOT_REPLIED]: The reply to this interaction has not been sent or deferred.
It was working fine in 13.0.0, I am also using interaction.deferReply() and then followUp to reply so Im not sure what it means
show code
From the command or where Im using deferReply?
if (interaction.isCommand()) {
interaction.deferReply().catch((e) => {console.log(e)});
let cmd = client.slash_commands.get(interaction.commandName);
if (!cmd);
let options = interaction.options.data;
cmd.run(client, interaction, options);
}```
```js
interaction.followUp({
embeds: [embed]
})
Top is where its deferred, bottom is where im using followUp
Ik and I use it a little but the thing is I’m kinda lazy
you need to await the deferReply
otherwise you send the reply before the defering kicks in
Thanks again
mogus
How can I make a width value for my divs that is adjusting to the screen width like f.e. the divs of ||https://magiceden.io/marketplace/prickly_petes_platoon_og_cactoon_series||
Use flexbox
using % and vw/vh is also an option
can I do a % with min / max?
They're using flexbox so
ye saw that but didn't found more infos xD
just learn how to use it and do it urself 🤔 https://css-tricks.com/snippets/css/a-guide-to-flexbox/
aight thanks
Soim building a public anti raid bot I have a ruff idea of what I want to add but can someone help me make sure I'm not missing anything
||if this isn't aloud question I'm sorry ||
It doesn't need anything super special. It just needs to do its job. Don't waste your effort on features another bot can suppliment
Ok
what's your current basis?
anyone here running windows 11 and cannot select file ?
why does thid work in servers but not dms
no yk like how the windows have gui for selecting path
like where you select where to download games n shii
(python) I need help with this problem:
Write the Boolean function is_odd(n) that returns True when n is odd and False otherwise.
Outside the function, generate 15 random integers with possible values from 1 to 30. Invoke the function and, for each number, print if the number is odd or not. For example:
7 is odd.
18 is not odd.
etc..
I understand the first part which is
return n%2 != 0```
that's a browser-specific configuration
not windows'
what's the issue?
since i want to generate 15 random integers from 1-30, do i do
for i in range(15)``` idk what to do with thesew
is that a homework?
where that? never had any issue with w11 (except not being able to drag into taskbar)
well nothing related to coding just in ea launcher n adobe
the % symbol should be correct to determine if one number is a multiple of another number.
ok so, what you're doing there is generating a random value between 1 and 30 and discarding it
then you're looping 15 times and doing nothing
might want to do a test run and log results
you need to assign the random value to a variable while inside the loop
not outside
so inside a ( )
List comprehensions with range() could work well
no
it'd be {}, but python doesn't use brackets
it uses tabs
while (true):
scope
scope
whatever
so you'd have ```py
for i in range(15):
put
code
here
NOTE THE TABS
that's VERY important on py
ok, so it would look like
for i in range(15)```

the other way around
random.randint(1, 30) generates a number
for i in range(15) loops 15 times
you don't want to generate a number and loop 15 times
you want to loop 15 times and generate a number
ok
so far, i got this
import random
def is_odd(n):
return n%2 != 0
for i in range(15):
random.randint(1,30): #error messages on this line
if is_odd(i) != 0
print(i,"is odd.")
else:
print(i,"is not odd.")
yes, for sure it'd error
that's not how you're supposed to use a number
numbers cant have scopes
so you cant simply put : in front of it
you need to assign random.randint(1,30) to a variable
and is_odd() returns a boolean
not a number
so is_odd(i) != 0 would also fail
Quick question to Font-Awesome... I read that the free plan is completely open-source for non-commercial and commercial use. But what's with the pageviews? Do they really count them and like "block" the icons if you exceed the 10k/mo (Free plan)?
Each time one of your pages with a Font Awesome Kit is viewed, a pageview is counted.
I'd use some open source icon lib
Kits
The easiest way to use Font Awesome, all without pushing code.
like those from expo
yeah read the whole thing but never experienced it 🤷♂️
expo?
it's a react framework, but they have an icon library
last time i used fontawesome was like 8 years ago so idk, but im pretty sure they are refering to some website builder solution
you could probably use them in any node project
the actual font file cant possibly count page views
you can simply download it and self host it
true 🤔
I'm gonna try that one, thanks^^ looks pretty interesting
I have no idea HOW, but here is the reference page https://icons.expo.fyi/
and the lib https://github.com/expo/vector-icons
thanks I will take a look at it
how will u extract the svg is a different story
expo looks so cool in general xDD lol
it's a simplified react native
never used react native too... 👀
still pretty cool
for sure it is
you use expo?
yep, for my bot's homepage
lemme take a look at it rq xD
used to be a dashboard too, but I locked that section out
aight, pretty cool things out there I don't know yet :DD
embed.add_field(name="Uptime", value=str(timedelta(seconds=int(round(time.time() - ctx.bot.created)))), inline=True) why does this work ??
i get this error
why does it work or why does it not work?
doesnt
ohb yuh ctx.bot.created is the default value that python returns
how does one make that readable like not get the defualt discord.py value yk
I'm using node cluster in my bot with shards, but every time the cluster is generated I get multiple responses from the messageCreate event. does anyone know how to solve?
Is MessageComponent and Interaction?
yes
you need to convert both values to float
if created is an instance of datetime or something, you need to add .timestamp() or .time() to it as well
idk how py works
hey tim
are you perhaps spawning the same shards multiple times?
can you help me?
what library are you using?
discord.js and node cluster
show code
I'm creating 25 shards and splitting them into each cluster
const { ShardingManager } = require('discord.js')
const ClusterManager = require('../cluster/ClusterManager')
const cluster = require('cluster')
class ShardManager extends ShardingManager {
constructor(file, options) {
super(file, {
totalShards: options.totalShards,
mode: options.mode,
token: process.env['token']
})
this.clusterCount = process.env['clusterCount']
}
async spawn() {
await super.spawn(super.totalShards, 60000, false).then(() => {
if (cluster.isPrimary) {
if (this.totalShards < this.clusterCount) {
this.clusterCount = this.totalShards;
}
process.RodyBrozy.logger(`shard`, `ShardManager`, `Starting ${this.totalShards} Shards in ${this.clusterCount} Clusters!`)
const shardArray = [...Array(this.totalShards).keys()]
const shardTuple = process.RodyBrozy.chunk(shardArray, this.clusterCount)
for (let index = 0; index < this.clusterCount; index++) {
const shards = shardTuple.shift()
const cluster = new ClusterManager({ id: index, shards, manager: this })
cluster.spawn()
}
}
})
}
}
module.exports = ShardManager
Thought I'd listen to the events of the shards and send the child workers' processes to the parent worker
im having a hard time understanding the logic here
lol
you are creating a ShardingManager with totalShards, then inside the ShardingManager you are creating a ClusterManager for each chunk of shards?
but the ShardingManager is spawning the shards anyway?
like
how many node clusters are you running?
i'm creating some shards and splitting them, and i'm creating the clusters with each shard split into two workers, in each worker has 12 shards
^
whats your index.js?
bot or shard ?
whatever main file you have to start everything
const manager = new process.RodyBrozy.ShardManager('./src/discord/thebrozy.js', {
totalShards: Number(process.env['totalShards']),
token: process.env['token']
})
manager.spawn()
we cant
so you dont use cluster in the index? the only place you use cluster is in the ShardManager, and only to check if isPrimary?
no
no what?
I'm using cluster in ClusterManager class
show ClusterManager
I will send you the class
const { EventEmitter } = require('events')
const cluster = require('cluster')
const ShardManager = require('../shard/ShardManager')
const TheBrozyFile = require('../../../discord/thebrozy')
const ClusterOptions = {
id: Number,
shards: Number
}
class ClusterManager extends EventEmitter {
constructor(options = ClusterOptions) {
super()
this.id = options.id
this.shards = options.shards
this.manager = options.manager
this.worker = cluster.Worker()
}
async spawn() {
this.worker = await cluster.fork({ CLUSTER_SHARDS: this.shards.join(','),CLUSTER: this.id.toString(), CLUSTER_COUNT: this.manager.clusterCount.toString() })
process.RodyBrozy.logger(`cluster`, `ClusterManager`, `Worker ${this.worker.id} spawned in cluster ${this.id.toString()} with ${this.worker.process.pid} pid`)
TheBrozyFile(this)
this.manager.shards.map((shard) => {
process.RodyBrozy.logger(`cluster`, `ClusterManager`, `Shard ${shard.id} spawned in cluster ${this.id.toString()}`)
})
}
}
module.exports = ClusterManager
thebrozy.on('messageCreate', (message) => {
if (message.author.bot) return
if (message.content === 'teste') {
message.reply(`teste`)
return
}
})
I'm getting message.reply() several times
no
add this console.log in your ShardManager:
async spawn() {
console.log(`spawning ${super.totalShards}`);
await super.spawn(super.totalShards, 60000, false).then(() => {
I will send you my console
shard:ShardManager [14/02/2022 17:19:06] [INFO] Starting 2 Shards in 2 Clusters! +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Worker 1 spawned in cluster 0 with 1164 pid +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Shard 0 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Shard 1 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Worker 2 spawned in cluster 1 with 1165 pid +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Shard 0 spawned in cluster 1 +0ms
cluster:ClusterManager [14/02/2022 17:19:06] [INFO] Shard 1 spawned in cluster 1 +0ms
each cluster has two shards
add the log
ok
spawning undefined
.=.
const manager = new process.RodyBrozy.ShardManager('./src/discord/thebrozy.js', {
totalShards: Number(process.env['totalShards']),
token: process.env['token']
})
manager.spawn()
totalShards: Number(process.env['totalShards']),
show the full log
spawning undefined
shard:ShardManager [14/02/2022 17:25:06] [INFO] Starting 2 Shards in 2 Clusters! +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Worker 1 spawned in cluster 0 with 1616 pid +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Shard 0 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Shard 1 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Worker 2 spawned in cluster 1 with 1622 pid +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Shard 0 spawned in cluster 1 +0ms
cluster:ClusterManager [14/02/2022 17:25:06] [INFO] Shard 1 spawned in cluster 1 +0ms
spawning undefined
spawning undefined
but it is running by the clusters
I left two clusters on my machine
index.js
-> ShardingManger -> spawn() -> isPrimary -> Clusters spawn() -> fork() x2
-> index.js -> ShardingManager -> spawn() -> not Primary
-> index.js -> ShardingManager -> spawn() -> not Primary
and also has the master cluster
hm.....
How can I avoid this??
if(isPrimary) {
super.spawn()
}
in
const manager = new process.RodyBrozy.ShardManager('./src/discord/thebrozy.js', {
totalShards: Number(process.env['totalShards']),
token: process.env['token']
})
manager.spawn()
?
although you might want to revisit your design, because its very confusing
each time you use cluster.fork() you are running index.js again
thats why you use isPrimary to check if its the first run, or if its a forked run
you are running ShardingManager.spawn() outside of the isPrimary check
meaning both the main process AND the forked processes will create new SHardingManagers
which in turn spawn all shards again
async spawn() {
console.log(`spawning ${super.totalShards}`)
await super.spawn(super.totalShards, 60000, false).then(() => {
if (cluster.isPrimary) {
if (this.totalShards < this.clusterCount) {
this.clusterCount = this.totalShards;
}
process.RodyBrozy.logger(`shard`, `ShardManager`, `Starting ${this.totalShards} Shards in ${this.clusterCount} Clusters!`)
const shardArray = [...Array(this.totalShards).keys()]
const shardTuple = process.RodyBrozy.chunk(shardArray, this.clusterCount)
for (let index = 0; index < this.clusterCount; index++) {
const shards = shardTuple.shift()
const cluster = new ClusterManager({ id: index, shards, manager: this })
cluster.spawn()
}
}
})
}
hm
I understand now
if (cluster.isPrimary) {
await super.spawn(super.totalShards, 60000, false).then(() => {
}
}
?
yes that should fix the issue
ok
I figured it out. problem was
Write the Boolean function is_odd(n) that returns True when n is odd and False otherwise.
Outside the function, generate 15 random integers with possible values from 1 to 30. Invoke the function and, for each number, print if the number is odd or not. For example:
7 is odd.
18 is not odd.
etc..
The code is
return n%2 != 0
import random
print(is_odd(1))
for i in range(15):
rand_int = random.randint(1,30)
if is_odd(rand_int):
print(rand_int,"is odd.")
else:
print(rand_int,"is not odd.")```
async spawn() {
console.log(`spawning ${super.totalShards}`)
if (cluster.isPrimary) {
await super.spawn(super.totalShards, 60000, false).then(() => {
if (this.totalShards < this.clusterCount) {
this.clusterCount = this.totalShards;
}
process.RodyBrozy.logger(`shard`, `ShardManager`, `Starting ${this.totalShards} Shards in ${this.clusterCount} Clusters!`)
const shardArray = [...Array(this.totalShards).keys()]
const shardTuple = process.RodyBrozy.chunk(shardArray, this.clusterCount)
for (let index = 0; index < this.clusterCount; index++) {
const shards = shardTuple.shift()
const cluster = new ClusterManager({ id: index, shards, manager: this })
cluster.spawn()
}
})
}
}
yes
spawning undefined
shard:ShardManager [14/02/2022 17:42:42] [INFO] Starting 2 Shards in 2 Clusters! +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Worker 1 spawned in cluster 0 with 67 pid +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Shard 0 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Shard 1 spawned in cluster 0 +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Worker 2 spawned in cluster 1 with 73 pid +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Shard 0 spawned in cluster 1 +0ms
cluster:ClusterManager [14/02/2022 17:42:43] [INFO] Shard 1 spawned in cluster 1 +0ms
spawning undefined
spawning undefined
?
await ur stuff
you're printing something outside of its scope
ok
how do you guys make your codes color coded
```lang
code
```
super.totalShards
https://capy-cdn.xyz/AQdYNYZj.png how can i fix this
so instead of 023
its 23
remove all 0s before
parseInt("0100", 10) // 100
I think?
thebrozy.on('messageCreate', (message) => {
if (message.author.bot) return
if (message.content === 'teste') {
message.reply(`teste`)
return
}
})
I'm getting this event twice
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy repository contents via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
with:
source: "."
target: "/var/www/mywebsite"
- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
script: python3.9 Horizon/main.py``` wait why does this not pop up on my vps ?
the directory
parseInt("00320").toString(); // 320
its fixed now
same code, just before it was still doing *1000
ok next thing
i have a photoshop file
is there any way to generate images from it using nodejs
Also should be the same as Number("00320").toString();
Canvas
I doubt as Photoshop has is it's own structured file format
can someone help me with this please?
just found https://www.npmjs.com/package/photoshop-generator-core, gonna test
Hmm, interessting
Login, head to your profile overview, your bots are listed there
How do I get a slash command's ID?
When registering it, receiving an interaction and when you fetch the application interactions
👍 Thank you
when i run this i get this
click on the > and see if it tells you anything
No debugger available, can not send 'variables'
Even if it doesn’t make a difference but you can also use prebuilt methods to register commands
client.application.commands.create()
Also commands need to be lowercase without special chars or whitespaces
Hello I have a problem when a bot sends a message it gives me an error
code: https://sourceb.in/g1VwESJet4
error:
TypeError: Cannot read properties of null (reading 'permissions')
at Client.<anonymous> (C:\Users\dionl\OneDrive\Documents\djs\events\antilinks.js:9:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) Promise {
<rejected> TypeError: Cannot read properties of null (reading 'permissions')
at Client.<anonymous> (C:\Users\dionl\OneDrive\Documents\djs\events\antilinks.js:9:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
}
@whole glen
You should also respect the maximum amount of chars for the name and description
ok
if(message.content === "start"){
const questions3 = [
`test`,
]
let counter3 = 0
const filter3 = (m) => {
return m.author.id === message.author.id
}
//verander deze naar dm en ga dan alles ook voor firstmember doen
const collector3 = message.channel.createMessageCollector(filter3, {
max: questions3.length
})
message.member.send(questions3[counter3++])
collector3.on('collect', (m) => {
if (counter3 < questions3.length) {
message.member.send(questions3[counter3++])
}
})
collector3.on('end', (collected) => {
console.log(collected)
})
}```Hey, i am still stuck at this issue. How would i make this messagecollector work in dm?
I have two clusters, each cluster has two shards, but each shard is responding independently; I have a messageCreate event and it returns message.reply() four times
Not that I deal with shards but I guess you need to get the instance of the origin of the event
In other words I guess you need to get the right shard/cluster you received that event in and need to respond in it
anyone?
and how do I?
lol
you still didnt manage? well if i were you i would redesign you entire system, because something about it feels really wrong
like, what exactly are you trying to accomplish from a design perspective?
desing? are you talking about folders and all?
like, discord has shards, each shard has x guilds. the discord.js sharding manager launchers 1 process per shard, or 1 thread per shard, depending on the mode, and each of those shards runs a separate client instance that processes the commands
how exactly do you want to organize those?
2 processes, with x shards each with 2 clients processing commands?
this project is just a test with the bot token, not the normal bot file
or are you trying something more elaborate like threads containing shards and redirecting events to a central process where a single client instance processes the commands?
yes
whar are you using for communication? ipc?
is the shardingmanager running in process or thread mode?
process
ok so, the easiest way to do what you want, is to have the sharding manager create shards, then the shards send events back to the sharding manager, and the sharding manager file processes everything
there is no clustering tho
just a central process, with separate processes for shards
the discord.js sharding manager does not support clustering, no matter how you try to do it, because it inherently always launches separate processes for each shard
if you want to have a clustered system, where each process contains multiple shards, you have to either use internal sharding, or a third party solution like kurasuta or hybrid sharding
its a library on npm
ok
btw how big is your bot?
40k guilds
any specific reason why you want a central process instead of normal clusters?
I was thinking of creating multiple machines for my bot, as a server, hosting on two different hosts, but at first it was kind of cumbersome so my team didn't agree
but if i use normal clusters how could i do that??
i think multple machines is overkill
could i proceed from where i am?
you dont need that unless you have millions of guilds
you could simply use discord.js the normal way, the same way as you would with normal shardingmanager, but instead of sharding manager you use kurasuta or discord-hybrid-sharding
they are both a replacement sharding manager
everything else in your code would be exactly the same as the normal discord.js
I know that, I exaggerated in "several machines" I would put, only in two
hm
ok
I'm going to study kurasuta
kurasuta is very similar to what you were trying to do with the cluster module
just it doesnt redirect events into a central process, each cluster has its own events and its own client
like the normal sharding manager, but each process/client has multiple shards at once
but that can't give the duplicate event, how am I getting it?
And how would I deal with these clients?
because you're trying a very weird thing that doesnt make much sense and you're accidentally creating duplicated shards and/or duplicated event listeners
you dont need to do anything, you just use it like a normal discord.js client
ok
lol
for aesthetics
should work exactly the same way in dms
do NOT use kurasuta
the biggest mistake i ever made
its broken and abandoned
better than the weird thing hes trying to do
but yeah
i still dont know how people with apparently 40k guilds struggle with things like this
at that point you should be proficient enough to make good decisions on your own
with some guidance on the way
unless your hello world bot got very lucky and gained a lot of servers quickly
thats usually what happens
bots accidentally getting too big, then struggling with infrastructure
You should check his top.gg profile.
happened to me too at the 2.5k milestone
lol
btw my bot completely stopped growing since the certified bot thing was removed from topgg
lmao

rip
idk why they stopped and eventually removed certified bots
it was a pretty good idea
imagine mailing oily
maybe you should consider investing in top.gg nfts now
everytime my bot was featured in the cert section i would get like 200 new guilds in a day
now i've been stuck at 9.5k for half a year
xD
it's time for you to use auctions
with what money
rip
you dont have the luxury of stable income when you're your own boss xd
bro just join some crappy nodejs startup lmao
ew
im only getting a job if they pay me average US software engineer wages
which is like 80k+ a year
brazilian moment
otherwise its not worth selling my soul to help make someone else rich
right lmao
been there done that
yeah dude, thats is the way
I'll start by being a reseller on amazon lol
my business teacher does that as a side hustle
it's decent money but sometimes crap won't sell
people will definitely pay anything to get their hands on the latest sold out gpu
if you like cars/bikes, dismantling old vehicles and selling parts can be very profitable
but it does take a lot of work
it's insane
my gpu I bought almost 3 years ago for 500 bucks is worth more now than it was then
lmfao
Sell it and make stonks
an interface in ts like ts interface Test { name: string; age: number; isAlive: boolean; } can be represented with Record<string, any> right?
My ts is yelling at me
Yeah
Or you could add something like
[key: string]: any
idk
that's confusing then!
interface ModalArgs {
name: string;
description: string;
}
run: async (modalContext: InteractionModalContext, args: ModalArgs) => {
console.log(args);
return modalContext.editOrRespond(`${args.name}, ${args.description}`);
},
// run's args are of type InteractionModalArgs, which is Record<string, any>
``` but ts yells at me saying ```
Type '(modalContext: InteractionModalContext, args: ModalArgs) => Promise<unknown>' is not assignable to type 'InteractionModalRun'.
Types of parameters 'args' and 'args' are incompatible.
Type 'InteractionModalArgs' is missing the following properties from type 'ModalArgs': name, description
Not really
Idk just slap a @ts-ignore into it ig
I'm assuming this is some sort of obscure ts fuckup
the thing is that it works for everyone else
which is just odd
Im pretty sure this is not the fault of ts
Cuz if it fucks up its either the lib has bad typings or you did something wrong
I believe it's something wrong with my setup, it works for everyone else in an identical setting
The lib doesn't have bad typings
It's made in ts to begin with
Ok
just really odd ig
it compiles and runs just fine too
so it's not a huge deal, it's just annoying
Record<string, any> doesnt make much sense there tho
it's the internal type provided by the lib so that it works with different types of interfaces
well try making name and description optional then
because record any wont satisfy an interface that demands those props to exist
yeah it works when I make it optional
it's still odd though considering it works for everyone else
this is the example provided by the lib dev https://github.com/detritusjs/client/blob/0.16.4/examples/ts/example-bots/commands/interactions-and-prefix/commands/interactions/slash/form.ts
no idea
either way, setting them as optional works well enough for me
since I know which fields are guaranteed to be there
I see I need to pay you, give you something to do between your already existing 1000 other projects
I wonder how much time you can effort
is there a way to make the vscode debug terminal pop out automatically
you want to give me more reasons to procrastinate on my stuff? xD
And the first thing I see when I enter this channel is the forsaken Detritus, may god save us
i get the problem in replit that,
before it was fine but after i reinstalled ffmpeg, this happened
A
ffmpeg is a CLI, not a package
you're probably in a bot farm
What is this ?
a discord server that abuses the discord API/service by adding every bot they can find
potentially spamming your commands
(It's only in 8 servers)
:(
I'd recommend finding a way to leave it
so what do i do
because it can cause problems like ratelimits
depends, what are you trying to do with ffmpeg
tryna make music commands
use lavalink or something like that instead, it will be a hell of a lot easier than using ffmpeg and trying to optimize it
but will i be able to use it with youtube_dl
probably, lavalink is a music server
I haven't done a whole lot with music
I've used ffmpeg to play music into a vc but it's by no means "easy"
this is something similar to what I use, but it's in typescript and I'm not using discord.js ```ts
const args = [
'-i',
url,
'-f',
'avfoundation',
'-ac',
'2',
'-f',
's16le',
'-ar',
'48000',
'-loglevel',
'0',
'-analyzeduration',
'0',
'pipe:1',
];
this.currentStream = spawn('ffmpeg', args, { shell: false, windowsHide: true });
MusicPlayer.encoder.bitrate = this.connection.channel?.bitrate ?? 96_000;
MusicPlayer.encoder.complexity = 10;
MusicPlayer.encoder.signal = 'music';
const packets = MusicPlayer.encoder.encode_pcm_stream(960, this.currentStream.stdout);
const iter = packets[Symbol.asyncIterator]();
let seq = 0;
const start = Date.now();
let stopped = false;
while (true) {
if (this.state.skip) {
break;
}
if (this.state.stop) {
stopped = true;
break;
}
const { done, value } = await iter.next();
if (!this.state.speaking) this.state.speaking = (this.connection.setSpeaking({ voice: true }), true);
if (done) {
break;
}
this.playing = true;
this.connection.sendAudio(value, { isOpus: true });
if (seq >= u16_max) seq = 0;
await sleep(20 + 20 * seq++ - (Date.now() - start));
}
I'm not sure if that helps you in any way but the basic idea is spawning a ffmpeg process and piping the stdout of said process into packets
Ok I found the guild, its id is 906938940618051655 and its name is │ 𝓬𝓾𝓭𝓭𝓵𝔂 ™
Petition to make bot farms specifically for music bots that use youtube
Guys please help!
Yes
VPS vs Localhost
I don't know why this is happening
I am using ReactJS and running same command on both of them
then just don't reply to their question
I thought I could help
👀 are you copying some random api
I didn't know it was with js
oh i didn't read the rest of the convo
I replied HERE first
sigma tip #69: don't reply to anyone in development unless you know what they're actually asking
open console show code
Np :)
oh i didn't read the rest of the convo

No, we had a word as well
My API is about a year old, I have been using that name and he was fine with it.
I learnt about Some Random Api after making my own api
Amazing Cloudflare is down!
It shows an unrealated error
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
```
Yea I cannot use https
try using a cloudflare tunnel
ngrok?
can anyone gimme any cool ideas which u wanted em to implement in bots
but never did
Amazing
economy
spam protection
Skill issue
thx
but i did that

no more ideas
hmmm
why
look for messages with arbitrary code (in code blocks), evaluate it, and display the result
nice
idea
thx
I suggest you cry about it
that should be fix since I am using a secured domain
why are you using nginx instead of an actual react server such as nextjs
I honestly dk wh I am doing at this point
upstream bruh {
server HIDDEN_IP:8675;
keepalive 8;
}
# the nginx server instance
server {
listen 80;
listen [::]:80;
server_name api-info.pgamerx.com
access_log /var/log/nginx/api-info.pgamerx.com.log;
# pass the request to the node.js server with the correct headers
# and much more can be added, see nginx config options
location / {
try_files $uri /index.html;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://bruh/;
proxy_redirect off;
}
}
I don't think there is anything wrong here
I use Nginx for everything, don't want to use different things for different projects
use proxy
it looks more like a meme than anything else
not upstream
location /app {
resolver localhost:(port);
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://server:8080$request_uri;
}```
also
didnt you say you were using secure domain?
or is it just couldflare flexible ssl?
Yes, but not from the server side
Yea^^
Funny thing is that this was something I made months ago (most of it is non functional ), this has the same configuration as the other one (diff ports ofc) but this works
is your node server running?
yep
try accessing yourvpsip:nodeport in your browser
I did, it is white
It is blank white but favicon is visible
pm2 serve build/ 8675 --name "my-react-app" --spa
I served the server like this
if it works with direct access but not with nginx, then nginx is the issue
ikr
try removing the tryfiles line
ye
nothing changed
bruh.local
You usually need to follow the RFC guidelines for virtual hostnames or use IPs
I got some good ones, like ADHDStorage.local 
Idc about the name but the TLD
Waig guys
Wait*
I tried checking what I am doing with the dash.pgamerx.com in pm2
it is running script
Not running the service
At least it doesn't look like it
😩
wait
on stackoverflow someone pointed out that it might be because I am using browserList
give this a shot https://www.digitalocean.com/community/tutorials/how-to-deploy-a-react-application-with-nginx-on-ubuntu-20-04
At this point I'd recommend using vercel
point your sub domain to vercel's CNAME
after you deploy it ofc
Select menus are OP.
idk why I was using buttons to go through pages.
A module I wrote to handle associations with specific message components and callbacks makes my code super fucking clean and responsive.
export function paginate(pageCount: number, callback: (page: number) => unknown) {
let page = 0
if (pageCount > 1) {
let menuExpires: NodeJS.Timeout
const component = new BetterComponent({
type: Discord.Constants.MessageComponentTypes.SELECT_MENU,
placeholder: "Select page",
maxValues: 1,
minValues: 1,
options: Array(pageCount).map((_, i) => ({ label: `Page ${i + 1}`, value: String(i), description: null, emoji: null, default: i === 0 }))
})
component.setCallback(interaction => {
interaction.deferUpdate()
page = Number((interaction as import("thunderstorm").SelectMenuInteraction).values[0])
callback(page)
})
// eslint-disable-next-line no-inner-declarations
function makeTimeout() {
clearTimeout(menuExpires)
menuExpires = setTimeout(() => {
component.destroy()
}, 10 * 60 * 1000)
}
makeTimeout()
return component
} else callback(page)
return null
}
OH MY GOD I HATE THIS
I HAET EVERYONE
I HATE VERCEL, REACTJS, NGINX, PM2, MY HOSTING SERVICE AND MYSELF
Relatable
i need to replace with message.guild.members.permissions.has ?
In a direct message, a property member does not exist
Therefore a permission check for the non-existing member isn’t valid, too
Either you check the channel type before checking the member permissions or you check if a property member exists
For example simply by using optional chaining
message?.member.permissions.has(…)
In your statement you’re checking the permissions
YOU FORGOT TO MENTION YOU HATE ESLINT
yeah that too
router.route("/redeemCode")
.post(async (req, res) => {
const check = await codes.find({code:req.body.code}).toArray()
if (!check.length > 0) {
return res.json({error:true, errormsg:"Unknown code!"})
}
if (check[0].uses > check[0].maxuses) {
return res.json({error:true, errormsg:"Max uses reached!"})
}
const user = await users.findOne({_id:req.user.id})
await users.updateOne({_id:req.user.id}, {$set:{balance:Number(user.balance}+Number(check[0].value}})
await codes.updateOne({code:req.body.code}, {$set:{uses:Number(check[0].uses++)}})
return res.json({error:false, value:check[0].value})
})```
SyntaxError: Unexpected token < in JSON at position 0
am i just stupid
God AI is tough
It’s ok I found the error
It was me being stupid
i want to delete this type of data from mongo db after 7d
anyone can guide me
please
collection.deleteOne()?
router.route("/redeemCode")
.post(async (req, res) => {
try {
const check = await codes.find({code:req.body.code}).toArray()
if (!check.length > 0) {
return res.json({error:true, errormsg:"Unknown code!"})
}
if (check[0].uses >= check[0].maxuses) {
return res.json({error:true, errormsg:"Max uses reached!"})
}
const codeclaims = await claims.find({code:req.body.code, userid:req.user.id}).toArray()
if (codeclaims.length > 0) {
return res.json({error:true, errormsg:"You've already redeemed this code!"})
}
const user = await users.findOne({_id:req.user.id})
await users.updateOne({_id:req.user.id}, {$set:{balance:Number(user.balance)+Number(check[0].value)}})
await codes.updateOne({code:req.body.code}, {$set:{uses:Number(check[0].uses)+1}})
await claims.insertOne({code:req.body.code, userid:req.user.id})
return res.json({error:false, value:check[0].value})
}
catch (err) {
return res.json({error:true, errormsg:err})
}
})```
wheres the json issue there
is there any reason to choose h264 over h265 on ffmpeg?
idk its better supported because its older
First off you should store a createdAt inside the document
then
Store the timestamp and use a setInterval that runs every hour to delete every document older than 7days
You can also use redis as your db
¯\_(ツ)_/¯
then
collection.deleteMany( { createdAt: {"$lt" : Date.now() - 6.048e+8 } });
ic, thx
ye, as it seems, it's VERY little supported actually
but i dont want delete all index i want to delete a object inside a index after 7d
this type of object
we won't spoonfeed
store the createdAt property inside the object then delete that specific one
Error loading route from api.js file! Error details: SyntaxError: Unexpected token 'const'
uwu pls help
i took down a client panel
line number pls
kk
got it
doesn't give one
Epic skill issue
Use $pull
what does that do
collection.updateMany({condition}, {
$pull: { tracks: { createdAt: { $lt: Date.now() - 6.048e+8 } } }
});
removes elements from an array
seen
you mean cbr and vbr?
crf*
like, from what I read on trac.ffmpeg setting bitrate gives better control over filesize, while crf allows better overall quality
anyway, guess I'll try a few samples to see how it goes
doesn't help that the lib I'm using has barely any doc
Error loading route from api.js file! Error details: SyntaxError: Missing } in template expression
tfw you put a red cross with no feedback whatsoever
probably because the person said all servers it's in
im taking it as they're not trying to spam the api by logging to every single channel at once
and instead meaning they want to log to a channel named x like that in every server
since when :redcross: is a thing?
oh, it isn't
❎ have to stay with the "error but not kinda" emoji
can we get erela js upcoming queue songs?
Hey.. @theFirebaseUsers i just installed firebase via NPM and i get "No "exports" main defined in PATH_TO_BOT/\node_modules\firebase\package.json any idea?
you'll need to change your import to "firebase/path/to/file.js" where you obviously replace /path/to/file.js to the file you want.
it exports some paths like /firestore
or /database
client.mongo.connect(console.log("Connected to mongo"))
``` is this correct?
Or i have to use .then/function (=>...)
Does it accept a callback param or does it return a Promise
probably both
That callback is incorrect anyways, it would have to be () => console.log("Connected to mongo")
so no it's not correct
Looks okay to me
you should check out the documentation to see if it's correct or not
don't make this a habit
ok
the connect function may have other arguments before the callback
ok
Documentation for mongodb
Okay yeah that’s it
Looking at the mongodb docs it’s horrendous to navigate on mobile
took me 2 mins to find it, search does jack shit
hello!
I have discord js ^13.5 and would like to get all members of a specific role.
I did const members = msg.guild.roles.cache.get(targetRoleId).members;, but i only get the cached members, which doesnt work for big servers.
Will something like const members = (await msg.guild.roles.fetch(targetRoleId)).members; give me all members with that role?
probably not
So does anyone know a solution how to get ALL members for a certain role? or just the memberIds would be fine too
You'll have to fetch all members
all members, as in all members for every role?
The discord API has no endpoint to get members of a specific role only, so you'll have to fetch all members and do the filtering yourself
i see, thank you
I'm trying to set up slash command permissions, but it doesn't seem to be working.
const fullPermissions = [
{
id: '942893451551309907', // delete
permissions: [{
id: message.guild.roles.everyone.id,
type: 'ROLE',
permission: false,
id: '877309777741500487', // staff
type: 'ROLE',
permission: true,
}],
},
{
id: '943204857995726948', // score
permissions: [{
id: message.guild.roles.everyone.id,
type: 'ROLE',
permission: false,
id: '882754787580457012', // scorer
type: 'ROLE',
permission: true,
}],
},
];
await client.guilds.cache.get(guildId)?.commands.permissions.set({ fullPermissions });
await message.reply("Done");
I'm testing on both my alt and my main (which has permissions), but my alt can still use the slash commands.
I do have role permissions added for the interaction itself, but I want to disable the command entirely for those without the role.
Ex
I have some div elements which have the flex-grow property on it so it fills the free space and it wraps if the elements together are wider than the screen. But if I have less elements than the bare maximum it still grows to the screen end.
So overall the question is: How can I make all columns of a flexbox the same width, regardless of the screen width?
how can i get date like 15/02/22 using javascript
Date.now() and in the () you can specify the format
that's wrong
?
${date.getDate()}/${date.getMonth()+1}/${date.getFullYear().toString().substr(-2)}
that works
Date.now returns the current time in milliseconds
oops I'm sorry 🙈
Is it possible to have a transparent side bar for embeds or no side bar at all?
When hovering over the embed, there isn't a side bar at all.
It's probably the same color as the background
switch to light mode to see if there's a sidebar
No.
At least, for both themes, like Feud said.
There is. Huh. It's weird, cause I have the hex value for the background:
#36393F
But when hovering over the embed I created with that value, there is a side bar (at least it's somewhat visible).
For the embed I sent, there isn't a side bar when hovering over it. Idk it's weird
Discord.js ^13.5
What does the force option of fetch do exactly? If i do not "force", can it happen that i only get part of the actual objects, or a not up-to-date version of it?
Force just means it'll ask Discord for the data on a resource (e.g. a user) instead of first checking if you (the program, your bot) already has it stored locally (in a cache, like a map)
Without force, it'll check the cache first, and if that doesn't exist, it'll then ask Discord.
You shouldn't get partial objects with a cache.
ok thanks
And that's why you don't store dates as strings. Now to answer you question, look into this it'll make your life easier: https://momentjs.com
oh thats interesting
use padStart to keep 0 if needed
that last method looks dumb you probably shouldn't use it
isn't there a custom formatter built in
Intl.DateTimeFormat I think
new Date().toLocaleDateString("en-AU", {day: "2-digit", month: "2-digit", year: "2-digit"});
https://devhints.io/wip/intl-datetime is a good cheat sheet
One-page guide to Intl.DateTimeFormat: usage, examples, and more. Intl.DateTimeFormat is used to format date strings in JavaScript.
Here we can only make requests for things on discord or other?
Quick Sanity Check... when i define a const inside an IF/ELSE its values has to be accessible outside the IF/ELSE.. correct?
ffs
Only var is the exception, where it's bound to the function scope (where the function was declared).
You could declare a variable above with let and assign it a value later.
I declared it as a var.. as long as it kinda works im happy.
nice
My chrome extension is on manifest v2 and is on the chrome web store. Do I need to move it to manifest v3 before I can publish its new update?
https://date-fns.org/ is a great date library for javascript.
Will definitely look into it. Thanks for sharing. 
(node:575) UnhandledPromiseRejectionWarning: ReferenceError: db is not defined
at /home/runner/vcodes/src/routers/partners.js:14:13
at Layer.handle [as handle_request] (/home/runner/vcodes/node_modules/express/lib/router/layer.js:95:5)
at next (/home/runner/vcodes/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/runner/vcodes/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/runner/vcodes/node_modules/express/lib/router/layer.js:95:5)
at /home/runner/vcodes/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/runner/vcodes/node_modules/express/lib/router/index.js:335:12)
at next (/home/runner/vcodes/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/home/runner/vcodes/node_modules/express/lib/router/index.js:174:3)
at router (/home/runner/vcodes/node_modules/express/lib/router/index.js:47:12)
at Layer.handle [as handle_request] (/home/runner/vcodes/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/runner/vcodes/node_modules/express/lib/router/index.js:317:13)
at /home/runner/vcodes/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/runner/vcodes/node_modules/express/lib/router/index.js:335:12)
at next (/home/runner/vcodes/node_modules/express/lib/router/index.js:275:10)
at /home/runner/vcodes/node_modules/express/lib/router/index.js:635:15
Loving the bot list fork 
are you serious?


bro ik u are not talking your whole website is literally copied 💀
okay "db is not defined"
I wont talk to you
?
bruh
look at what ur doing
dont ping me
ur forking a botlist, and wondering why db is not defined
db is defined lmao
You have yet to show any real code for us to work with here
user profiles and bots and servers are being pushed to theMongoDB database
well what file do u want to see?
hmm yes, ask for help starting a botlist in a major botlist 
this is the only server i know of that has developers that are actually online
lmao
Where the error is. You should definitely learn how to use js before copying a ton of it off of the internet
they known 65% of javascript according to their website
Wtf lmfao
lmfao
js with ts icons
There’s an infinite amount of frameworks and libs pretty much
its a random number I have been debating if I should use a list or a chart, most people use chart but idk how to tell how much of a language you know.
So I just put placeholder numbers till i figure it out
It’s simple: you don’t have a percentage of a language that you know
const app = require('express').Router();
const Database = require("quick.db");
const path = require("path")
console.log("[vcodes.xyz]: Partners router loaded.");
app.get("/partners", async (req,res) => {
res.render("partners.ejs", {
bot: global.Client,
path: req.path,
config: global.config,
user: req.isAuthenticated() ? req.user : null,
req: req,
db: db,
roles: global.config.server.roles
})
})
module.exports = app;
is it db: Database,?

advice: don't fork a botlist and then ask in another botlist how to work said botlist 
advice: do not copy codes from the internet
stackoverflow etc is an exception
how do i fix this
You have to research something to learn out but not ctrl c ctrl v 
exactly
Learn js, don’t copy paste 😛
ima just ask some other server for help
Ok
Asking for help with very obviously copy pasted code is not going to get you far when you have to essentially have someone else code for you
if anyone has gotten their music bot verified, plz reach out to me. I have questions 🙏
If you've any questions for me @mortal python feel free to shoot me a dm
I've a music bot which was approved 👀
awesome, I sent you a DM
node-canvas (nicknamed canvas) needs the libuuid library to run, which is pre-installed in most Linux distributions, but as it seems, it's not installed for you, you can run apt-cache search libuuid to look up for the available installations, and if there's uuid-dev in the output, run sudo apt install uuid-dev -y to install it, if it's not present in the output, you'll have to install it from source:
https://noknow.info/it/os/install_libuuid_from_source?lang=en
huh why would it need a uuid library
it's the fact that the website is stolen 💀
bro it's licensed and you changed the copyright on it and didn't attribute the author
you can get sued
node-canvas assigns a UUID to it's contexts to not confuse them with each other, and some of it's build tools needs it to build node-canvas itself for some internal reasons
using a uuid library for that seems highly unnecessary but fair enough
they could've just numbered them 💀
LOL
Nothing
quite late, but the dark mode embed color is 0x2f3136
0x36393F is the background color of Discord's chat itself, but is susceptible to being painfully visible when hovering and also make a straight line down the left side which isn't ideal.
ex
I set 0x2f3136 to all of my embeds
did you forget to put } in a template string
can we start putting invisible unicode bullshit in code tutorials so it breaks for anyone who copied it instead of writing by hand after reading
advice: copying code is okay if you know how it works
im sorry i copied my own code
Honestly 9/10 programmers are using code they didn't make anyway. It is fine as long sa you understand what said code does and how it functions
there's nothing wrong with copying code as long as you have fair rights to use it imo
even if you don't understand it you will eventually
you want to copy and paste some answer from stackoverflow on your final test?
without citing who you got it from?
My school computer teachers never understand what the book says how in hell are they going to make a test that hard
tell me what you get on your test next time
what's the book?
gotcha
Ty!
Hey guys, been working on getting my bot verified but ran into the TOS page requirement. I don't know much about creating one for my bot, could someone point me in the right direction? Thanks!
You don't need to be a legal expert to write a TOS/Privacy Policy. You can even take inspiration from other sources
aka search tos generator, find the one that looks like it would fit a bot and isn't as long as the bible, profit
Subla's gateway to computer science
FROM 2013
USES EXCEL 2009
WHY
So if I have a vector of threads in c++ that execute simultaneously, how can I stop all of the threads once one of them has completed?
Is there a simple solution or is it going to be wildly complex like I’m expecting
This is how my threads are executed by the way: ```cpp
for(auto& thread : threads) {
thread.join();
}
I think the only best way to kill a thread is to make it kill itself via std::terminate()
I'll think of a solution in a minute sorry 😂
What kind of work are the threads doing?
how to make vote rewards for voting, the bot should dm and give rewards as soon as the user votes
We don't spoon feed
I didnt ask spoon feed, is there any docs or something where I can find the way to do it, if giving docs is spoon feed too then get a life
I just turned off import cost and my CPU usage went from 100% to like 15
tf is import cost
it shows you how big the modules you're importing to your files are
o
I uninstalled it long ago, made my vsc lag like hell
yeah it was a good time mining crypto probably
mainly noticable was the intellisense. Like i noticed a really high jump in that performance after uninstalling that
definitely
app.post('/topgg', webhook.listener(vote => {
console.log(vote) // empty object
}))
```why do i get an empty objecct? (im using @ancient bloom-gg/sdk)
crypto is bad for the environment!!!!! 😱 😱 😱 😱 😱
I fucking
cwypto bad
I hate nextjs

fixed with
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.raw());
people making bullshit erc 20 tokens is bad for the environment!!!!!!
dbl capybara nft when????
I do too
I especially don't like working with databases on it
it acts more of a stateless cloud function than a backend server
Just use angular
anything you save globally is unreliable because it may be cleared
so how do i kick a member in events ?
As in removing them from a guild, or as in removing them from the interested list in a scheduled event?
has discord released an input field yet
Didn’t they release forms? Pretty sure that was their implementation in text inputs
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I have no idea I haven't touched discord bots in 2 years
yet you run a bot list
yes, not a bot
do you expect the guy selling sandwiches to work on the wheat fields as a side gig
Yes
Yes
One message removed from a suspended account.
yeah its out
i've used one
I want to make a reminder system but I don't know if I should make a setTimeout for all reminders or a setInterval every second to check 1 by 1 the reminds. Which one is more optimized?
a combination of both
have an interval running every few minutes that checks your database for close-to-expiring reminders, if there are any, queue those in a setTimeout with the leftover time
I've been trying to insert our whole website in description
Coz I'm dumb and i dunno how
Use an iFrame
Do you mind if i dms you?
@boreal iron ty
I'm trying to set up slash command permissions, but it doesn't seem to be working.
const fullPermissions = [
{
id: '942893451551309907', // delete
permissions: [{
id: message.guild.roles.everyone.id,
type: 'ROLE',
permission: false,
id: '877309777741500487', // staff
type: 'ROLE',
permission: true,
}],
},
{
id: '943204857995726948', // score
permissions: [{
id: message.guild.roles.everyone.id,
type: 'ROLE',
permission: false,
id: '882754787580457012', // scorer
type: 'ROLE',
permission: true,
}],
},
];
await client.guilds.cache.get(guildId)?.commands.permissions.set({ fullPermissions });
await message.reply("Done");
I'm testing on both my alt and my main (which has permissions), but my alt can still use the slash commands. I'm testing on both my alt and my main (which has permissions), but my alt can still use the slash commands.
I do have role permissions added for the interaction itself, but I want to disable the command entirely for those without the role.
Got it to work, I ended up using an atomic bool as a flag and now it’s extremely fast
And the work they were doing was generating random strings, just messing around with multithreading tbh
The good ol’ monkey typewriter problem
Can someone teach me code
Bot commands
I don’t think anyone here can really be your 1 on 1 tutor, but if you ask questions here people will help you
Ok
Damn, this is using a shitty replit server while I’m at school as well
11 million iterations in 4.3 seconds
Impressive
Ironically creating the threads probably ends up taking longer than iterating itself
Is it possible to get the response to a Google Form?

how did you manage to come up with that idea

i mean yes i have a moderation bot but its not designed entirely for user moderation
its an automod focussed on stopping known bad eggs 
adapt, improvise, overcome
Hello.
Im running a nodejs discord bot in a docker contaniner, but it needs a .env file for getting the token, etc... Im using the dotenv npm, but when running docker run bot:latest --env-file .env it doesnt detect the .env file. (The .env file is outside the contaniner, i dont want to create the container with the bot secrets inside)
The Dockerfile looks like this: dockerfile WORKDIR / COPY package*.json ./ RUN npm install --silent COPY . . RUN npm run build ENTRYPOINT ["npm", "run", "start"]
And npm run start is just node dist/main.js
how can i get this gray bg to fit to screen with the m-3 already set
using tailwind
Does djs have a feature that bans a person for a certain amount of time instead of permanently (asking for a friend)?


