#development

1 messages ยท Page 1942 of 1

proven lantern
sudden geyser
#

@woeful pike (forgot to hit reply)

neat ingot
proven lantern
#

~35% of the 512 mb available

quartz kindle
# proven lantern

not sure which of them is which, but the top 2 are using 99mb ram each

proven lantern
#

51mb each

#

right?

#

10% of 512mb

woeful pike
#

yeah I understand what you're saying but that increasing program complexity doesn't go away with dynamic types, it's more of an "out of sight out of mind" situation if anything

quartz kindle
#

RES is what really counts as memory usage

#

but they have about 30mb which is shared (SHR)

#

so basically the process is using 99mb of ram, but 30mb of which is shared with other processes, so when you put it all together, it accounts for less % of the total available ram

proven lantern
#

that's nice of node to share

#

i have 2 shards so the top two node processes are probably the shards

quartz kindle
#

yeah, multiple node instances probably share quite a bit of ram

quartz kindle
#

alternatively you can always run process.memoryUsage from an eval command

#

and/or use broadcastEval to check other shards as well

sudden geyser
#

I think some of it does and some of it doesn't. Person1 and Person2 may be compatible here and there, so you do need to concern yourself about it, which can be annoying and complex, but now you can share most of the semantics that are compatible.

neat ingot
#

i think they recommend just calling process.memoryUsage.rss() nowadays

#

~ its faster according to docs

proven lantern
#

im too scared to run eval on my server

quartz kindle
#

xD

neat ingot
#

yolo!

quartz kindle
#

but sometimes its good to also have heap and external information

neat ingot
#

yea but does the rss show total combined? like, isnt heap a part of whats showin in rss?

#

idk tbh, but i thought it was

quartz kindle
#

yeah, rss is basically what RES shows in top

modest maple
#

Just manually calculate your memory usage based off of your typ- oh wait

quartz kindle
#

but for example if you're debugging memory issues, looking at the differences between rss heap and external will help you locate the problem

#

high external = buffers, high heap = js objects, high rss but low everything else = c++/native addons/fragmentation

neat ingot
#

hmm, i never thought of that tbh. i suck at debugging memory leaks lol

#

hence: 3.5gig on my nub bot

#

lol

quartz kindle
#

lel

proven lantern
#

there was a memory leak on one of the mongodb version a long time ago and it kept crashing the nodes

quartz kindle
#

wasnt there also a weird issue on the official mongodb driver for node?

neat ingot
#

๐Ÿ˜ฎ

quartz kindle
#

that crashed the processes

neat ingot
#

i love me some mongodb

#

never had any issues with it

#

~ or never noticed ๐Ÿ˜„

quartz kindle
#

i dont really like mongo, but i only tried it once tho

modest maple
#

Mongo has a good history of what not to do when building a database tbh

quartz kindle
#

xD

hidden gorge
#

I wrote the discord button code in my command file but when i do the slash command there is no button

modest maple
#

They spent most of their initial investment budget fixing their original mistakes

neat ingot
#

i used to use sql, but i used to use php. when i moved to js for everything, mongodb and node's mongoose module just made sense, everything is in the same language now

#

~ bar html/css

modest maple
#

Like using memmap for file handling only to realise... That they have no idea if the os has actually fully stored the data or not or what's being cached or not

quartz kindle
#

memmap is notoriously hard to use, from what i've seen/heard

modest maple
#

Well in alot of cases people use it for the wrong things

#

It's great for WORM based systems

quartz kindle
modest maple
#

But it's nearly always faster and more efficient to write a custom system the issue with tbat though is that's even harder

hidden gorge
#

uhh

neat ingot
#

i cant help but read your name as roblox

#

stop it!

#

๐Ÿ˜›

modest maple
#

Overall though memmap is actually quite simple

hidden gorge
#

well crap my laptop crashed and it wasn't able to save the changes

quartz kindle
#

wasnt there a stupid fast db based on memmap?

modest maple
#

No

#

Or atleast its not stupid fast compared to the standard dbs

neat ingot
#

if sql is the standard db, mongodb craps all over that in terms of speed

quartz kindle
#

let me try to remember what it was called

hidden gorge
#

@quartz kindle Here is the code

modest maple
#

In databases its always faster to write a custom buffer pool system than the OS because you have context of what the program is actually doing

neat ingot
modest maple
#

Postgres remarkably is actually one of the only databases that actually even relies on the file system cache to be efficient (double buffering)

hidden gorge
#

let me check

hidden gorge
#

it says client is not defined

neat ingot
#

i dislike having to pre-register the commands. but i get it

#

just a pain when making changes ๐Ÿ˜„

hidden gorge
#

yeah it's registered

#

oh wait @neat ingot I missed some code

quartz kindle
hidden gorge
#

uh

quartz kindle
#

the client variable needs to be accessible

modest maple
#

And yeah its um, interesting xD

quartz kindle
#

if you want to use client in other files, you have to send it, or access it from something that includes it

hidden gorge
#

wow i don't even understand what your saying

modest maple
#

Its fast, for an embedded database, although sqlite is generally still the better choice if you need fault tolerance

quartz kindle
#

In 2011 Google published software which allowed users to generate micro-benchmarks comparing LevelDB's performance to SQLite and Kyoto Cabinet in different scenarios.[12] In 2012 Symas added support for LMDB and Berkeley DB and made the updated benchmarking software publicly available.[13] The resulting benchmarks showed that LMDB outperformed all other databases in read and batch write operations.

#

lel

quartz kindle
#

but its not very well maintained

neat ingot
#

at the end of the day, there are a lot of good db choices out there

#

as long as your not manually trying to write your entire db to json or something, your probly doing ok

#

(and even doing json writes can be good enough for small data chunks)

quartz kindle
# hidden gorge im confused

everyting in the red square is supposed to be in your main file, or whichever file you use to add the event listeners

