#development

1 messages Ā· Page 1863 of 1

earnest phoenix
#

please ignore the else part of the ternary

quartz kindle
#

why does it have cum in the code

#

:^)

earnest phoenix
#

lol

#

it's supposed to be current number lmfao

quartz kindle
#

your idea is quite good tbh, terrible for performance but good for small code size

#

here's an improved version

Array(10).fill().reduce((a,c) => [...a, a.at(-1) + a.at(-2)], [0,1,1]);
earnest phoenix
#

why

#

just

quartz kindle
#

lol wut

earnest phoenix
#

the question i will ask is a bit amateurish but i really need help

#

Why this error

simple stump
#

I'm trying to loop through a MySQL database and get rows.elo, but when I try to add the data to an array (for testing purposes), some pieces of the data return undefined. How would I check whether the data is undefined?
Code:

let some;
for (var i = 0; i < rows.length; i++) {
  if (typeof rows[i] != 'undefined') {
    console.log(rows[i]);
    some.push(parseInt(rows[i].elo));
  }
}

Error:

C:\path\node_modules\mysql\lib\protocol\Parser.js:437
      throw err; // Rethrow non-MySQL errors
      ^

TypeError: Cannot read property 'push' of undefined
    at Query.<anonymous> (C:\error\index.js:540:10)

Line 540 is some.push(parseInt(rows[i].elo));

sudden geyser
#

I'm not sure if I understand your question correctly, but some wasn't assigned a value so it defaults to undefined

#

If "some pieces of the data" is what some is, why not also check if some === undefined

simple stump
#

ah. alr thx

earnest phoenix
#

yeah because permissions is an object

#

uh what

#

oh yeah

#

BigInt

#

It's a different number type

#

String(permissions)

royal pumice
#

Can anyone help me making a warn command in my discord.py bot

#

It's in top.gg but I haven't have a good warn command

earnest phoenix
royal pumice
earnest phoenix
#

lol

quartz kindle
#

or just

earnest phoenix
#

you don't need a variable

quartz kindle
#

tostring the raw bitfield

earnest phoenix
#

just put it in the ${}

earnest phoenix
#

what

quartz kindle
#

permissions.bitfield.toString()

earnest phoenix
#

I sometimes wonder if Tim has memorized the entire docs

royal pumice
#

Gg

quartz kindle
#

i usually have them always open in another tab

wheat mesa
#

just installed IntelliJ idea on a school computer

#

They block all exe downloads but they forgot to block .zip downloads

#

Surprised it actually worked

earnest phoenix
#

You could use a usb or portable software

marsh bluff
#

My school computers use Windows XP so IntelliJ is unlikely to work

earnest phoenix
stable eagle
sudden geyser
#

you tried to require a module and node.js couldn't find it

stable eagle
#

Its in discord.js

sudden geyser
#

ah, interesting

digital ibex
#

maybe update discord.js, uninstall & install

stable eagle
#

It fixed itself after i downgraded it to 13.0.1

digital ibex
#

shrug

quartz kindle
#

BaseCommandInteraction was added to index.js 8 days ago

#

so it likely only works in v13.2.0-dev

boreal iron
#

wtf is the difference between CommandInteraction and BaseCommandInteraction

#

can't see a difference in the docs

smoky spire
#

ContextMenuInteraction and CommandInteraction extend BaseCommandInteraction

fiery scroll
#

can someone pls help me with discord oauth2? i dont understand how to do it at all! Btw its a web app with svelte.js

pearl briar
#

@near stratus how can increase memory heroku? for free service

boreal iron
#

nothing is for free except the death

rose warren
boreal iron
#

lol right but that's something your descendants have to deal with, I guess you don't bother anymore if you're dead

#

but who knows šŸ¤·ā€ā™‚ļø

earnest phoenix
#

how do i check what perms do a user has in my server

pallid jungle
#
        throw new HTTPError(res.statusText, res.constructor.name, res.status, request);
              ^

Response: Internal Server Error
#

??

primal pasture
#

I want to Minu vote. But now it's not available why?

earnest phoenix
split hazel
signal estuary
#

How are the Role create / update / remove events called?

split hazel
#

what language?

#

and what library

earnest phoenix
#

Same you would any event ig

#

They're using djs last I saw

split hazel
#

question is very vague

#

dont know whether i should go indepth how the nodejs event listener works or KEKW

earnest phoenix
#

Nah

#

They likely won't understand

signal estuary
pallid jungle
#

The bot have permissions

E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:298
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Missing Permissions
    at RequestHandler.execute (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
    at async GuildMemberRoleManager.add (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:113:7) {
  method: 'put',
  path: '/guilds/769724063018647582/members/829819269806030879/roles/882325084654665798',
  code: 50013,
  httpStatus: 403,
  requestData: { json: undefined, files: [] }
}
earnest phoenix
pallid jungle
#

I know why couse the role bot trying to give is higher how can i return this error ?

earnest phoenix
#

You can catch the error and log it or send a message saying the reason it's occuring

pallid jungle
#

Okay

#

@earnest phoenix

if(client.roles.highest.position <= Level_To_Reach.highest.position) return
#

This will work ?

haughty bough
#

Hello. I'm making a bot that it has its own api to store users' xp, but I think making a request to store xp and knowing if a person can level up every time a new message is very costly. Is there anything I can do to get around this problem?

solemn latch
#

youll want to have a cache layer

earnest phoenix
#

um how do I load my commands made in a different file to index.js

earnest phoenix
pallid jungle
earnest phoenix
proven lantern
#

are slash commands always going to use <@!> format for @ mentions?

earnest phoenix
#

how can i enter in this mod pls help me guys 😦

earnest phoenix
#

like how i can talk with the bot

quartz kindle
#

what bot?

earnest phoenix
#

never mind i did it

boreal iron
#

Or markdown and so on

boreal iron
boreal iron
#

Oh nvm then it’s probably not implemented yet to resolve the member

#

Since this a static text I would guess it won’t change anyways but who knows, means it might always show this format

solemn latch
#

is your latency under 100?

#

so its over 100ms?

#

hmm, not sure why it wouldnt send then, console.log inside the if statement to double check i guess

#

whats client.ws.ping log?

#

so it logs a number?

#

šŸ‘€

#

then whats it log as?

#

is bot your logged in instance?

#

the bot needs to actually be running on the instance you check the ping on

proven lantern
#

is there a nonhacky way to change the avatar and background image for our bots per guild?

sudden geyser
#

I don't think so.

#

I know users can set a guild-wide avatar in certain servers.

quartz kindle
#

isnt that like a nitro feature or something?

blissful coral
rose warren
#

Do you want the cold, hard truth?

blissful coral
#

yes

#

LMAO

rose warren
#

||MongoDB sucks||

blissful coral
#

I-

#

Mac get out

#

Leave

#

Begone

rose warren
#

Alright imma go to sleep now

quartz kindle
#

mongo doesnt suck

#

mongoose does

#

:^)

rose warren
#

Thanks Tim

quartz kindle
blissful coral
quartz kindle
blissful coral
#

oh wait

#

they were removed

#

completely

quartz kindle
#

ye

blissful coral
#

I c

quartz kindle
#

