#development
1 messages · Page 1111 of 1
hello php developers
Lookin' good Sammy
im going to make deep learning program later on this year
php 🚮
@earnest phoenix are those real? lmao
yeah
Did you already create a mockup design?
his own tweets
to merge anime characters
hahaha
ill try that
tf
welcome to programming
i have it in my bigbrain
yay i was the 3rd star
is anyone even new to programming here
i dont think rn
hard to believe ive been doing this shit for 5 years
facts
but normally every other 10 minutes
you ever get that urge of motivation
and then when you click new file
and then you start working your way through it
you start to feel lazy
same
Try learning 28 programming and web dev languages.
Everything looks the same. Very boring lol.
ik only 5
wow
ok thats cool
Stocks stocks stocks, stocks stocks stocks stocks; stocks stocks stocks. Stocks stocks stocks stocks.
i feel kinda useless compared to these geniuses
i started about a year ago with javascript. but i know what you mean
you can always dive deeper into this
ive been doing this for 4 years
sometimes you have 0 Motivation but start anyways and then get a Idea and want to make it work
NodeJS is a very powerful tool for 2020+
and im still fucking retarded
:stocks:
it is already doing more for me than an apache server could.
especially with desktop apps because of electron
i started to learn c# bcs i was bored and unable to get motivated to write something
NodeJS is twitch and youtube.
im aware
there's no other option for that except wasm which is still in it's early days
they're web apps
It's a memory game if you do not handle the proper coding and store to many vars and values.
however twitch & youtube aren't just node
the frontend is
the backend isn't
same for discord
meanwhile i have plans to edit a npm libary to use redis for caching instead of ram
their frontend is electron while backend is py + rust
it does it anyways ik but you can offload it to a different server
no sane person would use node all throughout their workflow
NodeJS backend with websockets or any other method is faster than anything else out there. Ajax used to be the go to. Realtime became more fluent with NodeJS as a backend web hosting future. Ajax get and post are much slower results.
i will have to disagree with that
Javascript is just key to the future.
no it isn't
you never went into the it infrastructure if larger companies right? they are lazy AF. like they would still use windows 2000 if they could
I enjoy centos 8 lately.
would be pretty dope if larger companies would switch to Linux
a huge part of the market share is windows
or ubuntu
and they'll target that
yea it got a steep learning curve but can help to cut down on fees for maintanance
as a LAMP stacks dev from the old days. I always forced anyone to use a Linux without a desktop as a server. Purely SSH and FTP access only.
like there are companies who pay easy 10k$/month to keep windows XP running
Larger companies use things that arent available on linux by default without wine or similar software
well SFTP*
And they probably also make or have their own software that was developed specifically for windows
not rlly
its still related
bc we understand how others think
and how we can improve
ourselves
im learning alot actually
even though you only learn js a year ago, im learning things from you
and it's pretty beneficial tbh
;p
it got kinda off-topic so
Javascript is just key to the future.
at web development
I wish embed would get more in-tune with a few extra features. I need to do more with it.
I need in-lines to work on a smaller scale when using them in the array.
or ubuntu
ubuntu is linux
I also would like columns added to embed. Aligning text with \t and tab is not working out.
NodeJS is purely javascript and webhook's are mostly required some know how. So kindly remind yourselves this is development. @restive furnace & @slender thistle as any web dev process is required for web hooks related to bots and other things no?
use canvas to generate a image with the stuff you want
if you want columns use inline embed fields
you get 3 max iirc
they'll get squashed into less depending on the screen resolution though
Already confirmed that a few times. The only other alt is using tab right?
which still isn't going to get rendered accordingly depending on the screen resolution, but yes
As nothing does in embed anyways. Any context is smashed up and that's not my issue. In any other case it would be if it was preventable.
The only way to avoid that is to place images in the embed the same size of the text.
best bet would be to generate an image
i used to do it on my old bot
just generate the image with whatever content you'd like and send that, no dealing with discord's inconsistencies
For verification only the leader of the developer team must be over 14 years old? Can other developers have 13 years?
I am making a chart for the stock market which most already do. which will basically be just that. Although I do not want to use a desktop Linux OS. Which brings us back to nodejs and javascript working together frontend and backend web dev on the bot.
Generating a image based off a url qued by the bot without ever visiting the website is most common search results but php handles this easier.
I sadly do not want to use php.
it's the same result ejs is only a html file which relays info back and from with nodejs if handled properly.
To generate a image without visiting the url with a browser. You have to have a desktop installed with chromo or some other snapshot desktop application for linux
or windows.
Use a .ejs file for templating if you wanna send data to the frontend from the back, and use a form to lost data
w.e
bro this is so fucking intellectual rn
i use ejs already. It's my main go to. Generating images is the issue.
Like actually making an image
I would relay some other info about it but it's more or less going off topic. I wanted to just buzz the brains of all ;p
Yeah generating a image based off data.
bro this is so fucking intellectual rn
@ripe wasp XDDDDDD
im trying to keep on
It's big brain time
and pay attention
My head is very 
goddamn it i wish i was smart
you would have to visit the url as stated I want to avoid doing.
Even if you use nodejs canavas you need chromo or a snapshot application installed on a desktop.
@worn zephyr its possible that everyone needs to be in the legal age for this, also its possible that you need a adult to verify
Shit my CPU is at 100% usage because system interrupts
wtf are you doing?
This is just non functional
@worn zephyr its possible that everyone needs to be in the legal age for this, also its possible that you need a adult to verify
@lusty quest it's a question for a friend. Thanks
But at least it's waterproof
my touchpad its permanently stuck in drag mode lmao
I do not think you understand what I've been saying. Maybe you have but you cannot generate a image without a desktop installed on linux. You need chromo extensions mostly. Otherwise you have to visit the url with your browser to pull the image request even if you coded up the bot to try and do it. It;s not a browser based request.
Oh shit
For verification only the leader of the developer team must be over 14 years old? Can other developers have 13 years?
@worn zephyr How tf are you even submitting to verification if the leader is 14 years old or something, don't you guys need an ID
this is browser based.
Stonks
can
@unreal bluff canvas is browser, but node-canvas is not browser based wtf are you talking about
somone rate my bot
I can't argue with ya mate sorry. Gonna have to end this here. It;s not related to anything i've been stating as facts.
@earnest phoenix I used passport
@pure lion i know, you can use id, driver's license and passport
Then stonks
I was talking to that guy
NodeJs needs a desktop to generate anything with the canvas extentions. To generate a image file based off canvas. You need to visit the url or have the proper desktop installed on linux OS.
Let's see what he will say
Yeah but I thought it was a valid point because ID
no you dont?
unless you're talking about nw.js or electron
but node.js doesnt need a browser nor a desktop environment
Prove me wrong then. I would enjoy finding out new info.
Your server has a desktop and chromo.
So you visited the url prior to showing the image?
Canvas can run headless
Show me your generated image queued by your bot please.
@unreal bluff
5Head
NODE CANVAS RUN ON SERVER PC OOGA BOOGA
If i use PHP i can code a nice headless generator. NodeJs requires me to use a desktop so far on centos 8.
Ooga canvas desktop booga
I have attempted work arounds but haven't got it yet.
Woo that's sick
here's a pseudocode: for a discord bot @unreal bluff ```js
const Canvas = require("canvas");
const canvas = Canvas.createCanvas();
const ctx = canvas.getContext("2d");
ctx.fillRect(0,0,200,200);
message.channel.send({files:[{attachment:canvas.toStream(),name:"bla.png"}]})
How can I delete a spefific msg in dms? msg.author.createDM().then(m => m.delete('id')); <- doesnt do anything
oh now you've proven me right. It;s got chromo and a desktop.
Idk why would you
canvas.getContext("2d");
there aint no reason to do so
@unreal bluff ???? what chromo and what desktop?
cant be processed without a desktop on the server.
Lol
but your telling me to do so
@unreal bluff it's not like we told you literally 50 times
it can? what the fuck are you on about
🤦♂️
My vps has no desktop
I have a legit headache
@sinful belfry alright its fully working for me now with 400k members (and much faster than djs), check the latest commit
@quartz kindle wow ok, thanks a lot. it's working great for me too. tysm for this
I think we are being trolled
:))))))))))))))))))))
🤔
Wtf is going on
Pain
anyone know thiscannot read property 'execute' of undefined error when using js client.commands.get('ping').execute(message, args); sometimes
@unreal bluff dude, have you read their documentation? node-canvas is a Cairo-backed Canvas implementation for Node.js.
I will figure out a method to it without installing a desktop extension that requires chromo files to generate a snapshot.
it uses the Cairo library to SIMULATE a canvas environment OUTSIDE of a browser
@inland aurora means the command isn't loaded
Thanks
I'm moyaing so hard rn
snapshots are normally what you lookup when googling these things.
there are no snapshots and no browser involved, i can assure you that, otherwise how is my bot generating complex images in < 10ms
Tim is going full big brain mode
while being fully synchronous
the entire library is a simulation of the browser's canvas
two bosses meet up
please read about the meaning of the word "implementation"
^
The problem with the package you shown. It requires a chromo extension to work.
@unreal bluff shut up and just try it and see
Let's be nice here
Excuse my harshness but tim should be charging you $84
could be the OS centos 6-7-8 that doesn;t work with this properly.
how are you installing it?
sudo apt-get new-brain
I need one of those dice
it requires native libraries such as Pango and Cairo to work, which are native C/C++ libraries, which require build tools to be compiled when installing
well let's keep this channel on topic guys
Mb
for example if you want to install node-canvas on ubuntu, you need these dependencies to build it:
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Any of the canvas packages have suggestions on how to do these packages. Normally copy and paste the recommended. npm i or npm install or something the other options -g
what package manager does centOS use? yum?
then sudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
yeah I will give this a shot much like php extensions required. could be the underlining issue.
Thanks @quartz kindle
Tim finally resolved the headache of Everyone
Man, made a SQLiteDataContext. Gotta write some stored procedures now.
I will let you know if that was the issue @quartz kindle just having had issue with any canvas packed prior was bugging my brain. Did not want to code up anything less than nodejs offered without a desktop.
So either way I'll have to dig deeper if it's not just gotta say thanks for remaining somewhat calm ;p
hi. ok so a long time ago I made a discord bot with python and deployed it with git to heroku. bc i had a heroku free account sometime it would go offline until the the beginning of a new month. recently my bot hasn't come online even though I added extra hours. I'm also worried because I recently made a new github account and transferred the repository with the bot over. I'm not sure what to do. my bot has been down for days. and it was working for many years before.
Have you contacted heroku support?
Why would you transfer the repo instead of just clone it there?
Are you implying you don't have a clone of the repo anywhere else? And that you've lost it?
ohh yeah I wasn't really sure how to handle having two github accounts and someone told me the best thing to do was to transfer the repo over
to "merge them"
On my account
For free
As I don't want my money to be wasted
So instead I will help
It anyone wants
Think amazon offers up free time also for free.
so I do have the repo on my new account now.
I take it you're not that familiar with how git works?
yeah p much
I recommend reading up on it, it's a very important tool in the application development community
the having two accounts really confused me. i thought by transferring the repo i could merge the two accounts. but now im just not sure if I have broken anything
Is there any way to add a . in a dns record?
EG:
Domain name: example.com
Url: my.prev.example.com
I saw this done by google firebase.
EG:
Domain name: google.com
Url: console.firebase.google.com
how do i go about contacting heroku support? when i looked it up it said i have to be a member
also you could technically use VirtualHosts if you need that for your website for example
i mean the website you use to to edit the settings for your domain
@gilded dawn Honestly I'd just recommend getting a $3 VPS per month from a host, heroku isn't worth using to host a Discord bot on, even if free
no?
its been perfectly fine for me but i do understand it can be hard to set up to begin with
Nvm
@earnest phoenix ive seen some mean workflows with heroku and bots before
Especially if u do the whole travis into publish type deal iirc
https://www.name.com/blog/how-tos/tutorial-2/2016/12/how-to-create-a-subdomain-for-your-website/ then just have whatever you want. i assume something.thing would work as a subdomain
lemme take a look
If Cloudflare is handling ur records, you would just create a subdomain there