neat ingot
#
{
  "bootups": 848,
  "release": "12/18/2021, 11:33:07 PM",
  "version": "0.8.48"
}```
#

^ is the contents of a json file that auto updates upon each boot during development

quartz kindle
#

kinda

hidden gorge
#

Uh @quartz kindle I got this DiscordAPIError: Unknown interaction at RequestHandler.execute (/home/runner/Nodejs-16/node_modules/discord.js/src/rest/RequestHandler.js:349:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (/home/runner/Nodejs-16/node_modules/discord.js/src/rest/RequestHandler.js:50:14) at async CommandInteraction.reply (/home/runner/Nodejs-16/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:98:5) at async Client.<anonymous> (/home/runner/Nodejs-16/index.js:49:3) { method: 'post', path: '/interactions/921926470606127124/aW50ZXJhY3Rpb246OTIxOTI2NDcwNjA2MTI3MTI0OlZEY2dGeVRIM290d3cyNGQ4VWhhSnJONkphRVlJV2lmNFZMZ04xOFJ3UzFHNTh0Z0NoazR1YVMyeURLS3ZoSkZqSGtaNUZlMTJ4Zjk4VDBtdjN2ZUY5TWUyT2pGRXIycEZIMkRnRmUxdXZ3TFM0b2tXUVZVZ1lKUkFlUGRZenox/callback', code: 10062, httpStatus: 404, requestData: { json: { type: 4, data: { content: 'Pong!', tts: false, nonce: undefined, embeds: undefined, components: [ { components: [Array], type: 1 } ], username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined } }, files: [] } } exit status 1 ๎บง

hidden gorge
#

ok

neat ingot
#

version numbering* doesnt really manager shit

#

lol

modest maple
quartz kindle
#

i see

hidden gorge
#

@quartz kindle Can i send you a hastebin link of my index?

modest maple
#

Each key value pair yhey did was only 116 bytes

#

Not that it matters much because in reality sqlite is still the most used db in the world

#

And no one is gonna top it for its utility lul

quartz kindle
#

yeah

#

it pretty much destroys everything else in the small apps market

hidden gorge
#

@quartz kindle I sent you my hastebin file of my index in dms

quartz kindle
#

you have a duplicated listener

hidden gorge
#

oh

#

so I remove the one

quartz kindle
#

each interaction will execute both of those codes

#

yeah remove one

hidden gorge
#

AYO @quartz kindle Thanks

quartz kindle
#

๐Ÿ‘

#

if you want to put that code inside ping.js, you have to require the file, the run execute(interaction)

#

otherwise you can delete ping.js since you're not using it right now

obtuse valley
#

Do you guys use cogs when you make discord bots using discord py?

sudden geyser
#

yes

#

but discord.py is deprecated, so other libraries may do it differently

spark flint
#

Pycord is good

sudden geyser
#

how does it face against nextcord

hidden gorge
#

I added a new slash command to my bot why is it not showing on the slash command popup

#

oh ok

#

Thanks good to know

earnest phoenix
#

Why buttons are not there

#

My code is fix i guess

sudden geyser
#

fixn't

outer zenith
#

wats the difference between let and var kekw

quartz kindle
#

let is block scope, var is function scope

wheat mesa
#

aka don't use var

outer zenith
#

wat

#

wat if u want like global vars or somethin idk

quartz kindle
#
function bla() { // this is a function scope
  let a = 1;
  var b = 2;
  for(xyz) { // this is a block scope
    let c = 3;
    var d = 4;
  }
  // c does not exist here
  // d does
}
wheat mesa
#

that ^

#

var is deprecated

#

in 99% of cases you don't want to use var, it's just outdated

quartz kindle
#

its not deprecated

wheat mesa
#

it isn't?

outer zenith
#

oh

#

i see

#

i get what u mean

quartz kindle
#

its part of the language standard

wheat mesa
#

shit I read this thinking it was js lol

quartz kindle
#

lmao

outer zenith
#

cause defining vars in like for statements isnt really useful outside of it

#

ok

quartz kindle
#

another difference is that let cannot be redeclared, var can

#

so with var you can accidentally overwrite another var with the same name

#

with let it will error

lament rock
#

fuck initialization modifiers. All my homies implictly assign to global ๐Ÿ˜Ž

quartz kindle
#

another difference is that var defaults to undefined if you try to use it before initializing it

#

let will error if you try to use it before initializing it

earnest phoenix
#

hi

#

so

#

i just wanted to ask

#

does the discord.js api have an event like client.on('error') or something like that

neat ingot
earnest phoenix
neat ingot
#

yea that should be fine

earnest phoenix
#

i tried using that

#

but

#

its not working

#

im using v12 btw

neat ingot
#

v12 still has the same event for the client so that shouldnt be an issue

#

if your using like exactly above, your missing an )

#
client.on('error', console.log);```
#

or