Also, the useUnifiedTopology and useNewUrlParser options are gone. These options only existed in Mongoose 5.x and MongoDB Node driver 3.x to opt in to new internal implementations. As of Mongoose 6 these options are gone because the new internal implementations are the default, and the legacy implementations are gone. If you used useUnifiedTopology: true and useNewUrlParser: true in Mongoose 5, you should have no problems removing them when upgrading to Mongoose 6.

blissful coral
#

They are default as true

#

Nice

split hazel
#

mongoose does suck

#

apparently it may have some memory leaks too

#

the devs dont really work on it too much

#

issues go unanswered

#

also i always fail to know the difference between hardware threads and kernel threads

#

are hardware threads something managed by the cpu or something

low bone
split hazel
#

though I see terms thrown around on manufacturer websites such as "32 threads" when there's only a least amount of cores

#

apparently a single core cpu also has those types of threads

low bone
#

there's different versions depend on the CPU company
but a single core can virtually do multiple threading

#

check this for more info

split hazel
#

so basically there is no realistic difference between kernel implemented threads and hardware threads

#

since they both switch between tasks to give them cpu time

woeful pike
#

is it possible for bots to dm other bots?

unborn mesa
#

yep

woeful pike
#

Ok so I have a proposition.

I want to build something for making bot verification faster so people dont sit in queue for ages. The biggest thing that's holding us back from doing that is that we don't want to make selfbots because that's a nono and most people have bot messages ignored by default for good reasons so that's not something that can work without exceptions.

What if we built a framework for testing bots using other bots so that process can be completely automated and infinitely faster? Instead of creating individual libraries for every single language, we make a single "contract" file very similar to contract based testing https://docs.pact.io/ that can be consumed by a bot to test the behavior of another bot. This is a TON of work to implement just to get a front seat in top.gg verification and I'd never do it for that reason alone. BUT this can actually be used by other bots to write tests for themselves. It's a win win and encourages devs to write tests for their bots.

I'd like to make this open source so people can use and modify it as they need. Any thoughts?

Fast and reliable testing for your APIs and microservices during development. Safety during deployment.

wheat mesa
#

Actually sounds really good, the only problem being that many bots don’t respond to other bot messages

woeful pike
#

yes so we would need to add an exception for that

#

you can define a test bot id and let that one through

wheat mesa
#

Maybe you could have that faster verification as an optional thing, and users just have to make sure that their bot will respond to your bot’s messages

#

Yeah

woeful pike
#

the faster verification is just a side effect for implementing contract testing in your bot that top.gg can consume

#

letting some bots messages through is kind of cringe but I think it's acceptable for something as useful as testing

quartz kindle
#

like how you see 16 cores in your task manager, if your cpu is 8 core 16 thread

#

software threads are just a program like any other, competing for those cores

#

like how you see 34 lines for chrome.exe in your task manager

split hazel
#

so essentially they're just virtual cpus where the execution of tasks is handled the cpu itself?

quartz kindle
#

ye

#

the cpu can concurrently execute two tasks on each hardware core

#

so it advetises itself to the operating system as having 2 cpus per core

split hazel
quartz kindle
#

not anymore

#

Hyper-threading is a process by which a CPU divides up its physical cores into virtual cores that are treated as if they are actually physical cores by the operating system.

#

it takes advantage of superscalar architecture, in which multiple instructions operate on separate data in parallel

split hazel
#

interesting

quartz kindle
#

this is also worth a read

#

as basically "HyperThreading" is intel's version of SMT

#

The number of concurrent threads is decided by the chip designers. Two concurrent threads per CPU core are common, but some processors support up to eight concurrent threads per core.

gentle reef
boreal iron
woeful pike
#

yeah I forgot about slash commands lol I didn't realize it was going to be forced for every bot

boreal iron
#

I guess a Discord account used for this case as "self-bot" just sending commands to bots on your test server won’t be a good idea tho, too?

#

(regarding ToS)

woeful pike
#

yeah no I'm not doing that

#

slash commands ruining everything once again

boreal iron
#

I guess automating the process will most likely get impossible with the current possibilities

woeful pike
#

damn it was such a cool idea too

#

slash commands are so stupid it's like opening a gui for a simple cli command

boreal iron
#

I mean I’ve got no clue how your verification process works but joining the verification center, hammering some commands by a reviewer and then use a dbl bot command for example to set the bot as verified isn’t a "fast-enough" solution, too?
(might already work like this idk)

slender thistle
#

It's not fast enough since the testing part is... painful at times

#

And the most time consuming of them all obviously

woeful pike
#

yeah the idea would be a really cool alternative but that's never going to work now thanks to shitty slash commands

#

this is why I don't make discord bots Prayge

boreal iron
#

Aren’t the reviewers just hammering the same commands over and over again and also trying to find commands which might violate your rules or Discord’s TOS like suicide commands etc.?

woeful pike
#

yes, and it can't be automated without breaking discord's tos which we obviously don't want to do

slender thistle
#

They actually test the bots on top of searching for the bad ones

woeful pike
#

here's a better idea, pick 5 bots from queue that have the same prefix and test them all at once

quartz kindle
#

inb4 all bots have the same prefix: the slash

woeful pike
#

queue destroyed in 10 seconds

quartz kindle
#

i dont see any alternative besides increasing the number of people reviewing bots

#

since discord is apparently cracking down on all sorts of automation

boreal iron
#

Isn’t the amount of bot approvals going down anyways, since there are literally already a 1000 bots for any use case anyways?
I mean the amount of bot reviewers has increased a lot too since I remember times waiting months for an approval.

gentle reef
#

inb4 retroactive disapproval for similar bots ablobsweats

woeful pike
#

yeah but you know the programmer brain, always trying to automate things and putting people out of their jobs

quartz kindle
#

tfw your whole job is figuring out how to take other people's jobs

inner fulcrum
#

Helo tim

gentle reef
#