??

no one is going to invite your bot
-faq 1 -c @fresh matrix
@fresh matrix
dont post bot invite links here
Soz
how do i check if a command is being used in dms
/block it f rom being used in dms
check message.type == dm or true value in message.guild
isn't it message.channel.type?
Hmm won't if(!message.channel) work
message.guild
but it doesn't always have a guild
My bad
if(message.channel.type == "dm")?
yes
try it
in python @commands.guild_only() god i love python
or something like that
probably is_guild()
Well we can have that in js too
yeah it's guild_only()
guildOnly property set to true
For command
Just feed that in Command handler i mean
wait this is a general javascript question but if i have an if statement and i want something to happen otherwise do i use else or do i not haev to?
ex:
if(message.channel.type == "dm") {
message.reply("You cannot use this in dms!")
}
//Insert other code that happens if it isn't here
or do i have to use an else statment?
it's an if statement
@karmic compass you can put a return after the reply
so u don't need else
that way you dont have to use else
return
``` then we good
oops
message.reply()
return
``` would work? (ofc stuff in reply)
i belive so
do dms register as guilds?
no
no
@quartz kindle help me with something
?
I'm wanting to find an IP address in a users message with a regex
but my current thing
only works if the whole message is an ip
i want it to check if the message contains one
if(message.content.match(ipRegex))
search instead of match?
Might wanna include support for ipv6 as well, js
Doesn't g make the regex check the whole string
only works if the whole message is an ip
@obtuse jolt tf, that's not how regex is supposed to work
@slender thistle i put search and it deletes messages that arent ips
that's elsewhere in your code
and you're sure your regex is correct
what does the regex look like
let ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
The fuck
oh god
besides that wow regex, the ^ and $ assert the positions at the start and end of the string
get rid of them
lol
since the ip won' t always be at the start / end of the string
how do you get bot develeper
i think i should learn how regexes work
please use \d{1,3} to check for digits instead
I stucc
The regex is too scrambly for my brain hole
much appreciated
i think you could just do the same thing 3 times
Lmao
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
i fucked up the copy pasta
🤷♂️
you get the idea tho
could replace the [0-9] with \d too
I have an equation that is not just 1 message per minuite for xp
Should it be 1.1x or 1.2x xp per proper messages?
i give 0-50xp per message by default, configurable by guild
No, that is to much
my xp is based off a games
i liked the math
something like 13 million xp for level 99
lmao
10 woo dollars to the first person to guess the game
I think that you should do 1.2 or 1.1x times xp for multiplier for each minuite, with at least 12 messages, cause I have a 5 sec slowmode
so basically you are having a consistent conversation
why is that function for calculating xp so complex 😮
Hey anyone know how to check if someone has a role ive been having a hard time with it
djs?
Oh yeah sorry i didnt mention that
When I try .hasPermission i get a error saying its not a function
hasPermission is different than having a role. are you looking for someone having a permission or a role?
https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=hasPermission
ok
how do i let the public add my bot
rawname = message.author.id;
const ifuser = client.users.cache.get(rawname);
if (ifuser.hasPermission(MANAGE_MESSAGES,)) {
console.log("sucsess")
}
your getting a user, not a member @uncut vortex
look]
if this message is being sent in a guild, you also could just use message.member
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=member
only GuildMember objectes have the hasPermission method
speaking of
i hope my bot is processed soon because i submitted it on the 8th
and theyre doing that today
ok but how can the bot be verified?
mods manually review it
yeah
yep
can it be alphabets or only numbers?
depends on the vps provider and OS
i have letters in mine, ubuntu doesn't require numbers
yep basically
^ I just sent you a invite in dms
ty
I tried GuildMember.hasPermission and Member.hasPermission and its saying that Member is not defined
mods manually review it
@solemn latch hm ok ham it can take years right?
3+ weeks
@molten tree current time is 3 years
message.member will have the GuildMember object if the message is from a guild @uncut vortex
It worked thanks
On the page of my bot, a box-shadow is created by default, how can I remove it?
I tried, none, but it doesn't seem to be working.
I may have misselected the class.
You also may need to important it.
https://www.geeksforgeeks.org/how-to-apply-important-in-css/
inspect element and check the original css rules
Ok thx
except this is not general chat
@silver dust you're not getting muted just warned
hey guys. I'm trying to make a command that pulls from randomly from a list of replies. here' the code I have
let random = Math.floor(Math.random() * replies.length);```
```if(command === 'shrooms'){
message.channel.send(replies[random]);```
However, each time I try, it generates the same reply. If i turn off the bot and turn it on again, it generates a different response. But as long as the bot is enabled, it will repeat the same response. is there any reason for this?
Nearly have an SQLite db in place to replace my JSON db context
Hype
hey guys. I'm trying to make a command that pulls from randomly from a list of replies. here' the code I have
let random = Math.floor(Math.random() * replies.length);``` ```if(command === 'shrooms'){ message.channel.send(replies[random]);``` However, each time I try, it generates the same reply. If i turn off the bot and turn it on again, it generates a different response. But as long as the bot is enabled, it will repeat the same response. is there any reason for this?
@earnest phoenix you need to put the random in the command
where would that go?
ohhh
@misty sigil got any promo codes for oxide.host? (My dad is being fucking tight with my money lmOaoaoaoaoa)
nah there is none
Fuc
its only 3.59 a month 
£3
Self-host life 🥳
No ew
any clue on how i can make my website show a embed when i send the link
any clue on how i can make my website show a embed when i send the link
@slender wagon <meta> tags
theres a good guide on reddit afaik
yup tysm!
np!
sorry for asking again, but i'm a bit new to this. where would the random go in the if statement?
Above where you use it, inside the if statement
where exactly? (really sorry, never worked with discord bots before)
if(command === 'shrooms'){
let random = Math.floor(Math.random() * replies.length); < this is above where you use it
message.channel.send(replies[random]); < you use it here
get it @earnest phoenix?
Jeremy this host is fucking amazing ngl
yes, thank you
may i ask which host u talking abt?
:o send
k
I'll ask for free stuff
no
I hope not
That sounds dangerous
Ok cool
only ones you need tho
Why do i keep getting this error when connecting to the API
3000 + 3001
#topgg-api @opaque eagle
@opaque eagle you could try converting it to text and logging it
to see what you get as it looks like html at the moment convo moved to api
Is it possible to make a discord.js bot inside a html file within <script> tags?
if you manage to open a websocket connection through frontend js
shiv
I would be interested to see a djs bot running in a browser
oh that's neat
although its kinda not maintained
Weird
how would you even connect client side???
client side js supports websockets
but the data comes from the backend, at least thats how i done it
and in this case, there is no backend
everything runs in the browser
the web is painful
trying to auto purge some channels but it's not doing, solution??
async def auto_purge():
cid = [722442867xxxx, 722767457xxxxx, 722767582087xxxxx, 722767758521xxxx]
for c in cid:
channel = bot.get_channel(c)
def not_pinned(msg):
return not msg.pinned
await ctx.channel.purge(limit=100, check=not_pinned)
auto_purge.start()```
what lib is that
d.python
py
Is using the singleton pattern any better for saving memory? Because there's just one instance of the class at any point.
For storing the list of upvotes in memory, I'm considering either a singleton UpvoteHandler class that keeps track of it internally or just a Map<Snowflake, Date> property under the Client class that stores new upvotes.
i know about dom and stuff, vanilla js doesnt really lack stuff, node.js just makes it a little bit easier and hides any data
from what it seems to me, dont really understand how that works then
Vanilla JS is run in the browser... the browser is sort of the "runtime" there... Node.js lets you run JS on your operating system outside of the browser
yes
And also provides APIs to interact with OS-y things like the filesystem, etc
the idea was to run a discord bot in the browser, so when you access a website, the webserver/backend would send you all the necessary js code for the front end to connect to the gateway by itself, using a user-provided token for example
oh
you can still interact with apis and im pretty sure u theres an os thingy, yeah, nothing with fs tho
why do people do that 😩
you want to make a dashboard properly = semi hard
you dont want to make a dashboard properly = easy
like.. running your dashboard and bot on the same process is just really bad, you're only utilising probably 10% of the library's features, hackiest shit ever
and people who do literally everything client side 😔
there's always the right tool for the job
and ideally you want to run as much as possible on the client side
to avoid starving your server's resources
in all of my projects, most of the stuff is done server side
they all run pretty fast, but could be faster if i try doing more client side ig, ever since i found out about inpsect element 😓
lets say you have a webapp that does something like generating canvas images
based on some json data
lets say in order to get this json data, you need to use some api that requires an api key
which means its not safe to give it to client side, you have to do it server side
but once you have the json data, you can send the json data to the client, and have the client build the image using browser canvas
instead of using node-canvas in the server, and sending the already built image
thats why i do most of my stuff server side
most of my projects are open source, 80% is done through the backend, even if i can do it client side, idk i just dont like it.
well.... i've got two websites open source anyways
how are you meant to use the javascript api with a sharding bot?
if you get 500 requests and build 500 images on the server side using node-canvas, that will hit your server pretty hard, probably max out your cpu for a minute or two, even with good concurrency techniques
but if all you do is respond with some json data, then the impact on your server is very low, and it will all be processed in less than a second
hmm, yeah. never thought about that
thats why almost every api out there returns some kind of json data, and never a finished product/response
im still a bit new to web development, like 2-3 months into express and actual web dev. but one of my "rules" is to do as much stuff server side, probably would want to do more client side thinking about it now
i just thought apis response is json because they dont know what they want us to do with the data
@terse girder which part are you having trouble with? there is not much difference
if it wasnt json, what else could it be 🤔
for example images, audio/video streams, downloads, svg, etc
instead an api will return json data containing urls to static files
which npm package?
js
?!
isn't there only one?
js isn't a npm package its the language
what
are you talking about discord.js?
whats the-
ok thats the npm package then
#topgg-api prob (idk)
ohh
-bot info
wut
What bot are you trying to use
Idk u got any good ones?
I dead ass got discord today so idk what I’m doing at all
Well, this is the development channel.
Oh sorry
try running !ping in #commands
but something instead of ! cuz nothing will respond
and pick a bot u like
whats the difference between
ca ni add my bot
Does anyone have a microservices-oriented bot? if so how is it laid out
?
i couldnt install @discordjs/opus on my vps
so i installed opusscript what worked somehow
what vps do u use
let db_store = await new Promise(resolve => {
db.query(`INSERT INTO shipdata (account_id, ship_id, yr, winrate, time) VALUES ('${account_id}', '${ship.ship_id}', '${yrating.to_average()}', '${winrate}', '${now.getTime()}' ) `, function(err, rows) {
if (err) throw err
resolve(rows)
})
});
let endTimeOne = now.getTime() - 86400000
let queryOne = `SELECT winrate, yr FROM shipdata WHERE account_id = ${account_id} AND ship_id = ${ship.ship_id} AND time = (SELECT MIN(time) FROM shipdata WHERE account_id = ${account_id} AND ship_id = ${ship.ship_id} AND time >= ${endTimeOne} AND time < ${now.getTime()})`
let db_ship = await new Promise(resolve => {
db.query(queryOne, function(err, rows) {
if (err) throw err
resolve(rows)
})
})```
Got an issue with the part of db_ship
apparently my data gets stored
but when i ask it to retrieve data the first time i call this it doesnt obtain any row
What can i do/should i have done to get a result from the last promise?
Why does nginx doesn't loads css and js files in my website?
Here is my nginx config =
server {
listen 80;
server_name www.suggestions.wtf suggestions.wtf;
root /website;
index index.html;
location / {
include /etc/nginx/mime.types;
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1;
}
try_files $uri $uri.html $uri/ =404;
}
}
How to pm2?
wdym
How do I set up pm2
It's already on the LoC system
Idk how it works :d
how do u start the app on ur local machine?
show ur package.json
Oky
sudo npm install pm2 @pure lion
I can't sudo
its already installed
....
Okay
u can add the .js but it looks ugly!!
pm2 is a process manager
and loc is up 24/7 with little to no downtime
its running the script when you close the terminal
Oh epiccc
unless loc's thingies go down, ur thing stays up
Btw I should probably create a ticket with Ramirez to request peerjs globally :d
To start the server
global as in npm install -g peerjs
-g is blocked
So the site is up now but no rooms jajajajaja
Or actual calls
I'm gonna create a ticket brb
Probably not yet
E
Idk
he doesn't need that now
Depends on the command's calculation. Sharding is just an easy way to cluster bot servers, right?
Most people shard on one server iirc
i think its the only way ever implemented
Clustering is a bit more work right?
Clusters are a bigger thingies which have smallers shards which have guilds
i think
;-;
its all the same shit, just a matter of how you split it up
Can you use broadcast eval with clustering?
depends what you consider a "cluster"
i remember when i was gonna cluster at 188 guilds 
if its a process in the same machine, spawned by a master process, yes
otherwise if you have a remote ipc connection, still yes
otherwise no
are clusters like a fixed thing?
Hmm
like sharding is, one shard cant go past 2.5k guilds
ah
i think a reasonable amount, for a discord bot, is 80 - 100 shards per cluster
nvm me!!
lmao
i was thinking of something completely different
im stoopid
oh and its still wrong :/
Lol, it really depends
Your shard count for diffrent servers probably depends on the hardware
The way you shard
ideally you would want to fit as many shards in a single process as a single cpu core can handle
now you probably dont want your cpu maxed out all the time
but i guess 1 core being on like 50% permanently would be ok
so as many shards in one process until a single cpu core gets to around that
Lmao, imagine being efficient
this side of dev talk makes me wanna set up a grafana dashboard
same
I liked setting up grafana
but too much work
yeah
the pm2 web dashboard is nice
lmao
Learning about prometheus was kinda intresting
but its limited to 4 processes for free accounts
oof
I thought the pm2 panel was always paid
i got da 0 p's
Like a 30 day trail or something
holy
thats some pretty good statisticistitcs u got there m8
well when i make changes to the environment like update node version and shit, i have to reload the entire config
so it also resets the counters
Aj
but that one's online for a month now
which is basically the last time i did that
those 82 restarts are because i pushed code with syntax errors lmao
nice one
@solemn latch it used to be paid but they seem to have a free version now
limited to 4 processes
and doesnt keep logs
Still useful for quick checks
you can only see the last 5min for cpu/memory activity, and only if you keep the tab open that long
Ah
but its cool that you can add your own metrics
how long have you guys been into these kinda things?
Most of my life
for general tech, basically 15 years
damn
ever since my teens
@peak venture you ever get your issue worked out? I can send you a helpful little code that may work out better for you.
I was taking apart computers since elementary school
aghgjuhf
im
Totally not the reason the family pc kept dying
does anyone know of a way to see if a message contains a URL, and how to pull it out from that message>
computers give me headaches
i did a bad bios update and bricked my pc when i was 16, it was traumatizing and i never trusted bios updates anymore
can you explain that to me
@gritty bolt you can check if the message contains http:// or https:// i guess
How to cheat at internet:
require('http') to require('https')
Free SSL X)
?
lmao
quick question is |= an operator in js
i think it is wait
:= walrus
'a' | 'b' what does this mean again
Is it for TS typing or something
well, it wont be for typings
all of these exist
o?
its bitwise or
What
yes | is bitwise "or"
Directed the SSL gateway to your domain IP if it's self assigned and your server from any place like google domains or where ever you host that domain. Although I would debate this is off topic.
im using bitfields for my badges
they work really well
Stock
They do not allow trolling on here. Just remember to take your daily nap.
I will, gn :)
haha im like that with 50% of people in this chat xD
gn dice ;p
im here lol
Oh hi
Tim is always here
not always
Tim is omnipresent
Tim is omniscient
Ohhh |= is bitwise or assignment
Tim is a literal god
I was so confused
subscribe to my religion thx, need money to build church
Woo it makes sense ngl
lmfao
*hug*;a
subscribe to my religion thx, need money to build church
@quartz kindle what religion is this
The $42 club
Patron religion
A open discussion about canvas to image to show via a bot. Without visiting the url prior or having a desktop. I haven't went and attempted to see if that was correct. I just find communication with those type of things are good FAQ. Flaming someone trying to dev anything here isn't going to get you moderator position.
Subscribe to mine so I can have a better host
Only one of us here who could be mod is tim.
The rest of us goof around
@unreal bluff what
I break atleast a few rules a day
how do i make bot DM users?
..that doesn't make sense
mods have a lot of work and dont get paid afaik
User.send
how do i make bot DM users?
@urban olive read the docs
Although, I did claim to know 28 programming and web dev languages. Not knowing something bugs my mind when all the languages start blending together and you forget a few things here and there.
@unreal bluff
fuckyou.ejs
res.render('fuckyou.ejs', {suckMyBigBalls: stockValue01 //...})
link?
Depends on your lib
im using js
@urban olive https://google.it
tim, what do you use for use for monitoring?
How can I replace every number in a string with **number**?
let string = '1 hello 2 world 3';
string = string.replace(/[0-9]/g, "****");
// wanted result -> '**1** hello **2** world **3**.
Js has multiple libs
currently only pm2
mods have a lot of work and dont get paid afaik
@quartz kindle they get paid in rice grains
1 rice grain per bot reviewed
yes
ohok
I feel like I am babysitting to just watch where I can assist someone actually needing help.
:r
Need a daycare channel.
@digital ibex pm2 has a web dash board, you could give it a try https://id.keymetrics.io/api/oauth/register
@unreal bluff if you aren't going to help go to shitpost :)
yeah, im trying to set it up rn
Allowing a user like dice to chat openly here is a strong red flag to any mature dev.
ook
ok
Anyone? #development message
@earnest phoenix for some reason I can't think of a reasonable way to do it
I think ima just leave you kids with that.
Allowing a user like dice to chat openly here is a strong red flag to any mature dev.
I totally agree with you
Except not sike bitch this is some bullshit :D
Loop through each word?
Grow on it for a few years.
IsNaN it
match it, loop it, and replace it
Yeah
@earnest phoenix use regex match
args.forEach(arg => isNaN(arg))
Id isnan each arg
lmao
Allowing a user like dice to chat openly here is a strong red flag to any mature dev.
Ngl this is valid but only for me and nobody else nobody should ever take advice from me