#
client.on('error', error => console.log(error.message));```
#

i'd do one of those ๐Ÿ™‚

earnest phoenix
#

let me try

#

wait also

#

what if when i want to send the error to the channel lets say

neat ingot
#

then do it? ๐Ÿ˜„

earnest phoenix
#

no i mean

neat ingot
#

as long as its not an error that causes app termination it should be fine ~ assuming your bot has access to the channel

earnest phoenix
#

would it be like

#

error.channel.send(my stuff here)

earnest phoenix
neat ingot
#

oh, no, the error object only has error data

earnest phoenix
#

oh

#

how would i get the channel then

neat ingot
#

you would still use the channel object for whichever channel you want to send the message to

earnest phoenix
#

๐Ÿ˜•

neat ingot
#

which channel is the question? ๐Ÿ˜›

#

that error event doesnt happen on a channel, it happens on the client

earnest phoenix
#

well yes

#

but

neat ingot
earnest phoenix
#

i want the bot to say that to the user who invoked the command

neat ingot
#

thats a function i used in my old v12 bot to get a specific channel for sending report messages

neat ingot
#

but it would only work for sending to a specific channel in a specific guild

#

ie, sending a bug report to me ๐Ÿ˜›

earnest phoenix
#

hm

#

alright

#

also

#

is there a way i can check a user's custom status

#

like you know the text and the emoji we use in the status

neat ingot
#

yes but you would need a presence intent after your bot reaches 100 guilds iirc

earnest phoenix
#

yesyes i know that

neat ingot
#

if you want to have access to status data like online and custom status

earnest phoenix
#

Uh no

neat ingot
#

no? you cant get custom status data?

earnest phoenix
#

You can use it until you reach 100 then you gotta verify

neat ingot
#

oohh ok lol

#

yea thats fair

earnest phoenix
#

BUT

#

how do i check a users custom status

#

like get the emoji and the text

#

Also I'm not entirely sure if your custom status is part of the returned data from a presence

#

Last I checked you can't

#

oh god

neat ingot
#

user.presence data

earnest phoenix
#

i think ill just go back to python then ๐Ÿ˜ช

#

That's just your presence not necessarily your custom status

neat ingot
#

that should have your status within it though

#

according to docs

earnest phoenix
#

lemme try that

neat ingot
#

assuming you have the intent/less than 100 guilds

#

so like, user.presence.status should have some data

earnest phoenix
#

That's just your dnd, idle or online stuff

neat ingot
#

omg thats online status loool

earnest phoenix
#

There is no way to check it as far as I can tell

neat ingot
#

what about activities

earnest phoenix
#

Unless discordjs treats it as an activity maybe

neat ingot
#

like, i remeber writing a bot that tracked all this junk

#

so its for sure possible

earnest phoenix
#

Maybe

#

I noticed it says customEmoji

#

Which you can set an emote for you custom activity

earnest phoenix
#

It might be what you need I've never tested it tho so no guarantees

#

how do i convert the

#

message.author.presence to a json thing

#

Wdym

#

so i can read it

#

like if we use message.author.presence.status it returns idle in my case since im the user who invoked the command right

#

Yes

#

so obv the message.author.presence must have something stored in it

#

like a json

#

thing

#

Presence returns the presence data

#

so in order to read that thing we need to convert it to either a string or a json data

#

how would i do that

#

If you logged it you'll see what it looks like or just read the docs

#

oh alright

neat ingot
#

JSON.stringify(object)

#

ie, you can do: channel.send(JSON.stringify(message.author.presence))

#

but might just be easier to log to console lol

earnest phoenix
#

GUYS

#

I FOUND IT

earnest phoenix
#

DO U GUYS HAVE THE EVAL THING IN UR BOTS

earnest phoenix
#

well go get the eval command in ur bots then

#

its usefull

#

tbh

#

for debugging and stuff

neat ingot
#

my v12 bot has an eval command, but i havent written one since i started rewriting my bot ๐Ÿ˜›

earnest phoenix
#

this is how u do it

#

@earnest phoenix this might interest u

neat ingot
#

i've just being doing specific admin commands for things i want to test. no need to be able to eval on the fly during production imo

#

~ if your having to eval the same things often, it should have a command (imo)

earnest phoenix
#

this deserves a pin ๐Ÿ˜•

neat ingot
#

tbf, eval is good for quickly testing random lines ๐Ÿ˜›

earnest phoenix
#

yes

earnest phoenix
neat ingot
#

im in love with that color scheme atm!

#

(its red and green, and fades from one to the other and goes through that funky brown state)

#

so nice to watch ๐Ÿ˜„

earnest phoenix
neat ingot
#

armful, why not armless? ๐Ÿ˜›

earnest phoenix
#

*^^

earnest phoenix
#

๐Ÿ’€

#

why would i need it

#

not u

#

but

#

others who want to implement this to their bots

#

and also a google search can help me

#

might need it

earnest phoenix
#

or d.js docs

#

lmk if u find it on google

#

oh yes

#

go on docs too

#

lmk if u find it there

#

and the usage too tho cause that is what is main

neat ingot
#

programmer arguments/debates are the best to watch imo ๐Ÿ˜„

earnest phoenix
#

LMFAOO

#

FR

earnest phoenix
#

they're entertaining

#

there you go

earnest phoenix
#

im talking abt cusomt status

#

that gives u the

#

idle

#

online

#

invisible

#

thing

#

and well u prolly saw my image idk how u cant remember what u saw

#

<GuildMember>.presence.status

#

easy as that

earnest phoenix
#

ur free to try it

#

it will return

#

online

#

if the user is online

#

idle if user is idle

#

invisible if the user is offline

#

grow up rei

neat ingot
#

the fun thing is we all just been over this 30 mins ago lol

earnest phoenix
#

dont be a kid

#

๐Ÿ˜

earnest phoenix
earnest phoenix
#

and thats it???

#

๐Ÿ’€

#

wdym

#

the text thing

#

and the emoji

#

yea d.js doesnt give you that

#

in ur case its https://reis.ml/

earnest phoenix
#

bruh

#

u sure abt that

#

it does

#

i just figured it out

#

๐Ÿ’€

#

you first said status and now that

#

you are confusing

earnest phoenix
#

custom

#

i didnt spell it right

#

but

#

u can still see it

#

cmon rei accept it u lost

neat ingot
#

cant we all just get along โค๏ธ

earnest phoenix
earnest phoenix
#

dek

#

i like u bro

#

ur nice

#

isnโ€™t it .user.presence.activities[0].state

#

yep but u saw the image i sent so doesnt count

#

i didnโ€™t

earnest phoenix
#

i thought you did some sketchy stuff at first

#

who knows

earnest phoenix
neat ingot
earnest phoenix
#

i figured you were using a user account to fetch the information

#

i was just curious lmao

earnest phoenix
#

๐Ÿ’€

#

wtv bro lets leave it here

#

ima go do mine

#

please lol, no need to be rude

earnest phoenix
#

anyways

neat ingot
#

isnt everyone online a guy by default?

pale vessel
#

I know nom isn't

#

Unless...

earnest phoenix
#

๐Ÿ‘€

neat ingot
#

question: anyone here display a highscore type list of users on their website?

#

if so: how do you display the information / what default discord user info do you display?

earnest phoenix
#

@neat ingot i donโ€™t do 100% public lists-though weโ€™re working on a level leaderboard on a per server basis for my bot

#

i want to reward our users for being active, but the leaderboards will be per server for privacy reasons

neat ingot
#

yea, i get that, its a fair reason tbh

#

i did consider having a per server listing, as well as a global listing

#

but i obviously dont want to expose much data on the global list

earnest phoenix
#

Global leaderboards are fine imo if it's just their username

neat ingot
#

i was thinking of just user.tag and avatar

earnest phoenix
#

keep in mind you will have to either make the global leaderboard opt-in or make this clear in your privacy policy

neat ingot
#

indeed

earnest phoenix
#

if you are looking to display identifiable information at least

#

I'm not sure why youd make it optin at least if all you're doing is using their username

#

Usernames aren't exactly private

neat ingot
#

i intend to inform the user of my policy etc when they use their first command

#

and i have a command to remove your account entirely from my db

earnest phoenix
neat ingot
#

literally the only data i store is discord id, username, and avatar

earnest phoenix
#

Just don't use the discriminator

neat ingot
#

the rest is custom junk from my bot

earnest phoenix
#

though as i said, if itโ€™s in your privacy policy youโ€™re good

neat ingot
#

i would use the discrim

#

like, user.tag has both username and discriminator

earnest phoenix
#

yup

#

I don't see it being an issue as long as you don't show a discriminator but either way like armful said still putting it clear in your privacy policy is a nice idea

#

maybe try make your numbers .toLocaleString()

neat ingot
#

i dont see displaying the discrim as a big deal. users can change those easily enough

earnest phoenix
#

With the discrim you can directly add and then harass them

earnest phoenix
neat ingot
#

my numbers will be split with , when i fix the display ๐Ÿ˜›

earnest phoenix
#

Without you just know someone named Bob is number 1

#

iโ€™m working on rewriting our privacy policy atm to be more clear and transparent

neat ingot
#

yea i guess this is true

earnest phoenix
#

Can't do much with a username unless you wanna make a script that goes through all the 4digit discriminator combinations for that username

neat ingot
#

i mean, thats not that many...

earnest phoenix
#

You don't store a discriminator

#

At least I see no reason to

#

You already have their ID

#

Which you can use to get their user data anyway

#

iโ€™m saying if someone is using their username across several platforms and such as their email it can be used for targeted advertisements

#

As long as they still share a server with the bot at least

earnest phoenix
#

what iโ€™m saying has no relation to discord

neat ingot
#

assuming i was selling my user records to some ad company? ๐Ÿ˜›

earnest phoenix
#

I was under the assumption we were talking about a leaderboard

earnest phoenix
earnest phoenix
neat ingot
#

you guys make a fair point, ill have to have a think about if i include the discriminator or not

#

but i will at least be showing usernames and avatars ๐Ÿ˜›

earnest phoenix
#

yeah iโ€™m just being the devilโ€™s advocate here

neat ingot
#

and yea its a limited leaderboard list, not an entire list of all my players

#

limited to 100

#

has 2 atm ๐Ÿ˜„

earnest phoenix
#

hereโ€™s my advice

#

if you want to use discrims

#

make it opt out and include it in your privacy policy

#

and youโ€™ll be good

#

Or don't use em at all since it's useless info anyway

#

^

neat ingot
#

if its useless info, then what harm is there to show it ๐Ÿ˜‰

earnest phoenix
#

It's useless to most people

#

Useful to the creeps

neat ingot
#

ha yea thats fair

earnest phoenix
neat ingot
#

anyone randomly have the default discord avatar url?

neat ingot
#

im downloading their media kit from discord atm ๐Ÿ˜›

#

dang, that will do, ty โค๏ธ

earnest phoenix
#

https://discord.com/assets/1f0bfc0865d324c2587920a7d80c609b.png

#

no problem

neat ingot
#

huh? you cant have features in beta? what? lol

earnest phoenix
#

Who told ya this

#

I mean, if it's behind gated experimentation meaning only select people get to test it then it is obvious it's not allowed

#

Tbh just comply with discord it's a losing battle

#

Mmmm

#

You could try submitting again or make a ticket or smth

#

if your bot doesn't actually feature anything that is gated behind experiments i'd suggest reaching out in your original ticket and clarifying this with them

#

the more you provide them with the better

#

attach screenshots where applicable etc

#

they tried saying my bot's growth was inorganic at first, though after i explained our partnership with Medal.tv they realized their mistake and verified my bot regardless

#

ยฏ_(ใƒ„)_/ยฏ

#

good luck resolving it

neat ingot
#

pretty happy with how that looks. but if i decide to remove the discriminator, ill have to redesign everything lol

#

its basically storing the latest player card attachment url that the bot sends and showing that ๐Ÿ˜„

earnest phoenix
#

Imagine using $ and not ยฃ

neat ingot
#

i cant help the fact there is a bigger market in $ ๐Ÿ˜„

#

my bot only accepts payment in $ also lol

earnest phoenix
#

So no pounds eh

#

Very monesit

neat ingot
#

i mean, paypal converts it for ya anyway ๐Ÿ˜„

#

i need to make my crappy little player card look better

#

not at all happy with the design ๐Ÿ˜ฆ

earnest phoenix
# neat ingot

maybe try .toLocaleString() on the top right cash value

#

other than that it looks cool

neat ingot
#

yea, idk why its not delimiting the digits properly, it should be, looking into that now

#

i guess .toLocaleString() is a quick fix lol

#

the little (i) is a tiny bit off and its driving me nuts lol

#

monospace font ftw โค๏ธ

sly sierra
#

thats monospace?

#

how

earnest phoenix
#

haha

neat ingot
#

lmao yea its not monospace, just smaller ๐Ÿ˜›

earnest phoenix
#

discord.js v13
Problem: Trying to defer a slash command without reply
For Example in button it is possible to use .deferUpdate();
are there any workaround for slash commands.

earnest phoenix
#

you can also edit it with message content, though i chose to use an embed in the example above ^

#

hopefully this helps

neat ingot
#
const wait = require('util').promisify(setTimeout);

client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    if (interaction.commandName === 'ping') {
        await interaction.deferReply();
        await wait(4000);
        await interaction.editReply('Pong!');
    }
});
pale vessel
#

By the way you can just import setTimeout from timers/promise and await that instead

earnest phoenix
tired geyser
#

EN ั‚ะตะบัั‚

valid sierra
#

Hey, what should I put in the webhook url in the server page so I can send requests to my bot whenever someone votes for the server ?

sudden geyser
#

You should put a URL to a server you operate.

valid sierra
sudden geyser
#

When a user votes for your bot, top.gg will send an HTTP request to that URL with the user info.

#

There are examples on the documentation.

valid sierra
#

client.topgg_webhook = topgg.WebhookManager(client).dbl_webhook("/dblwebhook", "password")

#

it's for a server

#

i did this but not sure what to put in the webhook url in the website

coral palm
#
/root/ARCHERSBOT/node_modules/discord.js/src/rest/RequestHandler.js:349
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Invalid Form Body
parent_id: Maximum number of channels in category reached (50)
    at RequestHandler.execute (/root/ARCHERSBOT/node_modules/discord.js/src/rest                                                                                                                                                             /RequestHandler.js:349:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/root/ARCHERSBOT/node_modules/discord.js/src/r                                                                                                                                                             est/RequestHandler.js:50:14)
    at async GuildChannelManager.create (/root/ARCHERSBOT/node_modules/discord.j                                                                                                                                                             s/src/managers/GuildChannelManager.js:141:18) {
  method: 'post',
  path: '/guilds/457267927536631819/channels',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      name: 'ZOXMS',
      topic: undefined,
      type: 0,
      nsfw: undefined,
      bitrate: undefined,
      user_limit: undefined,
      parent_id: '732368761130188820',
      position: undefined,
      permission_overwrites: [
        { id: '457267927536631819', type: 0, allow: '0', deny: '1024' },
        {
          id: '399263715385540618',
          type: 1,
          allow: '101376',
          deny: '0'
        }
      ],
      rate_limit_per_user: undefined,
      rtc_region: undefined
    },
    files: []
  }
}

Someone can help me with this error here. it happens when i execute any command with database when the bot is hosted in my dedicated server

near stratus
#

This error has nothing to do with your hosting / code

earnest phoenix
valid sierra
#

Hey guys, so i am trying to make a voting reward system with my custom bot
so whenever someone votes for the Server the bot will send a message and give them the currency we have. I have actually received help regarding this system before but my old account was hacked and lost the notes i kept about it TwT, here is what i remember

client = commands.Bot(command_prefix=prefix, intents=intents)
client.topgg_webhook = topgg.WebhookManager(client).dbl_webhook("/dblwebhook", "password")
client.loop.run_until_complete(client.topgg_webhook.run(PORT))
@client.event
async def on_dbl_vote(data):
    if data["type"] == "test":
        print("reveived a test vote")

    else:
        await client.wait_until_ready()
        memberID = data["user"]
        guildID = data["guild"]
        guild = client.get_guild(int(guildID))
        member = guild.get_member(int(memberID))
        print(f"{member.name} has voted")
       


@client.event
async def on_dbl_test(data):
    """An event that is called whenever someone tests the webhook system for your bot on top.gg."""
    print("Received a test upvote:", "\n", data, sep="")```, the thing is, i don't remember what should i put in the `Webhook URL` inside the webhook page of the server