do the funny meme and make a "user account" but throw it through the "magic" of "ai" to make it appear as a "standard user" [:

woeful pike
#

damn I'm actually really bummed out now I was super excited about this

quartz kindle
#

rip

boreal iron
#

Well the idea isn’t bad at all and it would probably be lot of work to develop such a system which makes it interesting regarding its complexity but yeah looks like slash commands have ruined it

woeful pike
inner fulcrum
#

Wat r yall talkin bout

gentle reef
#

/dev/random /s

inner fulcrum
#

Mmm

radiant reef
#

not what's inside it but the work help

boreal iron
#

At least this issue isn’t an issue anymore with slash commands

radiant reef
#

like 30% of the bots I test use slash commands

boreal iron
#

I guess the guidelines of an obvious point of entry like a help command isn’t up to date anymore

radiant reef
#

a lot of bot's don't use the slash command part

gentle reef
#

iirc localisation is a thing that will happen soonā„¢ļø according to discord overlord. same with the autocomplete option

woeful pike
#

if discord let bots use slash commands this idea would be super rad I'd even be down to work on it on the weekends

boreal iron
#

Not yet because people might not know yet or will wait until it’s being forced

radiant reef
#

I am a py dev and it's not on there yet kinda happy as it will be a pain

junior musk
#

why does the bot need to be in over 100 servers

radiant reef
gentle reef
#

isn't this more on the other bot not being able to receive the message content to parse the chat command?

woeful pike
#

yeah but people go on top.gg to grow

radiant reef
#

yeah

boreal iron
#

Which will infect force them to switch to slash commands anyway

radiant reef
woeful pike
#

it wouldn't make sense for a bot to aim to stay under 100 servers and list themselves on the site

quartz kindle
gentle reef
#

im not certain but i think i was over 100 back when I got my bot on topgg (was dbl back then)

radiant reef
#

there is 3rd party library to do / commands

woeful pike
#

it doesn't matter if the bot itself is over 100 commands since they'll all want to use interactions to grow

junior musk
#

ohh I didn't understand this correctly my bad

#

yeah that makes sense

boreal iron
# woeful pike it wouldn't make sense for a bot to aim to stay under 100 servers and list thems...

Probably counts for most of the people out there but there’re also special bots like mine for example aiming at a very small amount of people
But I somehow still put it on topgg since I found out it’s literally the only bot (out of 2) on the site being able to do what it can and gaming communities out there actually searching for bots like it on for example platforms like topgg

gentle reef
boreal iron
#

But it doesn’t change the dilemma with slash commands anyways even if they come with a few advantages as well

woeful pike
#

maybe there's an undocumented api that allows bots to submit slash commands? PES_Cry

gentle reef
#

yeah, the implementation is a little bit undercooked. at least from the dev side.

gentle reef
woeful pike
#

yeah but I'm not gonna do that now

boreal iron
#

At least restricting slash commands to webhooks, too would be good

#

But how would it select the right bot sending a slash command if tons of bots have the same commands?
Right now you have to use the UI to choose the right bot for

gentle reef
#

That's probs handled under the request with the app id

boreal iron
#

At the end slash commands have been thrown in and nobody actually seem to think about enough

gentle reef
woeful pike
#

ok even if there's a hidden interactions api that a bot can use, the response comes in from a websocket message which is encrypted and I can't be bothered to look into it

gentle reef
boreal iron
gentle reef
#

šŸ¤” wouldn't it go to discord and you could receive it like a normal message considering the testing bot would be in a single server/very few servers right? That way the discord bot component itself deals with "decrypting" the response?

blissful coral
#

wait, do mongoose model functions now have a .on() property when something is indexed šŸ‘€

boreal iron
#

It might be the best way to invest into more reviewers at all but go on motivating the staff.
Not only granting access to specific resources and privileges as well as roles etc. maybe also implementing a payment system for being active.
Combining all your resources together and collecting the amount of reviewed bots per reviewer could be a way to use an automated payment system for example like PayPal to reward reviewers if they reviewed XX bots/months.

blissful coral
#

Now this is poggers šŸ‘€

gentle reef
blissful coral
#

Here

boreal iron
#

That might be a motivation to them to review more bots and getting the queue handled even faster.
Doesn’t need to be much but something you "can" earn or something you be rewarded for will motivate people push up things, I’m sure.

blissful coral
#
const model = mongoose.model('model_name', modelSchema)
model.on('index', i => {
console.log(i)
})
#

This is what it seems to be

gentle reef
#

So it pretty much just "if use index key on this model" then blah

blissful coral
#

yeah ig

gentle reef
#

Ohhh, that type of indexing blobcatsweat I thought it meant something similar to pkeys in relational dbs

blissful coral
#

yeah no l;ol

gentle reef
#

So if you did the request for the slash command it would send the response back to discord right?

#

At that point wouldn't you just listen for it like a normal message?

woeful pike
#

I don't think they come back as normal messages

#

also assuming I can send slash commands from bots in the first place which I'm 95% sure I can't

#

either way if the solution isn't going to be elegant I'm not interested because writing discord bots already sucks as it is

deep juniper
#

Help

gentle reef
#

True, also just quickly tested unless discord.net is doing funky stuff to make interfacing the same, webhooks are the same as normal messages

deep juniper
#

Why I see this?

pale vessel
mint rain
#

Could anybody help me?

loud tundra
#

can someone say how long it takes to complete this ?

#

its been like a week.

coral lichen
#

lol

mint rain
coral lichen
#

open console

#

and

#

write

mint rain
#

Wat

coral lichen
#

npm i express

mint rain
#

Where?

coral lichen
#

console

#

ctrl c and then npm i express

mint rain
#

?

coral lichen
#

click shell

#

then write

mint rain
#

Ok

mint rain
#

?

coral lichen
#

bro

mint rain
#

?

coral lichen
#

npm i @replit/database

#

šŸ¤·ā€ā™‚ļø

mint rain
#

It worked

coral lichen
#

You're welcome šŸ™‚

wide crow
little meteor
#

anyone facing any problems with t heir bots?

rose warren
#

Nope

little meteor
#

ooh, mine keep disconnecting or replying really late

shrewd hazel
#

I couldn't keep up with hosting cost

little meteor
#

lol

#

let me rephrase it: Anyone facing connection issues with their bots? (I am currently using discord.py)

shrewd hazel
#

Oh sad.dpy user

slender thistle
little meteor
#

getting timeout on sending messages

slender thistle
#

šŸ¤”

shrewd hazel
sick fable
#

uhh

#

the image aint loading when i use tags in html

#
<li>Get stuff done <span><i class="fas fa-trash"></i></span></i></li>
mint rain
#

It says done but i cant use the command

earnest phoenix
#

That's not an image smh

hybrid cargo
sick fable
mint rain
#

I have changed that

#

It says done

mint rain
#

It says done

#

But i still cant?

earnest phoenix
#

If I set a cookie to https only will javascript fetching NOT send the cookie with the request, at least on a different domain?

cinder patio
earnest phoenix
#

so how do i pass user data to nextjs without revealing the user token?

#

getServerSideProps?

cinder patio
earnest phoenix
#

well the react app won't be able to use the token for anything because it's httpOnly

#

why do i keep forgetting i have ssr

cinder patio
#

your react app is going to make HTTP requests to the server to get the information

#

or you can SSR it, too

earnest phoenix
#

ssr safer

cinder patio
#

It's pretty much the same thing since you're still going to be using cookies

coral lichen
#

I need help

small tangle
#

message.author is undefined

#

but we can help more if you provide the code snippet

errant flax
#

and a User(msg.author) does not contain a roles property

coral lichen
#
const Discord = require("discord.js")
const conf = require("../config.json")

exports.run = function(message, client, args)  {


    if(!message.author.roles.cache.has(conf.registerHammer)) return message.channel.send(conf.yetki)

let isim = args[1]
let yaş = args[2]
let kullanıcı = message.mentions.users.first()
    if(!args[0]) return (`${message.author}, Bir kişiyi etiketlemelisin.`)
    if(!isim) return (`${message.author}, Üyenin ismini belirtmelisin.`)
    if(!yaş) return (`${message.author}, Üyenin yaşını belirtmelisin.`)
    if(!kullanıcı) return (`${message.author}, Bu kişiyi sunucuda bulamıyorum.`)
    if(kullanıcı.bot) return (`${message.author}, Botları kayıt edemem.`)


message.guild.members.cache.get(kullanıcı.id).setNickname(`${conf.tag} ${isim} ${conf.ara} ${yaş}`)
message.guild.members.cache.get(kullanıcı.id).roles.add(conf.erkek)
message.guild.members.cache.get(kullanıcı.id).roles.remove(conf.kayıtsız)

const embed = new Discord.MessageEmbed()
.setFooter(conf.footer)
.setColor(conf.embedR)
.setDescription(`
• ${kullanıcı}  adlı kişinin kaydı başarıyla yapıldı.
• İsim Yaş • **${isim} ${conf.ara} ${yaş}**
• Verdiğim Rol • <@&${conf.erkek}> 
• Aldığım Rol • <@&${conf.kayitsiz}>

`)

const embed2 = new Discord.MessageEmbed()
.setFooter(conf.footer)
.setColor(conf.embedR)
.setDescription(`
• ${conf.sunucuisim}  adlı sunucuya kaydın başarıyla yapıldı.
• İsim Yaş • **${isim} ${conf.ara} ${yaş}**
• Verdiğim Rol • <@&${conf.erkek}> 
• Aldığım Rol • <@&${conf.kayitsiz}>
`)

message.guild.members.cache.get(kullanıcı.id).send(embed2)

client.channels.cache.get(conf.kayitLog).send(embed)

}
exports.conf = {
    aliases: ['erkek','erkek-kayıt'],
    permLevel: 0
  };
  
  exports.help = {
    name: 'e',
    description: 'Erkek kayıt',
    usage: 'erkek'
  };```
#

what should I do?

pale vessel
#

Yeah

coral lichen
#

🤨

small tangle
#

as slay correctly stated message.author returns an user object, which does not have a roles property

coral lichen
#

message.member.roles

small tangle
#

yes

#

but only works when the message is coming from a guild (not dm)

coral lichen
#

Thank you so much <3

small tangle
#

^^

knotty zodiac
pale vessel
#

What's not working exactly?

unkempt jewel
#

hey guys any javascript developer who know how to connect to mongodb and get how much documents are in the collection?

slender thistle
#

Which driver are you using?

coral lichen
#

@small tangle

pale vessel
#

Debug and check what message is

small tangle
#

it it coming from direct message?

#

and what flazepe says

coral lichen
coral lichen
small tangle
#

1st step would be console.log i guess

pale vessel
#

If the object was an actual message it would've said Can't read property 'roles' of null

earnest phoenix
#

hi i need help

#

what scopes do i need for my bot

pale vessel
#

bot, duh

rose warren
#

And applications.commands if you use interactions / slash commands

earnest phoenix
#

ok

pale vessel
#

You don't even need bot if you don't plan on using guild related information

#

Only applications.commands

pale vessel
#

Sure

earnest phoenix
#

ty

#

and what about the support server link

rose warren
#

I wanna know how you tested your bot without knowing how to make an invite link... šŸ‘€

earnest phoenix
cinder patio
#

Hmm does anyone know if there's a way to detect when any npm package is updated? šŸ¤”

errant flax
#

how do i check if threads r enabled in a guild?

low bone
mint rain
#

How to do this?

low bone
#

"discord.js"

wheat mesa
#

Yeah

mint rain
#

Ok thx

mint rain
wheat mesa
#

Because you’re defining your object as discord then trying to use it as Discord

#

I highly recommend learning js before making a bot

#

Also your error is because your nodejs isn’t up to date

wooden ember
#

that and you need to actually put the bots token in the space where it says "this client token"

wheat mesa
#

That’s not his issue

#

His issue is that he’s on replit which uses nodejs v14 by default

#

He needs nodejs v16

mint rain
wheat mesa
#

ĀÆ_(惄)_/ĀÆ

#

Black magic replit stuff

mint rain
#

How?

wheat mesa
#

I don’t know

#

I don’t use replit

wooden ember
#

i thought the the latest version of d.js only needed nodev13?

wheat mesa
#

Needs v16

wooden ember
#

or am i wrong

#

bruh

#

my server is still on nodev12 lol

wheat mesa
#

Then your discord bot is using djs v12 or lower

wooden ember
#

it is

#

when i get a new hdd for my server ima reinstall another os from scratch

#

and thus wil have everything else upto date

woeful pike
#

step 1 of upgrading to discord.js 13: install gentoo

wheat mesa
#

This is how you install nodejs v16 on replit

#

@mint rain

mint rain
#

Hey?

#

@wheat mesa

wheat mesa
split hazel
mint rain
#

?

wheat mesa
#

šŸ¤¦ā€ā™‚ļø

#

Line 31 does nothing

#

That’s supposed to be in your .replit file

slender thistle
#

Can one combine multiple animations in one CSS ruleset?

errant flax
low bone
#

That's discord official announcement, idk if they changed something or didn't fully enable it for some cases

#

maybe try check the USE PUBLIC THREAD flag for @everyone role permission

wheat mesa
#

Ah

#

Thought it was v14

earnest phoenix
#

Even their fucking intellisense doesn't recognise ?. or tsx

wheat mesa
#

Lmao

errant flax
#

just use tim's method

earnest phoenix
#

And on mobile you get random this shit will error 69% scanned

wheat mesa
#

This is precisely why you shouldn’t use replit for discord bots

errant flax
#

to install 16.8

errant flax
earnest phoenix
#

how do i run node 16 on my windows 7

wheat mesa
#

Upgrade to windows 10

earnest phoenix
#

can't

#

i can upgrade to linux but too scared ill fuck the partition

wheat mesa
#

u p g r a d e

earnest phoenix
#

I'll just install Linux

low bone
earnest phoenix
#

look at the date of the article

low bone
#

filter use time

rose warren
#

Look at the date of Windows 7 KEKW

earnest phoenix
#

nov 5 was when node was at v12 which was the last version that supported windows 7

low bone
#

fresh article for you

earnest phoenix
#

bro

waxen bough
#

lost everything

earnest phoenix
#

it says missing DLL stuff which I'm pretty sure has nothing to do with windows and cannot be fixed with a single hack

earnest phoenix
waxen bough
#

that's fun

earnest phoenix
#

ooh nice 1 mbps only

#

downloading files at a peak of 1mbps on an internet connection that supports 300mbps is fun

low bone
waxen bough
#

lol I have half a megabyte speed

earnest phoenix
#

why do people assume nobody ever uses google

rose warren
#

Especially if you're planning on hosting your bot on your PC instead of replit...

earnest phoenix
#

also i love linux

low bone
earnest phoenix
#

the beta version at least

rose warren
low bone
#

i didn't use windows for some years since i installed my first linux

waxen bough
#

I'm happy with my kubuntu

earnest phoenix
#

who needs a vps for the beta version it's only in one server and private

rose warren
#

Oh if it's for testing that's ok

waxen bough
#

I made djs 13 run on replit

#

but I had to add polyfill

earnest phoenix
#

How to know unapproved bot?

split hazel
#

why did they drop windows 7 anyways

#

is it really a massive burden

earnest phoenix
#

Did you know Azure is run by Linux

waxen bough
#

What is Azure

errant flax
#

r threads automatically cached?

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Windows server is run by Linux lmfao

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

huh

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

linus tech tips lied

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

waxen bough
#

What if... hear me out... Windows, a Linux distro?

earnest phoenix
#

but i don't like windows mmLol

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

we poggin bro

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

waxen bough
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

i destroyed my partition with fdisk

#

hbu

waxen bough
#

oops wrong vid

earnest phoenix
#

what can i do while my ubuntu is downloading

vivid fulcrum
earnest phoenix
waxen bough
#

when I was in 8th grade I tried installing androidx86 I just wiped my win7 partition. I had to borrow the laptop from my mom's colleague to download win7 iso

vivid fulcrum
#

ooga booga edition ā„¢ļø

waxen bough
#

i thought it was cool back then

earnest phoenix
#

outside an emulator

earnest phoenix
#
Error:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/runner/day/node_modules/node-fetch/src/index.js
require() of ES modules is not supported.
require() of /home/runner/day/node_modules/node-fetch/src/index.js from /home/runner/day/commands/anime.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/runner/day/node_modules/node-fetch/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1015:13)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/day/commands/anime.js:5:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)``` ```js
code:
const { MessageEmbed } = require("discord.js");
const superagent = require('superagent')
const akaneko = require('akaneko');
const fetch = require('node-fetch');
const { discord } = require("discord.js");



module.exports = {
  name: "anime",
  aliases: ["weeb"],
  description: ("Vote"),
async    execute(message, args) {
let commands = message.client.commands.array();


const images = ['https://tenor.com/view/anime-gif-10117765','https://tenor.com/view/anime-anime-girl-girl-cat-gif-18514354','https://tenor.com/view/anime-gif-11006663','https://tenor.com/view/love-you-happy-anime-the-helpful-fox-senko-san-gif-14521920','https://tenor.com/view/sasuke-thinking-anime-naruto-gif-13593873','https://tenor.com/view/cute-anime-dancing-silly-happy-excited-gif-13462237','https://tenor.com/view/anime-anime-glasses-stare-glasses-gif-15313333','https://tenor.com/view/blush-anime-shy-cute-girl-gif-16149781','https://tenor.com/view/anime-laughing-gun-bang-gif-16899324','https://tenor.com/view/anime-pillow-gif-14847650','https://tenor.com/view/yawn-tired-anime-manga-japanese-manga-gif-9525859','https://tenor.com/view/bokuno-hero-academia-izuku-midoriya-deku-happy-gif-12815749','https://tenor.com/view/smug-anime-face-gif-6194051','https://tenor.com/view/chuunibyou-anime-kawaii-yes-gif-8215787','https://tenor.com/view/windy-texting-lonely-anime-boy-night-gif-14590288','https://tenor.com/view/anime-kafuu-chino-okuda-yousuke-swinging-white-fox-gif-10654450','https://tenor.com/view/smile-naruto-shippuuden-anime-happy-gif-8073510','https://tenor.com/view/sad-alone-anime-gif-9941414','https://tenor.com/view/anime-dancing-brushing-teeth-fun-gif-9167366','https://tenor.com/view/love-anime-kiss-hot-damn-gif-9838409'];
const image = images[Math.floor(Math.random() * images.length)];




let embed = new MessageEmbed()
    .setTitle("Enjoy >-<")
    .setColor("RANDOM")
    .setImage(image)
     .setFooter(":p sussy baka")
     embed.setTimestamp();
       return message.channel.send(embed).catch(console.error);
  }
}```
waxen bough
#

how about put "type": "commonjs" in your package.json

split hazel
#

you shouldn't have to change your node to module support because of a library

#

what version are you using

earnest phoenix
#

@split hazel it like v12 i think and it works on others and not this

split hazel
#

v12 nodejs?

#

im guessing you mean discord

earnest phoenix
#

I am lord cringe of the universe

const zero  = build(0);
const one   = build(1);
const two   = build(2);
const three = build(3);
const four  = build(4);
const five  = build(5);
const six   = build(6);
const seven = build(7);
const eight = build(8);
const nine  = build(9);
earnest phoenix
cinder patio
#

any npm package in the entire registry

earnest phoenix
#

I don't think there is a way to do that without checking every single package every few hours

#

and what are you doing that requires tracking every package lol

cinder patio
#

There's a "Recently updated packages" section in the npm docs but I don't want to scrape it, but I can't find any official API sooo that may be the only option

earnest phoenix
#

Why would there be a problem with scraping it

#

You can temporarily copy the page to a file on your server and scrape that so if the app blows up it won't affect npm

cinder patio
#

Since it's looking for updated packages it needs to make a request very often, also the results on the page don't seem very accurate...

earnest phoenix
#

time to reboot my pc

quartz kindle
#

apparently they have webhooks, but not for the entire thing at once, you have to specify package names, scopes or authors

earnest phoenix
#

package: *

quartz kindle
#

also might be limited to paid accounts

#

idk

cinder patio
#

sigh, welp

split hazel
#

subscribe to github premium today

earnest phoenix
#

hi

#

anyone can explain me why when i execute the command "cambiar" it change the nickname to "Apodo Moderadoundefined"?

#
const { MessageEmbed } = require('discord.js');

module.exports = {
    config: {
        name: `cambiar`,
        aliases: [`c`]
    },
    run: async (bot, message, args) => {
        message.delete()
        const persona = message.mentions.members.first()

        function randomid() {
            var x = Math.floor((Math.random() * 99999999999) + 1);
            document.getElementById("demo").innerHTML = x;

            if(!message.member.hasPermission(`MANAGE_NICKNAMES`)) return message.reply(`No tienes permisos!`)
            if(!persona) return message.channel.send("Menciona a alguien para cambiar su apodo")

            persona.setNickname('Apodo Moderado' + x)

          }

        message.channel.send(`**${persona.user.tag}** ahora se llama **${persona.nickname}**`)
    }
}
wheat mesa
#

Because x is undefined

earnest phoenix
#

var x = Math.floor((Math.random() * 99999999999) + 1);

wheat mesa
#

You defined it in a function, a function in which you never called

earnest phoenix
#

Ah ok ik

solemn latch
#

plus its a global var, in this case its unlikely to cause an issue, but best to make it a const.

wheat mesa
#

Yeah

#

Avoid using var

earnest phoenix
#

thanks for the advice

wheat mesa
#

Use let or const depending on the circumstances

earnest phoenix
boreal iron
pallid jungle
#
                    const err = new discord.MessageEmbed()
                    .setDescription(`![Wrong](https://cdn.discordapp.com/emojis/812104211361693696.webp?size=128 "Wrong") I couldn't lock ${channel}!`)
                        message.channel.send({ embeds: [err] })

It spamming with embeds for every embed a channel how to but all in one ?

vivid fulcrum
#

did you have a stroke

pallid jungle
low bone
#

since i think this will send a single embed, but your probably using loop or somethin

#

to loop over all channels?

outer wing
#

theres like anyone know an example for css and html example for use on top?

earnest phoenix
#

how is multuple embeds allowed for a bot user

solemn latch
#

it was allowed a few api versions ago

earnest phoenix
earnest phoenix
outer wing
solemn latch
#

you could use the default page css as an example

#

f12

low bone
earnest phoenix
#

not in a single message

low bone
#

didn't they use embeds:[...] format

#

it's allowed for single message xD

earnest phoenix
#

only webhooks can use up to ten embeds in the same message

earnest phoenix
low bone
#

sigh, in the latest update, it's allowed u can try it

#

i tried it already in my bot šŸ˜„

#

in latest djs version they changed the format for a reason šŸ˜„
from channel.send({embed:..}) to embeds:[]

#

so u can attach multiple embeds in single msg

earnest phoenix
#

v13 supports up to 10 embeds

earnest phoenix
#

see this is what bad docs does to you kids

#

you miss out on a lot of new stuff

sleek garden
#

i want to make my bot open source, what license do i choose so that anyone viewing the repositry can copy it or something like this

earnest phoenix
sleek garden
earnest phoenix
solemn latch
earnest phoenix
#

Supports 10 embeds

solemn latch
#

most libs didnt even change anything to support this though, it was just discord adding support for it

#

not something they needed to document

earnest phoenix
low bone
#

well actually the doc mentioned it šŸ˜„

solemn latch
#

i think code uses py

low bone
#

thats js

earnest phoenix
#

Py should support it too,with raw api request

solemn latch
#

yeah

#

i dont think py has added any direct support for it

earnest phoenix
#

maybe forks of d.py will support it soon

pallid jungle
low bone
#

what you mean

#

timeout like setTimeout? delayed message?

pallid jungle
low bone
#

you want it for example send them all but with delay of 1 second between each message?

#

let's assume, all messages embeds are stored in an array messages
assuming the function that your code within is async one

for(let msg of messages)
{
    await new Promise(r=>setTimeout(r,1000)) // to force it to wait 1s 
    await channel.send(embeds:[msg]).catch(console.error)
}

something like that

pallid jungle
#

ok

pallid jungle
#
      const url = (res[0].match(/\d{17,19}/)||[])[0];
      const id = res[1];

        const embed = new MessageEmbed()
        .setAuthor(message.author.username, message.author.displayAvatarURL())
        .setTitle(`![Correct](https://cdn.discordapp.com/emojis/812104211386728498.webp?size=128 "Correct") Successfully deleted **${count}** messages from this channel!`)
        .setColor('DARK_GREEN')
        .setDescription([
          `[\`šŸ“„ View\`](${url ? `https://txt.discord.website/?txt=${url}/${id}/bulkdlt-${_id}`:''})`,
          `[\`šŸ“© Download\`](${res[0]})`
        ].join('\u2000\u2000•\u2000\u2000'))
        message.channel.send({ embeds: [embed]})

Why the links not working ?

solemn latch
#

in what way are they not working?

pallid jungle
#

Not link words like

#

They are not blue

#

You know

low bone
#

u sure it's valid link?

pallid jungle
#

It was working before i update to v13

low bone
#

can you console.log what inside setDescription

pallid jungle
low bone
#
const id=..
const desc=[
          `[\`šŸ“„ View\`](${url ? `https://txt.discord.website/?txt=${url}/${id}/bulkdlt-${_id}`:''})`,
          `[\`šŸ“© Download\`](${res[0]})`
        ].join('\u2000\u2000•\u2000\u2000')
console.log({desc})
...
.setColor('DARK_GREEN')
.setDescription(desc)
pallid jungle
#

Nvm i fixed it

proven lantern
#

can type: 1 slash commands be invoked by a DM to the bot?

#

nm, it looks like it can if the command is registered globally

modern sable
proven lantern
modern sable
#

a mod

proven lantern
#

šŸ‘

#

is there some way to test a DM slash command without registering the command globally? i want to test it before registering it globally

cinder patio
#

why not use a test bot?

proven lantern
#

thanks

sudden geyser
#

Yeah

proven lantern
#

i think this must be it

#

once i enable this i can set a description

sudden geyser
#

Yep

#

It'll be under Community > Overview > Server Description

proven lantern
#

thanks!

crystal wigeon
#

Hey umm

#

Anyone know how I can link PayPal and discord?

#

But how do I detect if someone actually made some donation or not. Currently I integrated PayPal sdk, to verify if it was a success or not.

solemn latch
crystal wigeon
#

Thanks!

#

But this requires a business account or something?

solemn latch
#

probably

#

if you are accepting donations through paypal you should have a business account

boreal iron
#

It can be upgraded easily and tested as well using PayPal's sandbox environment.

summer torrent
#

what happened to DonateBot btw

solemn latch
boreal iron
#
    url: 'https://top.gg/api/bots/756928506327466085/stats',
    status: 504,
    statusText: 'Gateway Time-out',

hehe and I was the guy arguing yesterday I wouldn't experience any issues posting the bot stats
and there we go...

#

It's just funny sometimes

solemn latch
#

504's happen sometimes with the api

#

always good to check for status code issues with any external api

boreal iron
#

yee ik, just stated yesterday I never had issues before

#

after saying this, something must have happen

boreal iron
drifting shell
#

Currently my bot shows how many guilds it's connected to (voice channels) and how many are playing music with its stats command, I'm planning to buy another server to split load but I'm uncertain on how I could still get that metric for all of them rather than having to get metrics individually. My idea was to have a "heartbeat" where it periodically sends how many it has active now and then just tot them up but I was curious if anyone had any other ideas on how to do that.

solemn latch
#

id do exactly that, just provide the shard id in each request, should be rather straight forward code wise.

drifting shell
#

yeah

simple stump
#

Probably being dumb, but I have an issue with some MySQL stuff. Essentially, I want to check if an user exists in a database. If they do, insert them. Otherwise, say they already exist and remove their role and give them a new one. However, I get an error when executing this code:
https://sourceb.in/54QsxUTv7Q

    con.query(`SELECT EXISTS(SELECT * FROM rbridge WHERE id = '${id}')`, (err, rows) => {
        if (err) throw err;

        let sql;

        if (rows.length < 1) {
            sql = `INSERT INTO rbridge (id, elo, name) VALUES ('${id}', '1000', '${name}')`;
            console.log("Inserting " + id + "...");
        } else {
            message.member.roles.add(role);
            message.member.roles.remove("878277437962739713");
            message.member.setNickname('[1000] ' + name);
            message.reply("You're already registered!");
        }

        con.query(sql);
    })
}
rose warren
#

