#development
1 messages ยท Page 249 of 1
Dont fuck with python, cause that shit hurts
ubuntu 20 requires python to run all these:
gnome-control-center
gnome-session
gnome-terminal
network-manager-gnome
ubuntu-desktop
ubuntu-desktop-minimal
ubuntu-drivers-common
ubuntu-minimal
ubuntu-release-upgrader-core
ubuntu-release-upgrader-gtk
ubuntu-session
ubuntu-standard
ubuntu-system-service
lmao
uninstalling python literally kills linux

Note to self
dont fuck with python 3.10
Works again
ty <3
learned something new though
Now I know how to troubleshoot minor network problems at least

did you reset from contabo panel?
nah I tried that thing in stack overflow
which one
Was able to connect my vps back to the internet
right here
which answer
netplan still not a command tho
so yikes
Gotta figure that one out
pretty sure a lot of packages that come with ubuntu got uninstalled when python did
due to purging packages after uninstalling python3.10 & python3.9
sudo apt-get update && sudo apt-get upgrade
sudo apt --fix-broken install
sudo apt-get purge network-manager
sudo apt-get install network-manager --fix-broken
sudo apt-get install ufw --fix-broken
sudo apt-get install python3:any --fix-broken
sudo apt-get install ubuntu-desktop
probably dont need the last one since its not a desktop
W: https://download.docker.com/linux/ubuntu/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: The repository 'https://ppa.launchpadcontent.net/certbot/certbot/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