warped lintel
#

Hello good, I need you to delete my old bot from top.gg to add another application, can someone from the staff delete it for me?

spark flint
#

The delete button on your bot page

warped lintel
#

Thanks

warped lintel
#

hello good I need help with a command from my bot could someone help me?

sudden geyser
#

It's better you state what exactly you need help with.

#

So anyone who may know the answer can answer.

warped lintel
#

In a command of my bot I have to indicate the users of the black list with this function $ {blacklist.length} and I put sh! botinfo and it appears undefined I do not know why it puts that to me exactly

sudden geyser
#

You may want to check the type of blacklist

#

A blacklist will usually contain a collection of user IDs.

warped lintel
#

the users I store them in megadb

sudden geyser
#

So if my blacklist looked like this

let blacklist = ["825789766859358249", "140862798832861184"];

Then I could use it like so:

let s = `Number of blacklisted users: ${blacklist.length}`;
let sl = `Blacklisted user IDs: ${blacklist.join(", ")}`;
#

Yet I don't know how you're using it exactly.

#

Of course, you say you're using megadb, and I've never used or heard of that.

#

Assuming you query the database and get the IDs, it's roughly the same process.

warped lintel
#

Thank you

earnest phoenix
#
const { Client, Intents, Collection } = require('discord.js');
const client = new Client({
    partials: ['MESSAGE', 'CHANNEL', 'REACTION' ],
    allowedMentions: { parse: ["users", "roles"] },
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES,
        Intents.FLAGS.GUILD_MEMBERS,
        Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
        Intents.FLAGS.GUILD_WEBHOOKS,
        Intents.FLAGS.GUILD_INVITES,
        Intents.FLAGS.GUILD_PRESENCES,
    ],
})```
#

All of the intents are enabled on hte bot too

oak cliff
#

One of them isn't valid

earnest phoenix
#

Which one?

#

ohh

#

It's cause I kept defining client in each command file.

#

That's why.

oak cliff
#

Or that lmao

earnest phoenix
#

Is there a way to generate a random number from 1-1000 as rn I am just putting 1-1000 in a array and yeah I have to have a lot of patience atm ๐Ÿคฃ

slender thistle
#

in JS?

#
earnest phoenix
#

mhm

#

djs

#

I tried that, didn't work but ig I will try it again

sudden geyser
#

What you're looking for is something like this:

// Returns a random integer from 1 to 10:
Math.floor(Math.random() * 10) + 1;

Notice how the 10 and 1 control the range.

neat ingot
#

I added a live market feed for my silly drug trading bot that ive been making. Tell me that color scheme isnt amazingly suitable! i dare you! ๐Ÿ˜„

spark flint
#

its something

neat ingot
#

lol

#

i wasnt keen on it at first tbh

#

but the more i look at it, the more i really like it ๐Ÿ˜„

#

its the red and green from the avatar icon, but they fade and mix into one another

#

looks really neat ๐Ÿ˜„

earnest phoenix
#
            if(!db.get(`yasaklฤฑKanal_${i.guild.id}`))
            {
                console.log("hello")
                db.set(`yasaklฤฑKanal_${i.guild.id}`, [] )
            }

            db.push(`yasaklฤฑKanal_${i.guild.id}`, { Kanal: ch.id } );
            db.push(`yasaklฤฑKanal_${i.guild.id}`, { Kanal: ch.id } );



db.get(`yasaklฤฑKanal_${i.guild.id}.Kanal`);
is undefined
neat ingot
#

hmm, gif looks trash, but w.e, it shows the animation lol

#

looks way better if you open out ofdiscord for some reason 0o

quartz kindle
#

damn meth is so expensive

#

thats why i prefer math

#

:^)

neat ingot
#

yea meth is the drug of the rich ๐Ÿ˜„

#

tbh, i think math fks me up more than meth would ๐Ÿ˜„

#

crap usually has me scratching my head, debating my entire reality ๐Ÿ˜›

#

~ math that is, idk about meth ofc

quartz kindle
#

xD

misty sigil
#

does anyone here know if ovh allows port 25 ๐Ÿค”

quartz kindle
#

why wouldnt it?

misty sigil
#

fair

earnest phoenix
#

Why does this still show Unknown#0000 all the time even tho there is a filter?

let money = db.all().filter(data => data.ID.startsWith(`money_`)).sort((a, b) => b.data - a.data);
        if (!money.length) {
            let noEmbed = new Discord.MessageEmbed()
                .setAuthor(message.member.displayName, message.author.displayAvatarURL())
                .setColor("WHITE")
                .setFooter("[![error](https://cdn.discordapp.com/emojis/922164411718848625.webp?size=128 "error")] Nothing To See Here Yet!")
            return message.channel.send({embeds: [noEmbed]})
        };

        money.length = 10;
        var finalLb = "";
        for (var i in money) {
            if (money[i].data === null) money[i].data = 0
            finalLb += `#**${money.indexOf(money[i]) + 1}. ${client.users.cache.get(money[i].ID.split('_')[1]) ? client.users.cache.get(money[i].ID.split('_')[1]).tag : "Unknown#0000"}** [๐Ÿ’ฒ] ${money[i].data} Coins \n`;
        }; ```
quartz kindle
#

first of all console.log(money[i].ID.split('_')[1]) to check if that actually gives you a valid id

#

second of all, the users might not be cached, in which case you have to fetch them

earnest phoenix
earnest phoenix
#

๐Ÿ‘

wooden ember
#

anyone else getting this error when trying to bat a bot to play a yt video to a vc?

#

the bot joins and sits there untill this error pops up and then it leaves

#

i have updated ytdl and it made no diference

#

this worked fine in d.js v12 but now after updating it to v13 and rewriting the code it wont play anything

#

this is where the error is comming from

#

anyone else had this issue or am i just dumb

tired geyser
#

EN ั‚ะตะบัั‚

rustic nova
#

-m @tired geyser

gilded plankBOT
#

upvote zxc.sflove#4014 was successfully muted

earnest phoenix
#

So with this client.on('guildMemberAdd', async member => { let blacklistedusers = db.get(`blacklisted_${member.id}`)How would I actually see if the user is blacklisted? Like do I put if(member === blacklistedusers ...) not sure where I would put TRUE at.

#
  if(blacklsitedusers === member || true)
``` this was my thought ๐Ÿคฃ but it's starting to make no sense.
#