Take the first query out of the SELECT EXISTS

simple stump
#

alr

#

as in log it?

rose warren
#

No

#

Remove the SELECT EXISTS and brackets

simple stump
#

i did. i get the same error

rose warren
#

What's the error?

simple stump
#

line 660 is con.query(sql);

#

asdf i gtg btw sry ill check this back in a few hours

rose warren
#

Oh

#

Move con.query(sql) up into the if statement

#

If you trigger the else then the query is empty

#

So the query should be made inside the if statement

rose warren
azure lark
#

how do i find a guild by using its id with djs v13?
client.guilds.cache.get("ID")
i am trying to do this but it dosent not work for me.

sudden geyser
#

You could also use .fetch(...)

sudden geyser
#

Which will send an HTTP request if it wasn't found in the cache

quartz kindle
#

why doesnt it work?

#

i mean, what happens when you try it?

azure lark
#

and it is showing no guild in console

rose warren
#

What's your guild variable?

#

Are you defining it?

azure lark
#

const guild = client.guilds.cache.get("ID")

rose warren
#

Is the ID actually a guild ID?

azure lark
#

yes

rose warren
#

Is your bot in that guild?

azure lark
#

yes

#

and i have all intents

rose warren
#

Is that literally what you have written or do you do something like

const guild = client.guilds.cache.get("264445053596991498")```
azure lark
#

i have,
const guild = client.guilds.cache.get("853698843018002443")

rose warren
#

Is your client actually called client and not bot?

azure lark
#

yup

rose warren
#

You'll have to show us more code then because something's not in the right place

azure lark
#

i have this as my function,


async function modmail(client, options = []) {
  let { MessageButton, MessageActionRow } = require('discord.js')



const guild = client.guilds.cache.get("853698843018002443")

if (!guild) return console.log("No guild")

client.on("messageCreate", (message) => {

  if (message.channel.type === "DM") {
    
console.log("Sent In Dms")
}
})
}
module.exports = modmail;```
pale vessel
#