wtf does this mean
you need to reset the certbot repository
just do the certbot installation process again
ig2gsleepgoodluckkthxbye
ty
Right so, classic question. Who should I go through for quality US servers?
october 26th my contabo vps contract runs out, and I dont want to go with contabo anymore
hetzner us servers also sadly aren't the best in terms of price and not to mention idek what exactly cpu I am getting
yea
price is a concern
aws is fucking expensive as hell
azure and gcp are also
for what you get its not worth it imo
those are "quality servers" I know. maybe wait for others suggestions
digital ocean also expensive af
yeah lmfao
Vultr is a bit cheaper than digital ocean for the performance
iirc it's contabo that has bad support and slow machine?
is it possible to make a command if the user already vote and make they allow to use specific command?
yes
Any idea why the activites not working anymore for my bot?
How can I register a primary entry point command?
It worked yesterday but now I can't even launch it.
Ngl in my opinion contabo is cancer
lmao
do i need to use the api from top.gg itself?
or how could make it detect?
you can use api, but it's limited to the first 1000 votes iirc, and there's no way it'll be live
use webhook instead
and save the sent data from topgg to your desired db, and handle it by yourself
const { ApplicationCommandType, AttachmentBuilder } = require('discord.js');
const Canvacord = require('canvacord');
const Level = require('../../models/level');
module.exports = {
name: 'levels',
description: "Check your current level and experience points",
type: ApplicationCommandType.ChatInput,
cooldown: 10000,
run: async (client, interaction) => {
const guildId = interaction.guild.id;
const memberId = interaction.user.id;
try {
// Fetch user level data from the database
let userLevelData = await Level.findOne({ guild_id: guildId, member_id: memberId });
if (!userLevelData) {
// If no data found, initialize new data
userLevelData = new Level({ guild_id: guildId, member_id: memberId });
await userLevelData.save();
}
const { level, experience } = userLevelData;
// Simulate gaining experience for interaction
userLevelData.experience += 10;
if (userLevelData.experience >= userLevelData.level * 100) {
userLevelData.experience = 0;
userLevelData.level += 1;
}
// Update the database with the new level data
await userLevelData.save();
// Create a level card using Canvacord
const rank = new Canvacord.Rank()
.setAvatar(interaction.user.displayAvatarURL({ format: 'png', size: 512 }))
.setCurrentXP(userLevelData.experience)
.setRequiredXP(userLevelData.level * 100)
.setLevel(userLevelData.level)
.setRank(1, 'RANK', false) // Assuming rank 1 for demonstration; replace with actual rank if available
.setStatus(interaction.user.presence ? interaction.user.presence.status : 'offline')
.setProgressBar('#FFFFFF', 'COLOR')
.setUsername(interaction.user.username)
.setDiscriminator(interaction.user.discriminator);
rank.build()
.then(async data => {
const attachment = new AttachmentBuilder(data, { name: 'rankcard.png' });
await interaction.reply({ files: [attachment] });
});
} catch (error) {
console.error(error);
await interaction.reply('There was an error fetching your level data. Please try again later.');
}
}
};
what did i do wrong after fixing it show as Canvacord.Rank
what shoudl i add then?
i cannot used embed right?
It depends on what version of Canvacord you are using. The documentation shows that it should be new RankCardBuilder() I guess
https://canvacord.js.org/docs/canvacord/class/RankCardBuilder
You may be using some outdated guide/code
where can i download the fonts?
it need some custom font as i read in the doc
I have no idea, I've never used this library
you use which library?
No library that would manipulate the image in any way. I just don't create functions like that
so the only library that generate the image just canvacord only ?
there is no other?
They definitely exist, but Canvacord seems to be quite popular
TIL there are libs to generate profile cards
ohh
did i do something wrong?
const express = require('express');
const bodyParser = require('body-parser');
const createServer = (client) => {
const app = express();
const port = 3000; // Change this to your preferred port
// Top.gg webhook token
const TOP_GG_WEBHOOK_TOKEN = 'xxxx';
// Middleware
app.use(bodyParser.json());
// Verify the webhook token
const verifyToken = (req, res, next) => {
const token = req.headers['authorization'];
if (token !== `Bearer ${TOP_GG_WEBHOOK_TOKEN}`) {
return res.status(403).send('Forbidden');
}
next();
};
// Handle top.gg vote events
app.post('/topgg-webhook', verifyToken, (req, res) => {
const event = req.body;
if (event.type === 'voted') {
const userId = event.user;
console.log(`User ${userId} voted for the bot.`);
// Notify the bot about the vote if needed
// Example: client.emit('topggVote', userId);
}
res.sendStatus(200);
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
};
module.exports = createServer;
it dont reply anything it dont give any error or any notification 
did you put the correct url on topgg?
ah token?
url
you need to put a url there yes
what url i should put ?
and something you want to use as a password
the url of your server
as in, the server where ur bot is running
^
server as in machine, not discord server
like this one?
no, the ip you see in the allocations tab
copy the ip
anything, it's you who define the authorization token
but whatever u put there you should also put on your code
hi sayu
use environment vars or files
helloooooooooooooooooo
also remove the Bearer from here, topgg will send exactly what you put in that field
so i should add the webhook url : XXX.XXX.XXX
and the authorization : XXXX (key)
inside my code also? or just use the token that i put above
already fine
it's not recommended to put secrets directly in the source code
then how could i make it link?
use environments
either via environment variables, or use an environment file (with dotenv library)
you already using that to store your bot's token?
ya
that's great, you can also put the authorization key there as well
along with the address
ok
after i add the ip
it give this
did you put the full url
you told me to ip only?
ok
const express = require('express');
const bodyParser = require('body-parser');
require('dotenv').config(); // Load environment variables from .env file
const createServer = (client) => {
const app = express();
const port = process.env.PORT || 3000; // Use port from .env or default to 3000
// Top.gg webhook token and additional config from .env
const TOP_GG_WEBHOOK_TOKEN = process.env.TOP_GG_WEBHOOK_TOKEN;
const WEBHOOK_PASSWORD = process.env.WEBHOOK_PASSWORD;
const ALLOWED_IP = process.env.ALLOWED_IP; // Single allowed IP address
// Middleware
app.use(bodyParser.json());
// Verify IP address
const verifyIP = (req, res, next) => {
const clientIP = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
if (clientIP !== ALLOWED_IP) {
return res.status(403).send('Forbidden: IP not allowed');
}
next();
};
// Verify the webhook token and password
const verifyTokenAndPassword = (req, res, next) => {
const token = req.headers['authorization'];
const password = req.headers['x-webhook-password']; // Custom header for password
if (token !== TOP_GG_WEBHOOK_TOKEN || password !== WEBHOOK_PASSWORD) {
return res.status(403).send('Forbidden');
}
next();
};
// Handle top.gg vote events
app.post('/topgg-webhook', verifyIP, verifyTokenAndPassword, (req, res) => {
const event = req.body;
if (event.type === 'voted') {
const userId = event.user;
console.log(`User ${userId} voted for the bot.`);
// Notify the bot about the vote if needed
// Example: client.emit('topggVote', userId);
}
res.sendStatus(200);
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
};
module.exports = createServer;
like this?
why do you have both TOP_GG_WEBHOOK_TOKEN and WEBHOOK_PASSWORD?
no, that's the former
x-webhook-password I suppose is filled by your webserver, but that doesnt add any safety layer
as any request will need to pass by it anyway, so it'll always be true
ok
so i just have top_gg token and allowed_ip should be fine right
i have send the test thing also notthing has show
more expensive than mine (with higher spec also), but still cheap than those big companies
datalix
$5 for 12gb ram and @4 2.8ghz vcore
i've been happy for the performance, and also it's closer than US to me (it's in germany)
๐ฅ
๐ฅ
Too bad they don't have US servers 
well usa servers are next
just a lot easier to offer german servers cuz the owner lives in germany yknow
๐ฆ
like 2 hours to datacenter for him
i have vpses from all over the world* 
-# *only 4
when vps in my house
just do it urself smh
smh
pretty much exactly $550
hmm fair price
I used used parts except for drives
ah yeah used parts ism't that bad for servers

wtf
I have an orange pi with 8 cores and 16GB of ram I use along with gigashit internet
SQL can easily handle this! There is a transaction statement but transactions are primarily for MILLIONS of rows or if you want to discard a transaction before it's committed to the data set
youre lucky to have gigashit internet for self hosted server
if i own my own server, it'll run with d/u 50/10mbps lmao 
if you can call native queries then also yes, postgres allows batch inserts
INSERT INTO table_name (field, field, field) VALUES
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3),
(1, 2, 3);
guys anyone have any tip to not make my bot a unmodififeed shape bot?
bruh ):
Sadly you cant
||Ngl I am happy that shapes cant be modefied||
i dont understand that the port is use even i change it?
const express = require('express');
const { Webhook } = require('@top-gg/sdk');
const TopGG = require(`../models/TopGG`);
module.exports = (client) => {
const app = express();
const webhook = new Webhook(process.env.TOPGG_WEBHOOK_AUTH);
app.post(
'/dblwebhook',
webhook.listener(async (vote) => {
try {
const userId = vote.user;
let TOPGG = await TopGG.findOne({ userID: userId });
if (!TOPGG) {
TOPGG = new TopGG({
userID: userId,
remindersEnabled: true,
lastVoteTimestamp: 0,
totalVotes: 0,
purchasedRoles: [],
});
}
const VoteUser = await client.users.fetch(vote.user);
const guild = client.guilds.cache.get(process.env.SUPPORT_SERVER);
const USER = guild.members.cache.get(vote.user);
const channel = client.channels.cache.get(process.env.TOPGG_VOTE_LOG_CHANNEL);
const thankYouMessage = `๐ Thank you, ${VoteUser.tag}, for your vote! ๐ Your support means a lot to us!`;
console.log(`${VoteUser.tag} Just Voted On Top.gg`);
TOPGG.lastVoteTimestamp = Date.now();
TOPGG.totalVotes += 1;
await TOPGG.save();
if (channel) {
await VoteUser.send(`**> Thank you ${VoteUser.tag} for voting me on top.gg**`);
await channel.send(thankYouMessage);
} else {
console.log("Invalid Vote Log Channel");
}
} catch (error) {
console.error(error);
}
})
);
client.once('ready', () => {
const PORT = process.env.TOPGG_WEBHOOK_PORT || 3101;
app.listen(PORT, () => {
console.log(`Express server is listening on port ${PORT}`);
});
});
};
i mean thats kinda what they are for
many changes at once
that depend on each other (not necessarily)
Screams in >$180 freedom units/month
One message removed from a suspended account.
they are not quality servers at all, they are fucking horrible
I mean, quality as in theres a name behind it
terrible fuckin specs tho
Wouldn't pay for them even if it was the last servers left available
they are throttled af
in GCP, your ssd performance scales with how much you pay]

you need to pay like 50-100+ per month to get the same ssd performance you get anywhere else for $5
bully
tbf
he picked me up, then killed me again
Thats like ultra disrespect in the game
So I came back to his raid and fucked em up then raided his base
oh wait
rust server, as in, the game?
i thought rust server like a discord server for the language lol
aaron killed the programmer dreams of the kid 
people who selfhost a git service for their personal projects ๐
i dont want to visit your shitea website mann
What do you guys usually give out for voters? Tryna incentivize voters
Maybe a higher command usage limit for the premium commands
currency
Whats wrong with that? 
does anyone know how to get google to remove safebrowsing's "Dangerous" when the site is literally private? ๐ญ
yes
๐
use a certified certificate
for some reason this isn't happening in incognito
I mean, like, with some big name to attest you are legit
chrome does not like self-signed certs
this hasnt been a problem EVER
for me it's always been an issue on chrome
this
okay nevermind
maybe
chrome was just absolutely
tweaking
I just use CF origin cert
cert cache maybe?
no, I mean, a stale copy was in cache
uhhhm
well it disappeared now though
i closed the window, opened another
and tada...
very weird
also im using traefik for context
instead youll have issues with cloudflare itself
I mean, only issue is if ur using an always-open websocket
cuz CF periodically drops connections when they hotswap for updates
I mean you should have reconnection logic either way
i meant more on the business side of things, although im sure it wont happen here since they only care about popular sites
did you read this? https://robindev.substack.com/p/cloudflare-took-down-our-website
it really did amaze me how pushy they are and essentially force you to upgrade to an enterprise plan without saying you have to
tldr
dont make casino websites
on cloudflare
its not about the casino, its about the principle
it, is definitely mainly about the casino
it makes no sense to discriminate against their clients assuming theyre complying with all laws
this doesn't apply if you're simply using it for dns
they probably cranked their plan usage to the maximum for extended periods of time
its likely but its mostly about the way they went about it, instead of just reaching out and saying "youre maxing our internal caps please upgrade" they went about it in a very weird way
i would expect at least that level of transparency if im a paying client
you could do it yourself, it aint too complicated
this is what I do
Oh wait, sent the wrong code
That's to parse time into millis
I'll send the correct one later
Here, image is a bit small cuz I'm on pc
It's java but the same formula applies to any lang
i've got a 'game' where the bot gives a random word from a list and members have to type it as quick as they can
its timed with performance.now, and usually the timing works fine and is consistent
but occasionally/randomly, all of the results show a way quicker time, (maybe around a second quicker?)
is this just discord being wacky with events and stuff or could it be something with my code?
function: https://github.com/mxz7/nypsi/blob/main/src/utils/functions/chatreactions/game.ts#L38
Keep dividing by the millis_in_X till the level you want
Any quick-time game won't work through discord
Cuz u have 4 different layers of delay
- bot sending message to discord
- discord shows message to users
- users send message to discord
- discord sends event to your bot
yeah its not intended to be competitive, just hoping to show consistent timings
The accuracy of the time of each one will be waaaay off
Random latency can happen is any of those layers too, often more than in one
Bot to discord u can mitigate kinda, just start counting from the time the message finishes sending
For the other 3 it's hard to get any form of precision
also traffic between discord servers, the users and where the bot is hosted geographically 
You can use activities for that game if you must, at least it'll be as close to real-time as possible without IRC-inherent delays
nah thats too much for it, its existed for over 3 years now i was just tryna perfect that 1 issue
surprisingly it works alright as in faster typers are usually the winners
but people in australia etc are always at a massive disadvantage
Guys is it me or .setTimestamp() for Embeds is delayed? For example if I send an Embed with timestamp at 1 second after the minute, it still displays the timestamp from the previous minute. So if I execute it at 01:01:01, it shows 01:00 instead of the current minute.
๐
how do i stop an email address from being used more than once when using auth.gg email verification bot in my server?
if (emailExists()) return;
oh wait, u mean there's a bot for this
you'd better ask on their support server, we cant really help with that
as they should
darn kangaroo people
its a bot called auth.gg
when people verify, i can download a CSV file and upload it to a google sheet
and im trying to figure out how i can stop people from using the same email more than once
because i dont want to ban someone and then they can just join back on a new discord account and use the same email
if the bot is not yours, you'll need to contact the bot owner and ask them if there is an option for that
but i would imagine it to be quite unlikely
which bot doesnt have a DB
since it would require the bot owner to store third party email addresses, which is a very big privacy breach
yes, ive done that and now im waiting
wdym?
guys does shape bots ! comamdn count as costum commadns?
im able to see the emails after someone verifies it
not afaik
topgg does not like shapes
Only when you coded the commands with real code.
Giving the Ai the prompt to respond to that keywords etc etc is not a custom command
but it still couldmake goood bot tho right?
yes but it will likely be rejected by topgg
you could still use other bot lists tho if they accept it
how
topgg is a bot list website, there are many others out there
oh
@pine willow
@quartz kindle
yes but the bot is not yours, right?
someone else owns the bot
i cant check if the bot is his or not lol
lol
i dont think its his bot
yes thats right. its not mine
why?
because the bot owner has all emails in his servers
if its not encrypted, he could very well access and use those emails, send spam, etc
and if not him, if his server is hacked, all those emails will be leaked to hackers
but i assume the owner of a decent security bot knows all this and took measures accordingly
with discord bots its extremely unlikely
most bot developers just happened to get a popular bot going and may have decent developer skills but security practically none
ive seen massive bots with tons of servers have exposed databases on their dashboards and a lot of very concerning stuff
no firewalls either
plus ssh with passwords enabled
@shell tundra i start knowing why top.gg kinda hate shapes now.....
it VERY hard to start a new command and acctually make it work ;-;
i mean, even if you make it work, topgg does not like it, meaning your bot can still be denied just because its using shapes
why they no like :<
shapes does not provide enough features to make bots unique, basically bots made with shapes are very generic, all similar to each other, they all look like clones
wanna try my shape bot? :>
he would love to
he created some "commands" that are in the bots mind because of the system prompt
Also note
Most attempt of shape from what I seen
Is running another code side by side with shapes
And that would count as multiple instances, so another decline
i got my first subscription! it took me 4 days to notice it
@proven lanternI encountered the same issue and managed to resolve it by exploring online resources. Unfortunately, linked articles aren't allowed here. Inbox me so I could provide you with some resources that might help.....

i am going to create a lambda that runs ever couple hours and calls this endpoints and updates my dynamodb table with all the active guilds
maybe i'll send myself an sns notification if a new guild is added
how does this table look?
DbPremiumServer:
DependsOn: DbCounter
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: "id"
KeyType: "HASH"
AttributeDefinitions:
- AttributeName: "id"
AttributeType: "S"
- AttributeName: "subscription_status"
AttributeType: "S"
- AttributeName: "random_seed"
AttributeType: "N"
GlobalSecondaryIndexes:
- IndexName: "subscription-random-index"
KeySchema:
- AttributeName: "subscription_status"
KeyType: "HASH"
- AttributeName: "random_seed"
KeyType: "RANGE"
Projection:
ProjectionType: "ALL"
TimeToLiveSpecification:
AttributeName: "expiration_time"
Enabled: true
BillingMode: "PAY_PER_REQUEST"
One message removed from a suspended account.
One message removed from a suspended account.
i want to show 10 random premium guilds on my website. my plan is to store all the active subscriptions in here and query using the GSI starting from the random_seed=Math.random()
One message removed from a suspended account.
least obvious scam
One message removed from a suspended account.
One message removed from a suspended account.
thats exactly what i want to do
i want to grab their emails, build an email list, and do email marketing
i will have their emails and can sell things to them
you should use something like constant contact. there are lots of rules about email marketing
What is constant contact?
Ive never heard of that
it's a service that sends out emails and doesn't get blocked as spam because it follows the rules about unsubscribing
Each separate email in violation of the CAN-SPAM Act is subject to penalties of up to $51,744
yet none of them help to stop spam in any meaningful capacity
you can opt out of emails in most cases but you can do that with blocking anyways
yo guys did any one know why new registered discord slash command not showing on my discord server
permissions=8&integration_type=0&scope=bot+applications.commands
there's too much code to analyze, do you think you could shorten it down a few lines maybe?
i'm kidding, you should provide more context if you want help
im guessing you mean a sort of health checker
docker lets you see the health check logs and when the health check fails
oh that thing
i want to see the status of like my 18 docker containers' app
i heard of one but its more for front facing websites so its quite vague in its detail
Cachet
yeah cachet
for customers and people id recommend it but i dont think its maintained anymore and if you want an internal one youd want more detail anyways
nevermind they still sort of maintain it
@surreal sage grafana?
its basically designed to integrate with almost anything including docker and tcp
uhh
can u send
docs link

it also supports integration with Prometheus but thats likely too complex for your use case
its a time scale database
skill issue
prometheus right
can you do a custom integration?
id honestly just write my own health checker from scratch and then setup some ui to view everything from a database
relying on supported software for tracking limits your options
it doesnt have to be advanced
but if youre using it purely for docker im sure theres dedicated solutions for that
a website where the contact button runs away from you when you try to click it
https://img-9gag-fun.9cache.com/photo/aQz9eq2_460svav1.mp4
lmao

erm i'm to stupid to make it
ูููู
lmao
this saves so much time KEKW
Added GUI
What database do you guys recommend for a server list
Game server instance list
Not exactly persistent but data should stay during restarts/crashes of the API
anybody know a good mongoose plugin to automatically encrypt certain fields and allows me to query encrypted fields (with the decrypted value)? I was looking at mongoose-encryption but it seems the only way to query encrypted fields is by doing this:
const allModels = await Modal.find(); // returns all documents with their decrypted values
const specificModel = allModels.find(({ field }) => field === "decrypted value");```
im pretty sure there are
pre-save
events
where you can modify documents
does zod
support
defaults
yes it does
im just very blind
First preview version of my project is now interactable https://devspace.fluxpoint.dev
It's gonna be an advanced version of Portainer, Sentry and other developer tools with server/website/project management features.
veryyyyy nice lad!
Thanks got most of the basic features done including full 2FA support โค๏ธ passkeys
looking good, but feels very slow to use, is the dev server slow or is it something else?
5s to load js files
890kb js file lol
Yea there is no compression on that file still in development, there's also a few other tweaks i can do to make it faster that i can look into
once it loads its fast, but first load is 6+ seconds of black screen
how does top.gg protect itself from sending a webhook to a server that will collect it's IP and attempt to DDoS?
why are you even asking that kind of question in the first place
because im building my own webhook feature in my app and i want to protect against these kind of potential attacks
The 2 things you can do is setup a proper linux firewall to block outside connections on all ports and allow stuff like your own ip and cloudflare ips to port 443 which will prevent ddos.
You could use another server to act as a proxy that all webhook requests use and your main server ip is not exposed.
we also have an api so the firewall option i dont think would be suitable? also for the proxy, i dont know much about networking so im not quite sure how i could do this. im currently using an express server which the api will be hosted on (and currently where the webhooks are being posted from) and this domain that this express server is being hosted on is protected with cloudflare
Yea you can do that cloudflare domain
linux firewall, my lover.
@rare merlin https://github.com/Paul-Reed/cloudflare-ufw
Use that and create a timed cron job to run every hour, that will add cloudflares ips to your firewall on port 443 (ssl https port)
and for the public api?
wouldn't this block those requests
The public api is running through cloudflare though?
i suppose
Everything running through cloudflare will be allowed with that script just that noone else can connect directly to your vps
Cloudflare has ddos mitigation/protection so that works best
My project i'm doing will also have some nice firewall stuff 
and set the default rules to deny incoming and allow outgoing connections;
sudo ufw default deny incoming
sudo ufw default allow outgoing
Would i need to do both, or only incoming? since i will be sending webhooks (outgoing)
Just the 1st one since second is already default allow
Make sure to add your ip first too otherwise you wont be able to remote ssh xD
ahh i misread, i thought they were both deny
im also using the same server to self host plausible, im not sure what this relies on so i feel like the firewall would cause conflicts with this
they get ddosed every few days so not much lol
Is that running through cloudflare too?
its got a dns record on cloudflare @prime cliff
wrong ping
*wrong reply ๐
Does anyone have a
uhh
npm package
written in typescript
that has a new Client() for api
with post methods
etc
i need a template to work off
nvmmm
!!
something interesting i found in brave
any example of those v8 attacks?
Chrome is prone to a remote code-execution vulnerability. Specifically, this issue arises when the V8 JavaScript engine handles malformed JavaScript code. Malicious JavaScript code may gain unauthorized access to memory, allowing the attacker to obtain sensitive information and execute arbitrary code in the Chrome sandbox. Failed attacks may cause denial-of-service conditions caused by a renderer (tab) crash.
The attacker can exploit this issue by enticing an unsuspecting victim to view a malicious webpage.
interesting
i think its mostly an attack that is possible
the v8 optimizer compiles some of your code to assembly/binary so the same paths/snippets can run faster
if an attacker can somehow influence the assembly/binary that is generated or control execution flow you could thereotically escape the VM and get remote code execution
if there is no optimizer that doesn't happen and javascript is interpreted on the go
if you have bad js code the worst that can happen is v8 crashing from a bug or a buffer overflow perhaps
so far what i've been able to find was limited to some native node modules
being able to pre-compile malicious code and have v8 execute it
so i dont think browsers are directly affected, yet
Hello it's me again and this will be final reply. sorry
The day before yesterday I had physical access to the server.
But I was really stupid and stupid
It wasn't a hack or a virus
It's just that my home internet had a dynamic IP and it changed once on 8/13.
After that, I kept trying to access the IP before it changed.
But just in case, I did a clean install.
I also used the router's DDNS feature to provide permanent access even from a dynamic IP.
Thanks, sincerely
wasm probably
i dont think wasm is more secure than js
the core execution is the same except wasm allows more fine-tuned access to things
theyre still both interpreted and have some parts of it compiled into machine code
its still locked to the sandboxed apis tho
wasm cant access aanything that js cant
in a browser at least
idk about purposeful memory corruption but i would imagine wasm uses a sandboxed memory region as well
but if we wanna target/manipulate v8`s compiler itself, wasm only has 2 compilers (liftoff, turbofan), js has 4 (ignition, sparkplug, maglev, turbofan)
Ah, less worse then
anyone willing to help me figure out what's going on with my game? 
codes a but lengthy but mainly because of the logging... but i made another version of my click war game ( @quartz kindle knows about it) called Chaotic Click War but i'm trying to make it to where round 20, players who were previously eliminated can jump back in with 5 lives, or if you're still active you just gain 5 lives - but players get interaction failed when trying to jump back in, but i get no errors in the logs!
specifically, this is what handles the special round 20 button
oh wait.. is it because i have it defering the interaction and well as sending the ephemeral?
await i.deferUpdate();
``` should i just get rid of this?
idk
use
instead?
No errors on log?
no, not for round 20, just says that the players trying to use it are not eligible
Where is the part where you send the "you are not eligible"?
Nvm found it
Ok so, the user is neither in game.players nor game.lastEliminated
As being in either would mean not reaching the else
Are them supposed to be in either?
so the users who are using that button to jump back on the game are players who were eliminated in any round from 1-19, and if they werenโt eliminated then they just gave 5 lives to their current count. so anyone thatโs eligible is basically anyone who joined the game
itโs saving their user idโs in the lastEliminayed array
But are u ever removing from game.players?
Cuz you have to be somewhere, and in that place it'll not be adding to lastEliminated too
Yes, when a player is eliminated during a round, they are removed from the game.players set
And then added to lastEliminated?
yes
Show that part please
In some specific scenario it's not doing that transference properly
ok 1 sec
Which is why ur getting the "not elligible" issue
I'd actually advise never to remove the players, but set some variable to know they're no longer playing
This way you avoid both getting such issues and allocating a new array
oh ok, you're definitely getting a race condition there
ah that makes more sense
am i?
Very likely, you're never checking if the turn that event is seeing is the same turn it was expected to see
Try saving the current turn somewhere before creating that collector
Then use if (turn === game.turn) or smth
Or have a variable somewhere to indicate the event was already ran
To prevent it from ever passing twice on the same code
Since ur reassigning game.lastEliminated
Optionally, put a console.log right before u reassign it
To see what array it's passing to that variable
Perhaps your filter isn't working as u expect too
correct, i used it a little bit to help lol - still fairly new
so basically itโs like
Alright. Good luck with your bot or other Project!
put them in a room and tell them when they can come back in instead of kicking them out of the house and locking the door
Yes I know, but the issue is in the part you're setting lastRemoved
Something there isn't doing what it should do
So put some logs there to check each value
ok i think i see what youโre saying g
idk if this has anything to do with it.
let playersToEliminate = [{id: 1}, {id: 2}];
let game = {};
game.lastEliminated = playersToEliminate;
playersToEliminate.push({id: 3});
console.log(game.lastEliminated); // [{id: 1}, {id: 2}, {id: 3}]
let playersToEliminate = [{id: 1}, {id: 2}];
let game = {};
game.lastEliminated = [...playersToEliminate];
playersToEliminate.push({id: 3});
console.log(game.lastEliminated); // [{id: 1}, {id: 2}
what are you seeing about it?
in the block of code that logs non-elegible player, there is no reply/followup there, thats why they see interaction failed
reference
in the first example, both playersToEliminate and playersEliminated are pointing to the same array, even though they are supposed to be different
2nd example eliminates that by explicitly constructing a new array from the prior via spread syntax
a shallow copy iirc
not sure why were still using javascript here when we should be using Rust
@quartz kindle
Me play to much hsr
Interastral Peace Corporation
"unsafe" code in a sandbox emulated environment ๐ญ
maybe if rust can be interpreted, perhaps people will hook in
why would you use rust in a sandbox when you could use zig
i considered adding zig as a comparison language but figured it would give you too much validation
you're going to love zig
js definitely allows you to write unsafe code lmao
can run in the browser: โ
โ
does not need compilation: โ
โ
very easy to use and code in: โ
โ
extremely hackable: โ
โ
tim approved: โ โ
i love it: โ โ
is
const str = `${undefined}`
str === "undefined"
// or
str === ""```
too lazy to check
first
has "i love <this language> and will never use anything else" stans: โ โ
๐
that also cring
i use my brain's language
my gov forced kids to make their brain a compiler
so pro
frfr
i've been staring at this C code for hours now because i'm too scared to debug it
๐ญ
ooooohhhhhh!!
makes sense!! it worked!!!
-a rust user
you were using rust a few days ago
You cheater
Youโve betrayed us
works!!!!
i said you were using it
Nah i use ws
im sorry </3
๐ฅ
Bro rocking the 9900 got dam
One message removed from a suspended account.
One message removed from a suspended account.
Mmmmmm AMD fans in chat
Running the 7950x3D
I mean I wouldve waited for x3d
but i need to switch asap cuz im in intel 14th gen
and already had 5+ crashes last week
Same soonโข๏ธ
im selling it on ebay sir
how much ๐
650โฌ
Damn
Bros charging more than retail
im sure someone will buy it tho
they are getting out of stock in a lot of major retailers
you guys are truly the best
we know
fire cpu โค๏ธโ๐ฅ
7800x3D & 7950x3D still better
i have Ryzen 7 5700x
I heard thats a pretty decent one
for its price anyway
@neon leaf lmk how the 9900X is
Theres already a passmark report for it, but since its only 1 its not very believeable
@sharp geyser hey uhm what are your thoughts on this? #general message
What do you want me to test
Pc almost ready
Really curious about its proclaimed gaming & workstation abilities
does your room heat up to 100F after a couple minutes?
the 9900x is very efficent
do you have it?
all of the 9000 series are an efficency upgrade more than a performance upgrade from what I've heard
I dont ๐ฆ
still waiting on 11000 series
I would expect the x3ds to be coming out still in 2025
After intel's fuck up with the 13 and 14th gen chips
Beginning 2025 ye
Like Feb 2025 is what I heard
Then my upgrade will hopefully be in 2026-2027
Should have plenty of power until then
I still have my 5900x under volted dramatically
loser ive got a 5800x
alr it boots
I've got an intel i7
i was scared to death
in my macbook
Congrats on the upgrade!
time to fix bios settings now
Thank god i added a weekly stats reset
dafuq is a trilliard
its higher than a trillian duh
1,000,000,000,000
you mean this?
i know that as trillion, not trilliard
although in portugal thats 1 billion
I have trillion after Billion???
and after trillion this comes
and i wrote the name
otherwise it would be T twice
or did i do smth wrong
WHat
some countries use million->billion->trillion
other countries use million->milliard->billion->billiard->trillion
other countries use million -> thousand millions -> billion -> thousand billions -> million billions -> thousand million billions -> trillion
What in the fuck is a milliard
I swear you countries are more confusing than the US
Million, Billion, Trillion
simple
after T would be Q no? thats what cookie clicker games do usually
hmmm
lemme fix
anyway speaking about millions let alone billions is wild for me, I will never see that amount of money
๐
Milliard is billion, at least in Poland
Previously in British English (but not in American English), the word "billion" referred exclusively to a million millions (1,000,000,000,000). However, this is not common anymore, and the word has been used to mean one thousand million (1,000,000,000) for several decades.[4]
The term milliard could also be used to refer to 1,000,000,000; whereas "milliard" is rarely used in English,[5] variations on this name often appear in other languages.
In the Indian numbering system, it is known as 100 crore or 1 arab.
๐ค
my brain is simple
that mumbo jumbo means nothing to me
All I know is million is a lot, same with a billion
trillion is unobtainable
damn scientists
me when science
me when ur mom
what the fawk

Dutch-speaking
10^6, miljoen; 10^9, miljard; 10^12, biljoen; etc.
French-speaking
10^6, million; 10^9, milliard; 10^12, billion; etc.
Portuguese-speaking (except brazil)
10^6, milhรฃo; 10^9, mil milhรตes or milhar de milhรตes; 10^12, biliรฃo
Spanish-speaking
10^6, millรณn; 10^9, mil millones or millardo; 10^12, billรณn; etc.
im speaking english
nuh uh
half of that message is in english
ok buddy
Actually
thats not only english
a lot of languages use numbers like that
oh no how scawy
do any devs here know of any freelance legal advisors that specifalise in UGC web app compliance?
i'm building a web app, but i'm not exactly a lawyer. Obviously i understand the general consensus of GDPR and stuff. But want to cover all bases prior to launch to ensure i'm compliant.
I realise it's not strictly a dev question, but since you guys are devs (often building your own web apps) i just thought you might be able to point me in the right direction. 
@quartz kindle Got a question for you
I recently had this dumb idea, (as in 3m ago) to try my hand at making a database, not anything special really just a file database. Do you know what my first steps should be?
Theres a lot of information online, but a lot of it seems conflicting
do you want to create a language like SQL? or just a simple key-value storage?
I'd like to mimic a nosql type database
with schemas or without schemas?
like pre-defined tables/structures, or freely editable json-like
About same TDP as the 7950x3d from what I saw but that was thru passmark and like Aaron said that has a sample size of 1
doing a json-like would prolly be the easiest option to start
I can prob run another passmark rn
Hello
I think json like is fine for now
I dont want anything too crazy
I mainly am trying to write my own db solution for my plugins I make in rust (game)
The options they provide are absolutely terrible
and to use anything else in mono / netstandard 2.1 is annoying asf
in any case, its a good idea to start with a key-value engine
you could use something like lmdb and build on top of that
or make your own from scratch of course
you will need to decide how to do the indexing, chose between hash table and b/b+ trees
I feel like making my own from scratch would be more fun
but without a clear guide on what to do it will be more challenging

so imagine this
you have keys and values
keys have to be converted into a fixed size
so you need to chose a hashing algorithm
I see
you hash the key, then you store the key hash into either a hash table, or a b+ tree
the key hash leads to another fixed-size value, a number representing some sort of location or position
could be the node number of a file on disk for example
then on the data itself you store both the non-hashed key and the full value
so basically:
key -> hashed key -> table/tree -> file index/number/position -> key+data
if you want multiple items per file on disk, you can define something like a bitwise number/index that contains file id and start position inside file
i made my own database and its not fun if you want it to be somewhat useful
@sharp geyser
nice
Interesting
I will have to look into this more
should be fun :P
the most complicated part is implementing the hash table or b+ tree
so you could instead use some library for that
the rest shouldnt be much difficult
i've never done trees before, but i did a hash table, if you wanna go that route
Alrighty! Thanks a lot for the information :P
I have to try and make this as efficient as possible
anything that slows you down in a rust plugin is bad
Where may I view all the interaction.is...() functions? I couldn't really find them in the documentation
Such as interaction.isChatInputCommand()
ctrl + space
if you want best key-value read/write performance, hash tables are good, otherwise if you need ranges, searches and flexibility, trees are better
ic ty
hey guys
hi
i have a very complex image i want to create in htm;/css.
though, i am just thinking should i just create an image in photoshop and import it?
Cuz i feel like the image i want to recreate will be ahrd to dynamically scale
you want to recreate an image with raw html/css? like with elements and styling?
yeah
i might just create an imnage to be fair
it's way too hard using css etc cuz the image is pretty complex
complex as in what exactly?
because if its only geometry, lines, shapes, etc, then you can use SVG
but if its pixels like textures, shades, gradients, shadows, then it has to be an actual image
let me send you a screenshot
its possible, but not sure if worth it
do you absolutely need it to be scalable to infinity?
you can simply make a high-res image and resize it to multiple size breakpoints
then serve each according to screen size/pixel density
nah fuck it
i have an svg generated of it, that scales pretty well right?
I could simply use bootstrap's grid system and breakpoint system to break it on small sized screens
svg scales to infinity just like html+css
if it generated a good looking one without weird lines and edges, then youre good to go
@quartz kindle do you have the docs for lmdb
implementing a b+ tree looks more annoying than I thought
๐
it works like a charm tim, thank you!
API documentation for the Rust lmdb crate.
its a key-value memory mapped engine
its like offline redis, sort of
but more barebones
I see
many databases use lmdb behind the scenes
so its up to me to build it up and make more features
ye
.NET library for LMDB key-value store. Contribute to CoreyKaylor/Lightning.NET development by creating an account on GitHub.
Oh shit
thanks
Noq
Question
If you were using a database, what features would you want
well, i dont need much, i usually make my shit pretty dead simple
im using lmdb right now
only using sqlite for some more important stuff like user accounts
not a lot of people know this
but there is a very good lmdb lib for node
which can be easily used to make a persistent cache that supports multiple processes
and its sync
imagine if bot devs knew about it
:^)
hell would break loose
mongo would lose money
the day bot devs become smart
is the day pigs fly
@empty steppe could you please give an update on what going on with your bot?
Have you ever heard of messagepack / memorypack?
yes lmdb-js uses messagepack for encoding
oh cool
i've also used messagepack in a few projects
I was thinking of using messagepack in someway
but im not exactly sure how it works
and one of my shelved projects is a competitor to messagepack, or it will be some day lol
its literally a json replacement
converts objects into buffer, and buffer into objects
looks like memorypack is a more specific format for C#, so its probably better than messagepack
messagepack is a more generic format
How exactly does get/set or get/init work in C#
I notice some people make private fields and then have public get / sets for that private field
like wtf is the point then?
that's what it does automatically anyways behind the scenes
public int Property { get; set; }
is equivalent to
public int <Property>k__backingField;
public int Property { get => value; set => <Property>k__backingField = value; }
which getters and setters are further reduced down into actual methods
the reason for doing that is to reduce coupling* since fields are not a part of a class' public interface whereas methods are (think about how you cannot have a field in an interface)
I see
how does init work?
Because I want a "readonly" field, that only gets set once at class instantiation
From there on it should be read only, and unchangeable
that's what init is
although if it's constant you could also do say
public int FavouriteNumber => 25
what is this => notation
kinda inline with the syntax for lambdas and expression bodies
public int GetFavouriteNumber() => 25
``` that would make a method that returns 25
so technically it doesn't set it to 25
oh?
So it only "gets" 25?
yes
interesting
if you did like DateTime.Now for example
Im not quite sure how I would use this then
it would always get the current datetime
public class ImpulseDb : IDisposable
{
private bool _isDisposed = false;
private string? _dbPath = null;
private LightningEnvironment? _env = null;
public ImpulseDb(string databasePath)
{
_dbPath = databasePath;
}
see I want _dbPath to be get only
and have it set only when ImpulseDb is instantiated
would I just do {get; init; } and then set it in the constructor?
if you're prefixing it with a _ then by convention it should be a private field and not a property
so you should be using readonly rather than an init property
you should only be using properties for things you want to expose on your class's interface
p much
there's cases where you might want private properties but few and far between
they're there to reduce coupling
I am writing my own database in C#, using LMDB as the backend.
Problem is, the way the wrapper for LMDB I am using works is that it requires you to dispose of the environment and quite literally everything else once you are done with it.
using System.Text;
using LightningDB;
using var env = new LightningEnvironment("pathtofolder");
env.Open();
using (var tx = env.BeginTransaction())
using (var db = tx.OpenDatabase(configuration: new DatabaseConfiguration { Flags = DatabaseOpenFlags.Create }))
{
tx.Put(db, "hello"u8.ToArray(), "world"u8.ToArray());
tx.Commit();
}
using (var tx = env.BeginTransaction(TransactionBeginFlags.ReadOnly))
using (var db = tx.OpenDatabase())
{
var (resultCode, key, value) = tx.Get(db, "hello"u8.ToArray());
Console.WriteLine($"{Encoding.UTF8.GetString(key.AsSpan())} {Encoding.UTF8.GetString(value.AsSpan())}");
}
Like anything using the environment
also has to be disposed of
this is an example on how to use it
why aren't you using using var for everything
Well
Because I don't want to dispose of the environment until AFTER they dispose of the ImpulseDb themselves
ig technically yeah you want to control when they go out of scope
Transactions and stuff dont matter
I can dispose of that after its out of scope
but the environment i NEED to have remain until they call .Dispose themselves, or when the finalizer kicks in (not sure how finalizer works)
~ImpulseDb()
{
if (!_isDisposed)
{
Dispose();
}
}
public void Dispose()
{
// Dispose of connection
_isDisposed = true;
}
I somehow need to make sure I dispose of everything properly
otherwise memory go brrr
i don't think you need finalizers with idisposable
@dense flame
finalizers should only really be used for unmanaged resources
Well its more of a safe guard
so like C/C++ stuff
It will ensure that everything is disposed of
no that's what dispose is for