if(blacklsitedusers.includes(member.id) === true)

#

Maybe that o-o

sudden geyser
#

Ye

#

Assuming blacklistedusers contains an array of user IDs

#

though how you have it setup is confusing

earnest phoenix
#

lol trust me ik ๐Ÿคฃ

sudden geyser
#

If blacklisted_<member-id> existed, that would indicate if the user is blacklisted alone.

#

But having a general entry like blacklisted return an array of users would suit the array of user IDs part

quartz kindle
#

what did you save blacklisted_memberID as?

#

like show your blacklist command, or show where you use db.set to store the blacklist id

earnest phoenix
quartz kindle
#

then you only need if(blacklisteduser)

earnest phoenix
#

so if(blacklisteduser === member) {...}?

quartz kindle
#

no

earnest phoenix
#

oh

#

Alr

#

It's that easy then

quartz kindle
#

since db.get(blacklisted_memberid) already gets you the true if you stored it and undefined if you didnt, or false if you did store false

#

doing if(blacklistedusers) already does the job, because it translates to if(true) or if(false/undefined)

earnest phoenix
#

Ah sounds good.

sharp saddle
#

what is wrong?

import * as express from 'express'
const app = express();
const router = express.Router();

app.get("/", function(req,res) {
  res.send("a")
})