you need to make sure your client is ready first

azure lark
#

could i just put it inside the ready event then?

rose warren
#

What are you trying to do?

#

Why is there a message event there?

azure lark
#

modmail function,

rose warren
#

Is this in your index file?

azure lark
#

no

#

its a different one

#

it works now, i used the function insde the ready event

green vale
#

ayo everyone! this is a general question about JavaScript/TypeScript's ES ecosystem, not a discord bot question, per se.

i'm creating a library in ES-based ts that supports both ES6< and CommonJS. how can i avoid having to make it so users have to require the default property of an ES6 export? i can't exactly export directly and i need to have my class as a variable since i'm also exporting the library as a global for browser environments. using both module export declarations and ES module expressions work, however require'ing the module.export into a project won't display JSDoc information as i want it to. how can i set up interop properly to make both ecosystems (ES and CommonJS) work?

split hazel
#

stupid nokwok user (hello)

#

anyways

split hazel
#

you're the second complaint i've seen today about it

green vale
#

actually not exactly

split hazel
#

idk i havent touched node in a while i only really touch c++ now

green vale
#

fair enough, this has always been a thing with ES modules with CommonJS

#

because like if you just use export default then you will always get it as the .default instead of just module.exports or whatever equivalent

#

idk how to do proper interop without the .default property tho

green vale
paper solstice
#

can we use button-role instead of react-role to advoid bot reacting?

quartz kindle
#

you likely have to mix several types of exports together

#

for example ```ts
export class MyClass {}
export default MyClass
export = MyClass

green vale
#

this is my current export code

#
export default ExchangeRate; // ES6< module export expression
global.NodeExr = ExchangeRate; // Browser global declaration
#

i'm exporting a global (types already defined) and an ES6 module, all i need is to export CommonJS

quartz kindle
#

you can try export = ExchangeRate

#

is ExchangeRate a class or a function?

green vale
#

it's a class

quartz kindle
#

is it also exported?

#

export class ExchangeRate

green vale
#

wait

#

if i do a direct export can i still access it locally

quartz kindle
#

yes you should

green vale
#

okay

#

let me go ahead and attempt also exporting to module.exports alongside the export, however i'm not sure if that'll work because it would just rewrite correct?

quartz kindle
#

if you're using pure ts, you cant use module.exports i believe

#

unless you're writing js + .d.ts

spark flint
#

dude can anyone help me with some css shit

#

this is my main site, button works perfectly

split hazel
#

that's great to hear brother

spark flint
#

other site, same code, button doesn't show text

green vale
#

if thats what u mean

quartz kindle
#

i mean exporting with module.exports instead of export

green kestrel
#

anyone else here thinking github pages is a bit dumb

#

ive tried so hard to get on with it

spark flint
#

i prefer digitalocean apps

green vale
spark flint
#

save to repository, automatically updates your site

green kestrel
#

but its like.... remember when someone made a filesystem driver where it stored its files in gmail? gh pages reminds me of that

#

git repos are NOT convenient storage for websites

quartz kindle
spark flint
green vale
#

well it works but jsdoc doesn't show up in vscode

green kestrel
#

yeah my site is static too, but it updates on a cron

quartz kindle
#

did you try export = tho?

green kestrel
#

and the git history grows... very quickly

green vale
#

yeah it's telling me that i cant use it in ES modules or summa

quartz kindle
#

shit like this is why i dont use ts

green kestrel
#

im thinking of moving my docs pages back to my hosting

green vale
green vale
#

but im working on a node library and this is probably the best place to use ts

green kestrel
#

then i dont have to do silly shit like push it to a git commit to deploy it, then deal with githubs strange caching and delays

spark flint
green vale
#

I just host it on Vercel

spark flint
quartz kindle
spark flint
green vale
#

^

quartz kindle
#

you can always use js + .d.ts

#

which is what i do

green kestrel
#

i already got tons of hosting

quartz kindle
#

you get the same intellisense as ts

green kestrel
#

i just thought it made sense to centralise a github project and host its site on gh too

#

but nope it sucks

green vale
spark flint
split hazel
green vale
#

require isnt failing so i might just export it using just module.exports and maybe that might work

#

agreed

green kestrel
#

i have a dedicated server, one more static site wont hurt it

green vale
#

that's why i just didn't touch it at all before now

green vale
green kestrel
#

what do you put on them?

green vale
#

tbf i have the dedis running in a docker swarm running my api so

quartz kindle
#

although from what i remember, having both export class and export default should work

green vale
#

a lot of stuff like backups and ddos prot

quartz kindle
#

can you show the generated js code?

#

of you use export class MyClass + export default MyClass

green kestrel
#

big bot?

green vale
green vale
# green kestrel big bot?

no bots at all, i stopped coding discord bots primarily (i only manage one massive-resource-heavy bot now)

green kestrel
#

ah ok

#

ive spent all day wrestling with github actions and CI

green vale
#

just use vercel or netlify, its a lot better than trying to wrestle with pages or your own thing

green kestrel
green vale
#

@quartz kindle it's transpiled to this:

exports.ExchangeRate = ExchangeRate;

global.NodeExr = ExchangeRate; // Browser global declaration
green kestrel
#

github actions is continuous integration, not related to hosting

green vale
#

yea ik

green vale
#

i thought u were using actions in conjunction with pages or whatnot

green vale
green kestrel
#

so i send a push, or someone submits a PR, it tries to build it for linux across 2 compilers, OSX, and windows x64, then as well as confirming good/bad build it outputs zips/debs of the build

spark flint
#

anyone here know how to use gradient buttons properly lmao

green kestrel
#

nah ive considered actions for page deploy

#

but examples i found have the same problem of quickly building up a huge commit history

quartz kindle
green kestrel
#

lmao

quartz kindle
#

running it as a github actions thing

#

lmao

green kestrel
#

yeah you could

spark flint
#

lol

#

just get a cheap vps

green vale
quartz kindle
#

although afaik github actions has a time limit on all processes

green kestrel
#

if its not against githubs TOS i was going to do D++ unit tests in actions, with a token in the secrets

quartz kindle
#

like 4 hours o something

green kestrel
#

nice, gitlab cluster sounds expensive @green vale

green vale
#

it's not expensive at all

green kestrel
#

my next todo is to figure out how to build an arm7 deb for raspberry pi

green vale
#

it's just my three dedis and a bunch of vpses hooked together with docker containers running gitlab's ci runner

green kestrel
#

somene got the lib to build on an rpi 4 and confirms that it runs awesome there. like ten megs of ram for a bot YES PLEASE

#

lol

green vale
#

i made my gitlab github hack thingy before i figured out that Actions had its' own BYOR/BYOD thing

green vale
green kestrel
#

so im gonna make that its unique selling point so to speak and "corner the market" on compact bots running on pi

quartz kindle
#

lel

green kestrel
green vale
#

these days if i learn a new language (like C# or Rust) i just make an overkill hello world program (or in the case of C# i just used Unity)

green kestrel
#

that and it doesnt scale well

green vale
#

js was my first programming language, been working with it for like 5-6 years now?

#

yeah it doesnt scale well

#

if i had to scale my bot then i would use js workers if i had to use js

#

otherwise i'd just use JDA or something

quartz kindle
#

discord.js doesnt scale well

green kestrel
#

im used to running 112k guilds in 2gb ram

quartz kindle
#

js can scale well if you know what you're doing

#

not as well as a low level lang of course, but decently well

green kestrel
#

not 112k guilds in 32gb ram lol or whatever djs would like to use im sure

green vale
#

djs is cache-heavy

green kestrel
#

a lot of the cache can be turned off though yes?

green vale
#

using something like djs lite

quartz kindle
#

yes but even so, discord.js caching is very inefficient by design

green kestrel
#

the beautiful thing about compiled low level languages like C++ and rust is that you can just leave the caches on, and it still doesnt eat much ram

green vale
quartz kindle
#

im working on my own js lib

green vale
#

i might learn Go but apparently that's a sin

quartz kindle
#

still doesnt have caching tho

green kestrel
#

every time someone learns Go, a Rustacean loses a finger

quartz kindle
#

but runs 10k guilds on 20-30mb including node.js itself

slender thistle
#

😭

green vale
#

yeah i'm sort of learning Rust now?

green vale
#

wait

#

am i reading that RIGHT??

green kestrel
#

according to node.js itself? i bet it lies

#

šŸ˜„

quartz kindle
#

i mean, its just the websockets, no caching yet

green vale
#

my bot with like 200 guilds takes like 512mb

green vale
green kestrel
#

my htop is ... well.... lemme show you šŸ˜„

quartz kindle
#

heap says 5mb, rss says 30mb, task manager on windows says 25mb

#

ĀÆ_(惄)_/ĀÆ

green kestrel
spark flint
green kestrel
#

i have 18 clusters, each of those screen is a cluster and the green are ofc threads

green vale
#

the amount of processes in there deadass made me choke

green kestrel
#

a cluster hosts about 9k guilds and uses between 150 and 250mb ram

spark flint
#

just looked and i pay £3.14 for a 2gb ram vps with 25gb storage, 3tb bandwidth

green vale
spark flint
green kestrel
#

so i could get ram usage down a lot if i ran less clusters, but less clusters means less fault tolerance

quartz kindle
green vale
#

i run my own infra off of OVH and stuff (and not just using rented VPSes) because i run a massive ddos prot network for mc and stuff

green kestrel
#

user cache is off, or it'd use about 8gb in total across all the clusters

quartz kindle
#

ah

green kestrel
#

i have over 12 million visible users now

#

plus it'd hurt startup times lol

#

as i'd have to members-chunk 12 million records

quartz kindle
#

discord.js v12 uses 600mb on 9k guilds
discord.js v13 uses 900mb on 9k guilds

#

all caches on

#

but im confident a well designed js cache can stay below 300mb

green kestrel
#

its a challenge

spark flint
#

i'm buying my own server for £15 with 8gb ram, intel xeon xxxx-ican't rememeber the exact

quartz kindle
#

im gonna give it a try

green kestrel
#

because js memory management is just "smoke em if you got em"

#

if i was doing that i'd pre-allocate an array, and have a bitmap of whats free and what isnt

spark flint
green kestrel
#

or have a native C++ node module to do memory management

#

like buffers

quartz kindle
#

i have those two options as well

green kestrel
#

only without suck

quartz kindle
#

in fact im gonna try all 3 options

#

native js, c++ backed, and buffer backed

green kestrel
#

whatever happened to making a js wrapper around D++

#

and using its native caches

quartz kindle
#

not a bad idea tbh

#

the issue with going non-js caching on a js lib is that you have to serialize every operation

#

which puts a dent on performance

green vale
#

let me check what my dedi has

#

well my main

spark flint
#

alr

green kestrel
#

Ā£15 for a dedi? thats really cheap

spark flint
#

yeah

#

ik

green kestrel
#

wheres it hosted, someones shed?

spark flint
#

no

green kestrel
spark flint
#

my garage

spark flint
green kestrel
#

youve basically got roughly same setup as me

spark flint
#

thats cool

green kestrel
#

which ovh dc you in?

green vale
#

oh and before you come and curse me off for using python it's not flask it's just a short name

#

i'm in ERI1, London

green kestrel
#

i heard you should host at RBX if you like hot swap kek_laugh

green vale
spark flint
#

oh nice

green vale
#

LMAO yeah RBX is shitty

#

my friend bought a server there, it went down within 9 hours

green kestrel
#

im at a german one

spark flint
#

i use projectsend at the moment

green vale
#

which LIM dc? LIM1 or LIM3?

spark flint
#

as in i downloaded today

green kestrel
#

i picked the german one as was the only one that had dual NVME in stock during the silicon shorage

#

shorage/shortage

green vale
#

ahh

#

do u know what dc ur in exactly

green kestrel
#

and i really REALLY needed it for db performance

#

sec

green vale
#

ouch

green vale
#

either one, windows or linux

split hazel
#

all synchronous overhead

green vale
#

i would just try my hardest to avoid any C++ in my Node code

green kestrel
#

god their control panel is slow tonight

#

i dont log into it often

green vale
#

unfortunately thats not possible sometimes

#

OVH or SYS?

green kestrel
#

OVH

green vale
#

good lord

#

sometimes it takes like 5 mins for me to get to my server's page on OVH

green kestrel
#

im at Limburg (LIM1) - Germany

split hazel
#

for example I tried a large array of numbers from js to c++ and the conversion from js types to c++ types is very slow

green kestrel
#

before this i had one at poland warsaw

green vale
#

ahh, ik that LIM3 is shitty and we had a tonne of issues with hosting in LIM3

green kestrel
#

it was fast enough network wise, but it had HDDs

green vale
#

LIM1 is good

spark flint
#

i used ovh to buy a domain and then it took 3 days for them to update dns

#

like jesus

green vale
#

WAW is a really really good DC

spark flint
#

i made a working static site generator tonight and im legit so proud of myself lol

green vale
#

my advice

green kestrel
#

i get all my domains at the cheapest reseller now, i do a search

green vale
#

use smth like namecheap or porkbun for domains

spark flint
#

for all

green vale
#

fairs

green kestrel
#

then as soon as i can, at first renewal i transfer them to cloudflare

spark flint
#

well no

#

lcn for free .co.uk and .uk and £1.95 .com domains