app.listen(3000);```
quartz kindle
#

idk you tell me

pale vessel
#

Cool router

coral sigil
#

that router be doing the heavy lifting of routing

wooden ember
#

does any one know if there is any documentation (that actually works) on how to make ytdl play music to a vc using a discord bot? cuz everything i have tryed does not work

round cove
#

I have seen plenty of videos and tutorials of that online lol.

wooden ember
#

there is a possibility that its because its timing out since my internet is junk so is there a way to make the timeout longer?

wooden ember
#

and i really dont want to use distube

#

looked for examples to copy studdy so that i can update my home made player from v12 but they all just come up with the same error of:

earnest phoenix
#

How can I get the server Owner's ID?

wooden ember
#

i know thats what im doing

#

i already had a simple player for v12

#

and i updated it

#

the bot joins the voice chat and stays there untill something times out and then it leaves

#

the fact that it joins and leaves fine indicates to me that its not a fault with the discord.js side of things

#

mmm

#

all up to date

#

i just upgraded my server

spark flint
wooden ember
#

new hdd os everything so all packages are installed and uptodate (hence moving from v12

earnest phoenix
wooden ember
#

bruh

spark flint
#

ig

#

thats from the member object

earnest phoenix
wooden ember
#

that method was depreciated cuz it was inaccurate

earnest phoenix
#

its like guild.ownerId

#

in the docs.

#

but that doesn't work.

#

it says its not a function

round cove
#

It says owner is undefined lol

#

So clearly owner doesn't exist on guild anymore.

#

Also you can do message.guild instead of message.member.guild

earnest phoenix
#

Well ik, was just using what was given ๐Ÿคฃ

#

So I can't get the Owner's ID at all?

round cove
#

I believe in your ability to use 3 braincells.

#

ownerId should work.

#

It's not a function it's just a property.

earnest phoenix
round cove
#

I literally just said it's not a function.

earnest phoenix
#

ahh

#

wait what?

#

confusion

round cove
#

remove the ()

wooden ember
#

remove the () at the end

round cove
#

๐Ÿ™‚

earnest phoenix
#

I was thinking that dangit

#

I thought I'd be wrong ๐Ÿคฃ

pale vessel
#

Documentation poggythumbsup

round cove
#

ALSO, when the ERROR says is not a function what should you do?

wooden ember
#

i still coulda swarn that they removed the ability to find the owner of a guild cuz i remember it from the docs

pale vessel
#

Yeah, it's now guild.fetchOwner()

wooden ember
#

but maybe they just changed the way it works or somthing

#

ah yeah

wooden ember
#

also

#

anyone know why the bot says im not in the vc

#

unless i restart it whilst im still in it?

lyric mountain
#

Do u have guild_presences intent?

wooden ember
#

probably not

#

i didnt

real phoenix
#

so how do I set up a bot on repl.it?

#

I've written the code but now I'm getting this error

wooden ember
#

welcome to the club

real phoenix
#

SyntaxError: Unexpected token 'const'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Sonic-Symphony@1.0.0 start: node .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Sonic-Symphony@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-20T01_08_30_597Z-debug.log
exit status 1

#
npm const dotenv = require('dotenv');npm 

I remove const and i get an error.
I remove npm and I get an error
I remove dotenv and I get an error

wooden ember
#

bruh

spark flint
#

lol

wooden ember
#

why did you put npm there

spark flint
#

this is just pain reading

#

remove npm from both ends

real phoenix
#

I'm sorry I'm new to this

#

ok

wooden ember
#

bruh why have you just writen npm everywhere

#

npm isnt anything to do with the js code

real phoenix
#

someone told me to do that

wooden ember
#

bruh

#

just try js const dotenv = require('dotenv');

real phoenix
#

anyways I removed it and now I'm getting a ton of errors

spark flint
#

what errors

real phoenix
#

A bunch of logging in Green and then this

#

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Sonic-Symphony@1.0.0 start: node .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Sonic-Symphony@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-20T01_10_59_989Z-debug.log
exit status 1

spark flint
boreal iron
#

Might be worth to learn how to use the coding language you wanna use before using raping it

wooden ember
#

i mean i learnt js just by doing random discord bot things but damn its a rocky road

real phoenix
#

ik an ok amount of node but I'm using it on repl.it which has been not very fun

wooden ember
#

yeah repl isnt that fun

real phoenix
#

I had to go through a whole seperate process to get discord.js to run

boreal iron
#

I wonder how that platform can cause issues with code you wrote or more likely you didnโ€™t write

real phoenix
#

"wrote"

wooden ember
#

what do you mean "get discord.js to run"

real phoenix
#

it requires node 16 while repl by defualt runs on node 14

wooden ember
#

ah yeah ok

#

so im gonna say it but if you did coppy code it will most likely be for discord.js v12 and discord.js v13 is what you are running

#

and thats probably where alot of errors are comming from

real phoenix
#

Well I followed a tutorial so its probably why

spark flint
#

yeah thats why

wooden ember
#

i would suggest looking at the d.js v13 docs and ripping the code off that first

boreal iron
#

Thereโ€™s a project you can copy on the platform to use node v16

wooden ember
#

well not just rip the code off but you know what i mean

real phoenix
#

ok

coral palm
#

Does anyone have any system for checking the time of users' calls? I would like to study a little about this to make a command of my own but I can't find any on the net

wooden ember
#

inorder to do that you would need to have a database and all that

#

there are ways of doing it but its hard (but then databases scare me)

boreal iron
#

Database are scary, wut?
God bless their existence

wooden ember
#

also befor i go to sleep any one know how to play music on a bot cuz i have found so far 7 different ways of doing it both from the docs github and the likes and none of them work

wooden ember
real phoenix
#
const dotenv = require('dotenv')
const pathย = require('path');
const { Client }ย = require('discord.js');
const { SlashCreator, GatewayServer } = require('slash-create');
const { Player } = require('discord-player');
const { registerPlayerEvents }ย = require('./events');
const { generateDocs } = require('./docs');

dotenv.config();

const client = new Client({
    intents: [
        'GUILDS',
        'GUILD_VOICE_STATES'
    ]
});

client.player = new Player(client);
registerPlayerEvents(client.player);

const creator = new SlashCreator({
  applicationID: process.env.DISCORD_CLIENT_ID,
  token: process.env.DISCORD_CLIENT_TOKEN,
});

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);

    console.log('Generating docs...');
    generateDocs(creator.commands);
});

creator
    .withServer(
        new GatewayServer(
            (handler) => client.ws.on('INTERACTION_CREATE', handler)
        )
    )
    .registerCommandsIn(path.join(__dirname, 'commands'));

if (process.env.DISCORD_GUILD_ID) creator.syncCommandsIn(process.env.DISCORD_GUILD_ID);
else creator.syncCommands();

client.login(process.env.DISCORD_CLIENT_TOKEN);

module.exports.client = client;
module.exports.creator = creator;

Is everything in this ok?

wooden ember
#

damn your going for slash commands? very brave of you

spark flint
wooden ember
#

idk how they work or how to get them working tbh

#

they are a reletively new thing

real phoenix
wooden ember
#

bruh

real phoenix
boreal iron
spark flint
#

i still do

#

pycord is identical and a maintained fork of d.py

real phoenix
#

ooh

#

I like

wooden ember
#

lol

wooden ember
real phoenix
#

Only thing is idk how to do music commands on that but I will learn

wooden ember
#

good luck with music too lol

#

cuz i cant get crap to work over here

wooden ember
#

everything worked fine on d.js v12 and then v13 came out and everything went tits up

solemn latch
#

99% of music bot examples are written for v12

spark flint
#

you can see my ugly code for @gaunt kelp on github

#

it has music commands

real phoenix
#

send

wooden ember
#

i cant even get an mp3 to play

spark flint
#

its really simple

#

but it works

real phoenix
#

ok

spark flint
#

just about

real phoenix
#

ty

#

YouTube support or no?

spark flint
#

you would need to add that

solemn latch
#

imo, if you depend on examples to make a music bot you shouldn't make one.
its a complex subject, and odds are once you get a single error youll be stuck and cant fix it.

real phoenix
solemn latch
#

also once you start making more complex/large music bots you will start to have all new issues.

spark flint
#

look at the ytdl shit and then from there make it play from that stream

real phoenix
#

ayyy I don't need to install ffmegg

spark flint
#

you do

#

sadly

solemn latch
#

(just a side note, what is your code @wooden ember )

spark flint
#

i'm looking at a kimsufi dedicated server (OVH), anyone used them before?

#

$7.99 dedicated server pog

real phoenix
#

f

wooden ember
solemn latch
#

cheapest I see is $21

spark flint
#

oh

wooden ember
spark flint
boreal iron
solemn latch
#

in fact an rpi seems to be 4x faster than that entire dedi

spark flint
#

lol

wooden ember
#

bruh i just host my crap on a free dell optiplex i got

spark flint
#

i just need something with high ssd storage

solemn latch
#

I would never home host anymore

wooden ember
#

has a dual core athlon from 2006

spark flint
#

like ideally 75gb+ ssd storage

#

and under $5 a month

wooden ember
#

and costs my 3 quid a year to keep up

wheat mesa
#

rpi is unreliable though

boreal iron
#

Rent a cheap cloud server then

wheat mesa
#

Since it depends on your ISP, Power, etc

spark flint
#

atm i'm using a 512gb hdd vps for ยฃ3.50 a month

wooden ember
#

but this year not so good

solemn latch
#

might be cheaper to use bucket storage, rather than a vps for storage

wooden ember
#

i just like self hosting stuff

spark flint
#

well what i have is an express.js server on it which gets the file from a post requests, saves to a static folder and then uploads the relevant details to a database

wooden ember
#

even though its a pain in the ass some times

spark flint
#

then you can then access the file quickly

#

works for me

#

and upload is way quicker than using a different service like cloudflare images etc

wooden ember
#

just upload the file to discord and use that as storage

spark flint
#

but

#

thats cringe

#

and defeats the purpose of what i'm doing lol

wooden ember
#

i mean it works unless what you are storing is more than 8mb

#

but eh is a joke

boreal iron
solemn latch
#

well the lightning strike for one

wooden ember
#

i expect their internet is crap or somthing or they just dont like hardware

#

or that lol

#

but then thats an act of god

solemn latch
#

plus cheaper to get remote backups while hosting third party

wooden ember
#

i mean true the only thing i would use a vps for is backups

solemn latch
#

plus, I already pay for backup services to limit downtime

wooden ember
#

but then you can just use cloud storage and use a home server to upload it so you dont even need a vps for that

#

just google drive or somthing

real phoenix
#

@spark flint
whats this stuff for?

dbuser = "db username"
dbpass = "db password"
dbname = "db name"
dbhost = "db host"
solemn latch
#

plus plus, generally speaking cheaper in the long run(excluding using old hardware, but then reliability issues)

spark flint
#

not relevant to music

real phoenix
#

ok

#

But what does it do?

spark flint
#

It stores the snowball and snowflake count in the database

real phoenix
#

ooh

spark flint
#

and connects using those details

real phoenix
#

its a database

spark flint
#

yeah

real phoenix
#

makes sense

wooden ember
solemn latch
#

๐Ÿ‘€

wooden ember
#

tha things got a pentium 3

#

and still has the og hdd from 2001 too

real phoenix
wooden ember
#

lol

boreal iron
#

Good HDDs, depending on the IO, last like forever

solemn latch
#

tbh, I dont doubt it. but, lets say that hardware fails. how quickly can you get new hardware in and running?

Currently, if my vps fails completely it can be restored within 10 minutes, if it happens at night maybe a few hours because I cannot directly request it.
The actual node will be repaired within the day, every time.

round cove
#

I just have my stuff on a plus lol

#

Psu*

boreal iron
solemn latch
#

do you have a backup cpu? ram? motherboard? psu?
are you around to fix it if need be 24/7? ๐Ÿ‘€

boreal iron
#

But you better donโ€™t go for comparing consumer hardware with actual server hardware

wooden ember
#

here we go

#

thats the voip server

wooden ember
#

had to replace one of the card on the pci cards

quartz kindle
boreal iron
#

But a CPU or MB doesnโ€™t actually die without any external impact

wooden ember
#

i mean they can the caps can go for one

solemn latch
#

you're very much an exception then, 99% of home hosters very likely wont be able to bring their hardware back up after a failure, without significant downtime.

boreal iron
quartz kindle
solemn latch
#

(including myself)

wooden ember
boreal iron
wooden ember
#

lol

round cove
#

Friend of mine spent around doing 15 grand on building a big home server to host his and his parents stuff

solemn latch
#

and then it goes back to cost.
its not cheap to have 2x of everything for backup hardware.

wooden ember
#

i mean my server costs 3 quid a year to run

#

and that runs mc and some discord bots

#

and a vps with the same power would cost 5 quid a month

boreal iron
wooden ember
#

the pc its self could be bought of ebay for 10-15 quid so in 3 months you would have payed it off already

wooden ember
round cove
#

Idk how you're spending 3 grand a year to run a home server

#

Power alone mine cost nothing

wooden ember
#

whos spending 3 grand?

solemn latch
#

๐Ÿ‘€ quid = grand now

round cove
#

You said

#

Oh

#

Lmfao

#

I misread my bad

wooden ember
#

lol

boreal iron
#

Thing is professional hosting at home is nonsense
Regarding infrastructure, bandwidth and redundancy as well as reliability hosting providers are always the right choice

wooden ember
#

if you want relyability get a vps
if you want to save money self host it

solemn latch
#

pretty much that simple yeah

round cove
#

Yeah basic hosting sites cost too much for the little they give you

quartz kindle
#

honestly most times a vps will be cheaper than self hosting

round cove
#

So I canceled them and made my own

solemn latch
#

dylan has a hosting service? ๐Ÿ‘€

#

pls send

round cove
#

Lmao

wooden ember
#

5 quid a month just to host a discord bot thats mad

solemn latch
#

actually really cheap imo, unless its for personal use.

wooden ember
#

yeah thats what i mean

solemn latch
#

public hosting anything for 5 quid is super cheap imo

boreal iron
wooden ember
#

yeah if its public sure but is that bot really gonna run on a 5 quid vps?

solemn latch
#

absolutely.

#

especially using tims methods CB_kek

spark flint
wooden ember
quartz kindle
#

unless you're running something stupid cheap and have stupid cheap internet, a vps will always be cheaper

wooden ember
#

i mean i already have internet to use for other things and it costs 3 quid to run my server 24/7

#

and you have to have internet to even use a vps anyway

quartz kindle
#

have you done the math on the energy costs?

wooden ember
#

infact yes i forgot 3 quid is to run my old raspberry pi I forgot it costs about 5 quid for my main server

spark flint
#

how tf can i align two forms next to each other

boreal iron
wooden ember
#

i did calculate it a while ago

quartz kindle
#

so it ends up being pretty much the same

wooden ember
#

5 quid a year VS 5 quid a month

quartz kindle
wooden ember
#

not realy the same

boreal iron
quartz kindle
wooden ember
#

wait did i?

#

no i said year

#

well i implyed it i guess

#

but I ment year

quartz kindle
#

thats pretty cheap

wooden ember
#

anyway i need to sleep i been talkin about VPS' for over an hour now and its 2am

spark flint
#

lol 2am vibes

quartz kindle
#

but well, its low power stuff like rpi

wooden ember
boreal iron
wooden ember
#

it was made in 2006 lol

spark flint
boreal iron
#

Oh fuck the 20th already?

solemn latch
#

out of curiosity what are the specs?

wooden ember
#

of what?

#

my server

solemn latch
#

your server

#

ye

wooden ember
#

uuh athlon X2 2.22GHZ dual core
4GB ram and a random 80 gig hdd I found

boreal iron
#

Actually my home server will pay off itself in a few month compared to the fact I spent 120 bucks / month a the dedicated one

wooden ember
#

i have just bought one of those sun cache pcie card to use so that will drive the power consumption up a bit

quartz kindle
wooden ember
#

sadly the sun f20 isnt bootable by defalt but I have an hdd in there that runs proxmox and then i set the 4 internal sas ssds to a zfs storage thing

wooden ember
#

and well it did

quartz kindle
#

honestly that makes no sense

wooden ember
#

i mean it is asuming that the pi was at 100% all the time

#

and my server is mostly idle

quartz kindle
#

a full rpi uses 3-5 watts of power, while an athlon x2 cpu alone has a TDP of 45w, a 3.5 inch HDD alone uses ~20 watts, ram uses 3-4 watts per module...

boreal iron
#

Regarding the fact the system probably eats like 100W constantly I wonder if you your electricity is for free then

quartz kindle
#

exactly

boreal iron
#

Oh RaspberryPi ahaโ€ฆ I thought PC

quartz kindle
#

i understand an RPI using 3-5 bucks a year in power, since it consumes 3-5 watts, but that system easily consumes 20x more

solemn latch
#

athlon X2 at 2ghz is like 85w

boreal iron
#

(up to)

wooden ember
#

i cant remember how i did the calculation tbh but i know the pi uses more like 15 w of power

solemn latch
#

at 2.22ghz its going to probably be more than that.

solemn latch
quartz kindle
#

yeah athlon x2 goes from 22w to 95w depending on model

wooden ember
#

its the first athlon dual core i think cuz its really not powerfull

quartz kindle
#

then it should be 45w

wooden ember
#

mm indeed

#

lemmy do some calculating one sec

boreal iron
#

Under normal load ofc

quartz kindle
#

average cpu power tends to be around 2/3 of their tdps

real phoenix
#

Does anyone know why my help command doesn't work?
command

@client.command()
async def help(ctx):
    embed = discord.Embed(title=":snowflake: Sonic Commands :snowflake:", description="Version: v1.0.1")
    embed.add_field(name=">howlong", value="NEW! Shows you how long until Christmas day!")
    embed.add_field(name=">play", value="Play Audio, YouTube support coming very soon!")
    embed.add_field(name=">np", value="See whats playing.")
    await ctx.send(embed=embed)

error:
File "main.py", line 21, in <module>
async def help(ctx):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1263, in decorator
self.add_command(result)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1149, in add_command
raise CommandRegistrationError(command.name)
discord.ext.commands.errors.CommandRegistrationError: The command help is already an existing command or alias.

quartz kindle
#

but yeah it can go much lower under lower loads

boreal iron
#

Anyways whatever you calculate a company like data centers always get a better price for electricity than you can get, means in terms of costs hosting at home only saves you money when we speak about expensive systems you would have to pay lots of cash per money to the provider

quartz kindle
real phoenix
#

what

#

oh

spark flint
#

Lol

real phoenix
#

there

quartz kindle
#

The command help is already an existing command or alias.

real phoenix
#

yes ik

#

But theres only one command

spark flint
#

You need to do what I do in the code

#

client.remove_command(โ€œhelpโ€)

quartz kindle
#

bot.remove_command('help')

#

something like that

real phoenix
#

oh

quartz kindle
#

yes what big bunmas said

real phoenix
#
client.remove_command("help")

This correct?

spark flint
#

Yep

real phoenix
#

ok

#

tysm

quartz kindle
#

everytime someone says "tysm" i think about TSM (the esports team)

wooden ember
#

ok so after some maths
lets asume my server is constantly at 50% usage where the cpu uses 20w and the rest of the server uses another 20w totalling 40 watts

there are 8760 hours in a year

8760x40= 350400

350400Wh to KWh is 350.4

the price of power in the uk atm is 17.2p/KWh (damn it was 10p like 4 years ago)

350.4x17.2 = 6026

and thats a grand total of 60 quid a year

hot damn thats alot of money

quartz kindle
#

that makes more sense yes

#

RPIs have ridiculously low power usage compared to regular servers

#

you can easily expect the difference to be 10-20x or more

wooden ember
#

but still that like exactly the same price as a ยฃ5/M vps so eh

solemn latch
#

just looking at hetzner,
if you get a CX21, thats 2 cores, 4gb of ram on a modern cpu.

boreal iron
solemn latch
#

youll get much much more performance on a vps

boreal iron
#

wat wat?

quartz kindle
#

wat watt

boreal iron
quartz kindle
#

ohm

wooden ember
#

i mean i host 3 bots and an mc server(sometimes) i dont really need performance