#development
1 messages · Page 267 of 1
If you don't rollback very often or the changes are small then it's prob fine
But if you're rolling back a lot or you're changing a lot (maybe even changing an implementation pattern of some sort that requires changing many files), it's useful to commit partially
just is why you have ci/cd pipelines to catch this stuff 😉
but yeah sometimes there's syntax that the minifier doesn't support, depending on the minifier you use
it doesnt even catch it 
My project at work uses an old ASP.NET jQuery MVC minifier that can't handle destructuring
which fucking sucks
solution SHUT THE FUCK UP!!!!!!!!!
real

bye not even appears in a local build
Anyone got advice for a good vps hosting plan?
(been having some issues with pebblehost bot plan and need to upgrade as my bot has grown quite a bit)
hetzner
discord hosting services are insecure and quite untrustworthy and usually just overly expensive
get a vps, hetzner, contabo, anything known to be reliable
optional: put coolify on it (automated deployments)
Yeah, I noticed after I opened a ticket asking why my bot was shutting down..
A quick Google search later revealed their system was shutting it down.
Repl.it is pretty good, that's what I use
Contabo is looking cool so far
Was
Still works great for me, unfortunately is no longer free
Ah, well, yeah
I thought you were talking about the self-ping method
Tho if you're going to pay then a full vps would be better
I'll be looking at reviews after reading that
Yo, how the fuck do I change the position of an element that is absolute
.dropdown {
display: inline-block;
position: relative;
}
.dropdown-menu {
display: flex;
flex-direction: column;
position: absolute;
visibility: hidden;
min-width: 5rem;
max-width: 10rem;
background-color: red;
opacity: 0;
}
.dropdown.open .dropdown-menu {
visibility: visible;
opacity: 1;
}
This..is getting annoying
😭
Figured it out
I ask here. Is using return(None) in python okay to stop the execution of the code or is there a more "proper" way? I heard of break and it no big deal since what I been using always work for me.
they all have different roles
return isn't to stop execution of code, it just returns a value to the caller of the function (so it works as an exit point)
you can ofc use it to stop, but that's is its main role
break exits current (or labelled) loop or switch scope, it does not work outside either
continue skips to next iteration in a loop
guard clause:
returns everywhere in my code
i would not be able to code without guard clauses because nested if conditions would make me crazy
@harsh nova
thx
very useful error message™️
How can I get the vote webhooks at the same time as having several shards because dcp uses the same ip and port several times?
a port can only be used by one process, discord libs manage shards as individual threads/tasks
Hence my question
for vote webhook you just need one port to receive the vote event, it can be anything (above 1024 and below 65535)
just make sure you open it
OK, it works, but I have to limit the port to the shard where my server receives the votes?
Because I send the votes to a lounge on my support server
they're separate things
shards are shards, webhook is webhook
your bot will be in one port, the vote api will be in another
I know, but if I receive the webhooks votes on the wrong shard because my support server isn't on that shard, won't I be able to send the vote to the channel?
Ok i try
you'll receive the webhook event in the api, not in the shard
you then either make the api notify your bot process that a vote happened or you have the bot read the database and handle it
I don't understand everything you're saying because I'm French, but I think you're talking nonsense.
TopGG --(vote event)--> Your API --(notify)--> Bot
the bot process then sends the notification in the correct channel
Did I not mention the api?
you'll need one
you cant receive http requests without one
if you use topgg library then that's the api
you put the webhook in the shardingmanager, not in the shard
then you can use broadcastEval to send it to the correct shard
or you can add a condition like create webhook only if this shard has your guild id
Very clear, the exception is handled
you're welcome
:)
I don't understand, in fact axios is launched in my ready.js so in each shard and dcp it duplicates the ip and crashes here is my real problem
Why are you receiving votes on a shard?
your webhook api whatever should be its own process
or, start when the bot starts (not when a shard is spawned)
do you use discord.js?
Yes
maybe im missing something here
Yes i have
hello tim
made a cursed protobuf alternative that doesnt require schemas on either side
Original: 118 bytes
Original (brotli): 109 bytes
Original (gzip): 123 bytes
Original (deflate): 111 bytes
Encoded: 102 bytes
(Original being stringified json)
whats the content of the json?
const data = encode([
new StringValue('hello'),
new Uint8Value(255),
new StringValue('world'),
new Uint8Value(0),
new StringValue('你好'),
new BufferValue(Buffer.from([0x01, 0x02, 0x03, 0x04])),
new RecordValue({
sus: new StringValue('sus'),
amogus: new Uint8Value(1)
}),
new BufferValue(Buffer.from([0x05, 0x06, 0x07, 0x08])),
new ArrayValue([
new Uint8Value(1),
new Uint8Value(2),
new Uint8Value(3),
new Uint8Value(4),
new RecordValue({
type: new StringValue('arnude'),
cash: new ArrayValue([
new Uint8Value(1),
new Uint8Value(2),
new Uint8Value(3),
new Uint8Value(4)
])
})
])
])
const jsonEquivalent = JSON.stringify([
'hello',
255,
'world',
0,
'你好',
[0x01, 0x02, 0x03, 0x04],
{
sus: 'sus',
amogus: 1
},
[0x05, 0x06, 0x07, 0x08],
[1, 2, 3, 4, {
type: 'arnude',
cash: [1, 2, 3, 4]
}]
])
ar nude
could do it in 74 bytes
:^)
elaborate
lemme get home first
Tim currently walking through the Brazilian jungle to his humble abode
nah just sitting in a bar having a beer
find me a gamer gurl who plays league
nah ditch league, come play deadlock
most gamer gurls have mental issues
Is deadlock even poppin rn?
I swear the hype died quick
it is, some days we get slow queues but usually it's a few seconds to find a game
no, we ain't gonna get into another contest for best X algorithm
hell yes we are
not sure if it also applies to tims thingy but nothing in my encoder can go over length 255

essentially something like this:
byte1 = type array length 9
byte2 = type string length 5
byte3 = h
byte4 = e
byte5 = l
byte6 = l
byte7 = o
byte8 = type number length 1
byte9 = 255
byte10= type string length 5
byte11 = w
byte12 = o
byte13= r
byte14= l
byte15 = d
...
hm
thats exactly what I have
then you're wasting some space somewhere
inb4 u encoded the tabs
class StringValue implements BaseValue {
public readonly type = 1
constructor(public value: string) {}
public encode() {
const buffer = Buffer.from(this.value, 'utf8')
return Buffer.concat([Buffer.from([1, buffer.length]), buffer])
}
}
class Uint8Value implements BaseValue {
public readonly type = 2
constructor(public value: number) {
this.value = value % 256
}
public encode() {
return Buffer.from([2, this.value])
}
}
// ...
class RecordValue implements BaseValue {
public readonly type = 4
constructor(public value: Record<string, Value>) {}
public encode() {
const chunks: Buffer[] = []
for (const [key, value] of Object.entries(this.value)) {
const valueBuffer = value.encode()
chunks.push(new StringValue(key).encode(), valueBuffer)
}
return Buffer.concat([Buffer.from([4, Buffer.concat(chunks).length]), ...chunks])
}
}
class ArrayValue implements BaseValue {
public readonly type = 5
constructor(public value: Value[]) {}
public encode() {
const chunks: Buffer[] = []
for (const value of this.value) {
chunks.push(value.encode())
}
return Buffer.concat([Buffer.from([5, Buffer.concat(chunks).length]), ...chunks])
}
}
you have type and length as separate bytes
ah
ie 0b00000101
type string as 0000 and length 5 as 0101
but that would make the string limit even smaller, no?
yes, depends on how you organize it
with 4 bits the limit is 16 chars
you can make it 5 bits or even six, at the expense of having less space for different types
i can show you an example of an old project i never finished
this is one of the projects i never finished that i want to finish some day
the goal is to be faster and smaller than messagepack
for example type pos smi, you have 2 bits for the type and 6 bits for the value, which is enough to old a number from 1 to 64 together with the type
so instead of
byte1 = type number
byte2 = 50
you can have
byte1 = type small number with value 50
mmmm
messagepack does this as well
they have 1 bit for type small number and 7 bits for the value
they can hold 0-127 in a single byte
btw this is the code i made to get 74 bytes from your object
function encode(data) {
switch(typeof data) {
case "string": {
return [data.length, ...data.split("").map(x => x.charCodeAt())];
}
case "number": {
return data < 128 ? [128+data] : [0b00001001, data];
}
case "object": {
if(Array.isArray(data)) {
return [0b00010000 + data.length, ...data.map(x => encode(x)).flat()]
} else {
const entries = Object.entries(data);
return [0b00011000 + entries.length, ...entries.map(x => [...encode(x[0]), ...encode(x[1])]).flat()]
}
}
}
}
i just made some random values to hold the types
you can go lower than 74 bytes if you use string compression
Huffman encoding?
no idea, i came up with a weird utf6 encoding
with 6 bits per character best case
makes strings about 25% smaller
you can also make a 5 bits per char encoding, if you limit it to lowercase characters only
Assuming that you have either a limited set of characters or some characters that appear more commonly than others, Huffman is pretty good
i've never tried using it
It’s basically making a BST for a character based on the frequency in which it appears within a given input
It’s very easy to implement
A PriorityQueue does the work for you pretty much
You can look it up, might be worth looking into
from what i can see, huffman coding requires you to read the string first to gather info
is that the one where AAAAABBBCCCCCCCCCCDDDDDD becomes A05B03C10D06?
Yeah it does
No
In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code is Huffman coding, an algorithm developed by David A. Huffman while he was a Sc.D. student at MIT, and published in the 1952 paper "A Method for th...
I suppose this is problematic bc it doesn’t retain information about the tree that was used to build the encoding itself
Therefore you wouldn’t be able to decompress it without storing additional info which would probably defeat the purpose of the space you saved (unless the data is large enough to warrant it)
yeah i cant use it then, i dont want to do multiple passes over strings
goes against my performance goals
Yay got permission overrides fully working for all resource types and specific permissions for roles, members and api client.
14 ci: Fix commits later
@solemn latch you use next-auth right? Can you answer some questions for me?
I am wondering if it supports silently refreshing access tokens, and also I am struggling to implement it myself with nextjs v15
If you use database I think so, yeah. I'll have to look
at this point, this prettier asks me to rebuild everything 💀
you may find this useful: https://github.com/nektos/act
i used a basic slash command to say hello and even after 2 days my bot still isnt marked as active, do i have to add something else or did i miss something? And yes i have the data use turned on 
ye i want to get the dev badge and therefor i need an active bot right?
For your app to be considered active, it will need to have executed an application command in the last 30 days.
If you or your team have an active app, head to the Developer Portal to grab your badge! There, you should find a prompt to join the Active Developer Program and claim your badge, by following these steps:
SELECT AN ACTIVE APP
DESIGNATE A COMMUNITY SERVER
CHOOSE A DEVELOPER NEWS CHANNEL
yes thats what i did read, but i thought the application command is just a.e a simple slash command to be able to turn the bot to active
yes it is, but you need to go to the developer portal and enable the badge there
what does your developer portal say?
hmm
did you do this?
In order for us to detect command usage, you or at least one person on the team that owns the app needs to have "Use data to improve Discord" enabled within User Settings > Privacy & Safety. At least 24 hours need to pass after we detect a command, so make sure to wait at least 24 hours after enabling this setting before trying again.
lul so it is basically trading usage data for a badge
hello developers, i want to ask your opinion, do you prefer use yaml config or env for dockerized C# project's configurations?
yes that part is turned on
thats why i said i waited 2 days since they stated it takes at least 24h 
env vars make more sense to me there
i see, alright thanks!
was gonna say i didn't do that for mine but my bot was already starting to get used a bit
Why not use the appsettings.json for that?
poor people badge
early verified developer badge is where its at
where's yours :^)
Damn
i never had the chance to make a bot during that time 😦
Badge diff
chloe's elite economy bot simply never took off
Even though its so elite? Sad

people are just narrow minded
I cant imagine why sounds like an amazing bot
wouldnt know whats good for them even if it was waved under their nose
Chloe was ahead of her time, they didnt see the vision
Back to old pb 
hm?
You have your old profile picture again :D
i saw my ex today after 27 days of not speaking to each other
and in 20min i need to start teaching an html/css class
im nervous af
You got this 

27 days is rookie numbers
hmm, so you actually prefer appsettings? because in my case, using env will be more easier since i can just put it on my docker-compose environments. if i use files like yml/files, i'd need to set up a directory for the config and mount it to container, which takes a bit more time. that's why i'm asking here what people usually/prefer to use, since i'm new to dotnet + dockerizing it
Id say i prefer it in the .net ecosystem since they work with appsettings.json ootb
Because something like IConfiguration works by default with appsettings.json, idk id they work with other formats also
I have a dockerized project as well and rather than managing the container myself, im using .net aspire for that
probably won't work for macos/windows runners
docker containers for these are likely super slow
if it even has any stable one
- They do
- It's stable enough that if you have a decent enough PC they wont crash randomly
Read here: https://nektosact.com/usage/runners.html
Explains how to get windows runners and macos runners working
Just explains which image is used for ubuntu runners
The only mention of macOS/Windows (in the whole docs/book BTW) is
If you want to run Windows and macOS based platforms and you are running act within that specfic environment you can opt out of docker and run them directly on your host system.
Here are some examples
act -P ubuntu-latest=-self-hosted act -P windows-latest=-self-hosted act -P macos-latest=-self-hosted```
It wouldn't be the case
There's no specific mention of what image is used whatsoever
I guess I'd need to install then try it and see
If it manages to do it in a stable way, pretty neat - but the book/docs just give zero information as to how they run macOS/Windows runners or which image(s) they use..
Woooo got fully working permission overwrites for my project just like Discords but with an extra category for api clients 🙂
Good job
i would have never expected my bot to make it to corsair's discord server LOL
as soon as the default flutter app complie on emulator my computer restarts... been solid 5 times already
any idea what could be wrong? It shouldnt be the code since I havent made any changes
aint nothing like having gpt make gh workflows for you (pain and suffering)
Why not dont use gpt 
what does it do?
Website's not mobile friendly, but something to do with Bluesky
Likely sending your Bluesky posts in Discord
if that what it does, not suprising that it got added to crosair
rarely seeing this kind of bot in queue nows days
multipurpose bot moment
I reviewed one that linked like WhatsApp and discord chats so if you sent a message in a discord channel it got passed along to a WhatsApp channel and vice versa. Still remember that bot years later cus it was unique
Don't remember a single multi purp bot
is it mine? couse i have that bot and its still running (althou it just scrape the online web whatsapp)
Not sure but I don't think so. If I recall correctly I had to give this bot api leys or do some sort of config to set it up
oh mine is just
add this number to your discord group and e!link xxxx-xxxx code
its no longer at the site thou i think
Yeah it wasn't yours I approved but sounds like a cool bot!
sadly i cant make it public anymore couse i am broke
each group eats arround 200-300 mb minimum, couse it has to run another instance of wa web
Multipurpose bot and music bot and ai bot nows days tbh
almost no other new bot
If i have time ill update it so it connect to teamspeak too
people still use teamspeak?
Unironicly teamspeak vc is alot better then discord
We use it for meeting and stuff (not topgg)
My brother uses TeamSpeak or Discord depending on what game he is currently wanting to play with friends because he has other friends for one game and others for another
Also another benefit is you can be in multiple call at the same time and key bind each call to a push to talk
So one call is with client and another is for the team
this tbh ^
also if you just want to play and use voice, pointless to go on discord and make it use your resources unnecessarily
ts > discord for voice
discord > ts for communities etc.
No need nitro perks
When the server is super light to host
have/had ts 5 beta but never really used the new features
You can still crack it no? 
yeah but tbh, i'd guess most people don't use the mobile app
and i wouldn't be surprised that some apks are around, like any other paid app
#2 top paid 💪
Virus troma
The ranking is wild
Threema is the messenger with the most consistent focus on security and privacy.
Threema is the world’s best-selling secure messenger and keeps your data out of the hands of hackers, corporations, and governments. The service can be used completely anonymously. Threema is open source and offers every feature one would expect from a state-of-the-art instant messenger. The app also allows you to make end-to-end encrypted voice, video, and group calls. Using the desktop app and the web client, you can also use Threema from your desktop.
In the desc
Sounds like pr message
Of whatsapp clone
Sounds like Telegram for me 
Never used one so idk
Let's be honest, all these messengers look similar
Its just
Text above
Text box under
, click text box to show keyboard
Not really
when 51$ gift
wasnt threema a paid app?
It's encrypted and swiss x)
It is paid
when being swiss is a feature
xD
we're not allowed to use whatsapp or whatever else in the army for example
forced to use threema because at least it's encrypted not like whatsapp claims it is
what about session? i never use it but i have it installed, its pretty good privacy wise
or discord's "voice encryption"
never heard, other i heard was Signal
session doesnt require any personal data to sign up, you get a unique id instead that you share with people, and account recovery codes like 2fa/crypto
no email, no phone, no nothing
similar to what the bots that forward twitter messages to discord but for bluesky
Thats a rare bot to see
I thibk it is like less then 10 bots that do that in the site atm
Whats the bots purpose?
Forward posts from bluesky to discord channel
no clue what bluesky is
It's something like twitter
Most likely a chat platform?
A lot of people were looking for an alternative to Twitter after Elon Musk took it over and someone decided to fill this gap and people use them alternately. As for me, they are equally toxic so I don't use one or the other 
bluesky was already in the works by the twitter team before elon took over they basically just split and made it a propper public app
npm i topggcard ???
not working
¯_(ツ)_/¯
ohh ok
Official Top.gg Node SDK. Latest version: 3.1.6, last published: a year ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 15 other projects in the npm registry using @top-gg/sdk.
okk ty
leme make it also
@pine willow bro
what is webhook auth?
const webhook = new Topgg.Webhook("topggauth123"); // add your Top.gg webhook authorization (not bot token)
this
like how to create?
🙂 i am new plz hehe
where
....
ohh ok
const { AutoPoster } = require("topgg-autoposter");
AutoPoster("topgg-token", client).on("posted", () => {
console.log("Posted stats to Top.gg!");
});```
need to add in index.js file?
yes
No I dont.
uhh?
How should I know your code??
ah ok
you should try this magic tool: https://google.com @untold vortex
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
good idea but we do have a thing about google i think
yeah...
sorry
add xd okk
https://top.gg/bot/BOTID/webhooks
then under Authorization you set whatever you want
then in the bot you put the same authorization
nah
could it be because it's under a team and you're the moderator of it not owner?
Introducing the Treo Team: Empowering Your Discord Server with Versatile Bot Solutions! Are you searching for a multipurpose bot that can revolutionize your Discord server experience? Look no further than the Treo Team! Our talented group of developers has created an all-in-one bot packed with a wide range of features to enhance your server's f...
Damn, he's missing /bot/ in this url 
damn u are like 0.001 second faster then me
oh LOL i didn't realize that LOL
i need coffee
You need coffee i need sleep
oh league of legends i didn't realize that league of legends
exactly
i just put my french press in the fridge instead of the milk
If I want to provide an incentive for players who are in my community discord server a certain perk (that will be referenced with every click), what's the best way to do this without breaching some sort of discord API limit?
Option 1 (likely terrible): Naively, I could simply check if they're a member of a server everytime they click.
Option 2: Cache their membership status for a certain amount of hours
Option 3: Load the entire list of server members once per day and verify if they're in that list
Have a hybrid of option 3, load all the server members into a database, then on guildMemberAdd/delete you can check the ID of the server and add/remove from that db accordingly
That’s how I would approach it at least
There’s some flaws here like if you or the DAPI have downtime, you’ll have to check the list of server members again, but still
Option 2 is solid as well, check if they’re part of the server once and cache it for 6 hours or some arbitrary amount of time
Option 2 is probably the best for simplicity sake
Option 2 seems rough if I concurrently have 100 - 200 players at all times. Basically would be hitting that endpoint up to 200 - 500 times in the course of an hour. But maybe that scale isn't that bad?
200-500 times in an hour is nothing
you need a lot more requests than that to even get close to hitting the ratelimit
I believe global ratelimit applies here, which would be something like 60 req/s last I checked
Plus, you should ideally implement a system that prevents you from hitting the ratelimit before you get 429'ed based on the HTTP headers discord sends back to you
if you have a websocket connection, you can get multiple guild members in a single call via the websocket, up to 100 members per call
which basically skips the entire rest api and does not impact rate limits
you can also keep the websocket connection for your guild only, just for that feature, if you dont already use the websocket for other things
Damn. They were brutal to you. I will admit, it sucks ass to be a beginner because the non beginners often treat you like pretty poorly. I personally don't know webhooks as I never used them before. I got banned from python discord because I snapped at them for the harsh treatment I had.
Anyway, the best way to figure out things with hopefully not needing to rely on anybody is to look up examples of what you're wanting on google.
yeah that's nothing my discord bot sends messages around 150-200-ish per hour but before each message it checks if the discord channel exists and checks perms
and haven't hit any ratelimit
Great to hear that the rate limit isn't as bad as I thought 🙂
also i think once your bot is verified the ratelimits are a bit more forgiving
That makes sense – my bot has been verified for a while now haha
i think theyre about the same, its only very large bots and agreed on with discord that get special ratelimit increases
but if you do everything correctly its very hard to reach the ratelimits
plus libraries should gracefully handle any rate limit backoffs so even if you do get a ratelimit chances are you wont notice it unless its a massive global one
pretty sure when i got mine verified it said something about ratelimit
never heard of that before, only if its something new
maybe it said that i can contact support to get it raised
Contacting with Discord does not mean that they will automatically give you increased rate limits. I would rather say that it is for these really large bots, otherwise they will tell you to improve your code 
yeah pretty sure they only increase your limits if your use case really needs them
Rate limit increase is when the bot is in like 100k+ servers
And they only increase the global rate limit
Verifying your bot has zero impact on rate limits and it never was the case
you have to write poopoo code to hit them anyways
a lot of the devs here are pretty good at that though
never said it did
yes i am very good at writing poopoo code
I can't believe it, it's ruining my whole worldview
I guess there is an alternative:
- Listen for join/leave events in that one server
- Update database with all the members in it
- Check if members are in it and still cache so you don’t smash your own database
hello guys with this script : ```js
const { Client, GatewayIntentBits, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { AutoPoster } = require('topgg-autoposter')
module.exports = {
name: "topgg",
description: "🔩 Update stats on top.gg",
ownerOnly: false,
userPerms: ["SendMessages"],
botPerms: ["SendMessages"],
async execute(interaction, client, games, lang) {
const translate = require(`../../../Langages/${lang}`);
await interaction.reply({ content: translate.executing_command, ephemeral: true });
const ap = AutoPoster('', client)
ap.on('posted', async () => {
return interaction.editReply({content: translate.update_vote, ephemeral: true});
})
}
};
I have this error : 0|under | Erreur lors de l'exécution de la commande : Error: Unsupported client
0|under | at AutoPoster (/home/debian/node_modules/topgg-autoposter/dist/index.js:46:11)
0|under | at Object.execute (/home/debian/undercover/src/Modules/Commandes/Infos/topgg.js:15:20)
0|under | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|under | at async Object.execute (/home/debian/undercover/src/Modules/Events/Client/interactionCreate.js:39:21)
0|under | Erreur lors de l'exécution de la commande : Error: Unsupported client
0|under | at AutoPoster (/home/debian/node_modules/topgg-autoposter/dist/index.js:46:11)
0|under | at Object.execute (/home/debian/undercover/src/Modules/Commandes/Infos/topgg.js:15:20)
0|under | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|under | at async Object.execute (/home/debian/undercover/src/Modules/Events/Client/interactionCreate.js:39:21)
but my client works its wierd ?
the client object is unsupported also don't make it as a command that's an event it should only be called once so do it in on ready
ohhhh ok
i'll try ty
0|under | Error: Unsupported client
0|under | at AutoPoster (/home/debian/node_modules/topgg-autoposter/dist/index.js:46:11)
0|under | at Object.execute (/home/debian/undercover/src/Modules/Events/Client/ready.js:14:12)
0|under | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)``` @vocal knot it continues...
const { AutoPoster } = require('topgg-autoposter')
module.exports = {
name: 'ready',
/**
* @param {Discord.Interaction} interaction
*/
async execute(client) {
await client.application.commands.set(client.slashCommands.map((cmd) => cmd));
client.user.setPresence({ activities: [{ name: 'Who is the impostor ?' }] });
console.log(`Connecté en tant que %s`, 'Discord');
console.log(`Lien d'invitation du bot : https://discord.com/oauth2/authorize?client_id=${client.user.id}&scope=bot`);
const ap = AutoPoster('', client)
ap.on('posted', async () => {
console.log("posted");
})
}
}```
but what is crazy is that in local it works but in my vps it doesnt
const ClientLogin = require("./src/Client/index.js");
const {
Client,
GatewayIntentBits,
Partials, WebhookClient
} = require('discord.js');
const { sync } = require("./src/Database/sync.js");
const express = require('express');
const bodyParser = require('body-parser');
const Topgg = require('@top-gg/sdk');
const client = new Client({
intents: [
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.Guilds,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions
],
partials: [
Partials.Channel,
Partials.User,
Partials.Message,
Partials.GuildMember,
],
});
ClientLogin(client);
sync();
const app = express();
const webhook = new Topgg.Webhook("");
app.use(bodyParser.json());
app.post('/hook/vote', webhook.listener(async (vote) => {
const webhookURL = '';
const webhookClient = new WebhookClient({ url: webhookURL });
const user = await client.users.fetch(vote.user);
webhookClient.send(`${user.tag} (${vote.user}) viens de voter !`)}));
app.listen(3000, () => {
console.log("?? Serveur en écoute sur le port 3000");
});
``` sure
did you set the topgg api key?
yup
try this
const { AutoPoster } = require("topgg-autoposter");
AutoPoster("topgg-token", client).on("posted", () => {
console.log("Posted stats to Top.gg!");
});
do it exactly like that and see
also what's in ClientLogin
0|under | Error: Unsupported client
0|under | at AutoPoster (/home/debian/node_modules/topgg-autoposter/dist/index.js:46:11)
0|under | at Object.execute (/home/debian/undercover/src/Modules/Events/Client/ready.js:14:1)
0|under | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
``` exactly the same wt
const LoadCommands = require("./Handlers/commands");
const LoadEvents = require("./Handlers/events");
const color = require("color");
const colors = require("colors");
require("dotenv").config();
const {
Collection
} = require("discord.js");
module.exports = async client => {
client.slashCommands = new Collection();
client.cooldown = new Collection();
const colorHex = color(process.env.COLOR.toLowerCase()).hex();
const colorNumber = parseInt(colorHex.replace('#', ''), 16);
client.color = colorNumber;
LoadCommands(client);
LoadEvents(client);
// Connexion du bot
client.login(process.env.TOKEN).catch((err) => {
const errorMsg = process.env.TOKEN.length < 1 ?
"Vous n'avez pas mis de token dans le fichier .env !" :
`[ ${process.env.TOKEN} ] invalide !`;
console.error(new Error(colors.red(errorMsg)));
});
}```
what version of discord.js?
the latest one
idk
in an other bot
it works
Try changing that to “latest”
maybe compare it with how you have it setup cuz idk why it doesn't work
unless maybe you're using an old version of topgg-autoposter
this is what throws the error
so somehow it sees as if you have something else than the above
maybe your const ClientLogin = require("./src/Client/index.js"); fucks with it?
or maybe reinstall topgg-autoposter and discord.js
in a modal, how can I edit the original message that has the button that triggered the modal? (same as interaction.update on buttons)
what lib
discord.js
I tried editReply but it gave this
at ModalSubmitInteraction.editReply (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/discord.js@14.17.3_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:247:48)
at AsyncFunction.listener (/root/projects/0x7d8/addon-bot/src/bot/modals/tickets/logs.ts:35:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Client.<anonymous> (/root/projects/0x7d8/addon-bot/src/bot/index.ts:230:4)```
how about <ModalSubmitInteraction>.message.edit ?
its ephemeral,
at handleErrors (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/@discordjs+rest@2.4.2/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SequentialHandler.runRequest (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/@discordjs+rest@2.4.2/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:417:20)
at async SequentialHandler.queueRequest (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/@discordjs+rest@2.4.2/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:169:11)
at async _REST.request (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/@discordjs+rest@2.4.2/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
at async GuildMessageManager.edit (/root/projects/0x7d8/addon-bot/node_modules/.pnpm/discord.js@14.17.3_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/discord.js/src/managers/MessageManager.js:188:15)
at async Client.<anonymous> (/root/projects/0x7d8/addon-bot/src/bot/index.ts:230:4)```
defer it first
let message = await interaction.deferReply({
fetchReply: true,
ephemeral: true,
});
await interaction.editReply({
content: "",
ephemeral: true,
components: [buttonsRow],
embeds: [embed],
});
it should work for you
also doesnt edit the original message
yeah, deferReply creates one
you need to use that and edit it but somewhere in your code you create a new ephemeral msh
msg
I used what you sent
cuz it's what i do for one of my commands as a confirm prompt
import Modal from "@/bot/modal"
import axios from "axios"
import { ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
import { eq } from "drizzle-orm"
import diagnosisSelect from "@/bot/selects/tickets/diagnosis"
import { size } from "@rjweb/utils"
export default new Modal()
.setName('tickets-logs')
.setTitle('Submit Panel Logs')
.build((builder) => builder
.addRow((row) => row
.addComponents([
new TextInputBuilder()
.setLabel('Log URL')
.setCustomId('log_url')
.setPlaceholder('https://pastes.dev/xxxxxx')
.setStyle(TextInputStyle.Short)
.setMinLength(1)
.setRequired(true)
])
)
)
.listen(async(ctx, product: { id: number, name: string } | null) => {
if (!ctx.interaction.guild) return
const log = await axios.get<string>(ctx.interaction.fields.getTextInputValue('log_url').replace('pastes.dev', 'api.pastes.dev'), {
maxContentLength: size(2.5).mb()
}).catch(() => null)
console.log(log?.data)
const data = await ctx.database.select()
.from(ctx.database.schema.supportDataPoints)
.where(eq(ctx.database.schema.supportDataPoints.priority, 0))
.then((r) => r[0])
await ctx.interaction.deferReply({ fetchReply: true, ephemeral: true })
return ctx.interaction.editReply({
embeds: [
ctx.Embed()
.setTitle('`⚒️` Self-Diagnosis')
.setDescription(ctx.join(
'Before we open a ticket, we will ask you some questions in hopes of you finding the solution to your problem.',
'',
'> **Question**',
`> ${data.question}`
))
], components: [
new ActionRowBuilder()
.addComponents(
diagnosisSelect(ctx, [data.possibleValues], [ctx.support.compactData({ addon: product?.id.toString() }), data.id])
) as any
]
})
})
.export()```
maybe try
const filter = (btnInteraction) => btnInteraction.user.id === interaction.user.id;
const collector = message.createMessageComponentCollector({ filter, time: 15000 });
collector.on("collect", async (btnInteraction) => {
...
await btnInteraction.update({
content: "",
ephemeral: true,
embeds: [embed],
components: []
});
})
I think I found the issue, im using the wrong type for my modal interactions
it mentions the update() method
yep, that works
Lesson for today: check the documentation carefully 
and in case of doubt: yell kurwa jebana
I have never yelled while writing code, but I have questioned the meaning of life 
instead of yelling i listen to heavy metal
yeah metal is heavy, i agree
metal_pipe.wav
How come there isn't a sorting algorithm with a time complexity less than O(n * logn)? Is that even possible?
There are sorting algorithms that are best case O(n) in the event that the array is already sorted, but afaik there is no way to get an average case better than O(n log n)
There’s probably some math out there for it
The idea being that if you are sorting an array, it requires iterating over all of the elements at least once. If you magically knew exactly where each element belonged ahead of time, you’d get O(n) best case
i love when companies forget spf/dmarc records
and then get their shit spoofed for spam mail
counting sort is O(n+k)
then there's the theoretical best case of bead sort which is O(1)
but it's impossible to implement digitally
so is bogosort
:^)
I mean, bead sort actually works 100% of the time at constant time, just not digitally
you just release the beads and they sort themselves
it's not constant time though if you're doing it physically, no?
since the height at which the beads are dropped increases linearly, you'll have an O(sqrt N) growth with gravity
correct, blame gravity
therefore we should run our computers on planets with higher gravity to improve performance
supercondutors are possible at room temperature in neptune
imagine all the ghz you'd gain
not many with modern x86 processors
transistors so tiny, at a point the voltage will pass through the transistors completely
hey guys, long time no see! How's all doing?
I got a question.
Just got into react, i am trying to combine it with bootstrap, but somehow the hamburger menu does NOT close when opened:
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap/dist/js/bootstrap.bundle.min.js";
import "../Styles/home.css";
const Home = () => {
return (
<nav className="navbar navbar-expand-lg bg-body-tertiary fixed-top">
<div className="container-fluid">
<a className="navbar-brand" href="#">
Navbar
</a>
<button
className="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className="navbar-nav">
<li className="nav-item">
<a className="nav-link active" aria-current="page" href="#">
Home
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">
Features
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">
Pricing
</a>
</li>
<li className="nav-item">
<a className="nav-link disabled" aria-disabled="true">
Disabled
</a>
</li>
</ul>
</div>
</div>
</nav>
);
};
export default Home;
A powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more.
@solemn latch is interested
I sent what i could
goodgood
to be fair he didnt do anything wrong other than misusing the channel maybe
lets gooo
react is fun no cap
why didn't i look into it earlier
it makes frontend so easy due to reusing components
daym
I'll never touch react again, not even with a pole
classic
using other web frameworks makes you realise how convoluted and heavy react is
I have not touched the code for any of my bots in about 6 months maybe almost a year in some cases. How bad has nodejs' infinite new versions vortex gotten in that time?
are we up to node.js v78 and d.js v43 now?
Some bots such as Sapphire are doing custom brands as premium perk so you buy their premium and you get a bot with custom profile, name, avatar and about me!
And I wanna know how they run one source on different tokens?
Have you tried to ask on their support server?
One message removed from a suspended account.
their support server is for asking question about how to work with their bot not how to create a bot like they bot XD
latest node is 23.7 lel
but yeah 22 is LTS
they don't do it on one token what they do is if you pay they let you use your own token
That's not what they asked...
They most likely have a "custom brand" version where mentions of "sapphire" are removed. When a subscription is bought I'm guessing a copy of the custom brand is created for the specific user
The custom profile, name, etc are all done by the user on the developer portal
^
then its the same source code but deployed under a different token
likely just a docker container etc
So it's exactly the same system as all these "cheap" hosting sites 
that's literally what i said
not sure if you already have an answer
but i help run a bot with like 10k guilds and we also have custom branding
we are literally just running the same exact source code but deploying it with a different token
in a container
Bots that have no connection with gateway have no status afaik
yep, its just using discord webhook events.
https://discord.com/developers/docs/events/webhook-events#preparing-for-events
you click refresh data then add a space in the description or anything
With asp.net blazor SSR i can trigger server events to update the notification badge and list instantly too
👀
been doing a thing
Super lazy solution.
lol
It even wrote the form action
or well, it can, I just forgot to include it in the prompt.
I never asked it for that 😄
ik LOL
Its so wild how much boilerplate doesnt have to be done manually anymore though.
If I just want to throw together a site for a personal project I will be using this 😄
One message removed from a suspended account.
If the .env is already committed to the branch, then .gitignore will not ignore further changes made to the file
Is it already committed?
Also make sure your .env file is in the same directory as the gitignore, otherwise you need to specify the relative directory to it
Ah, I didnt think about that thank you
i also feel like this is redundant
Why is it redundant
my api docs look so nice
You can't anymore
-servers
@untold vortex
Servers have been removed as they were getting harder to moderate. For more info, please read: #announcements message
im not a fan of that argument there has to be another motive
thats like youtube removing comments because they cant moderate them properly
If you don't know what it's about, it's about money
It's possible that there were more and more NSFW servers advertising on top.gg and it was hard to moderate them
Advertisers probably didn't want to be advertised on a site with so much NSFW content
That's probably why you can't promote/mention NSFW content/functions in your bot description as well
that's true actually good point
im surprised the ad industry is that picky though considering more and more users are starting to use adblocks
not a fan of alienating an entire website just because some of the content has a possibility of being "inappropriate" by todays standards and that bar isn't very high
probably why youtube and almost all social media have gotten so soft you cant even criticise someone without being removed
Anyone who's submitted a server to Topgg knows that they never went through the same reviewal process as bots. So you could ultimately upload anything at the time
Now as for how many servers were published to Top.gg per week, I'm not certain if that's public but it's much higher than what bots ever were
And there were people uploading 10-15-20 servers all of the same concept
was never public but as someone who basically bombarded xig with server reports going through them weekly to try and help I found almost 150-200 nsfw servers per week
People like ignoring rules :^)
especially if there's no quick auto-flagging
AI Auto flagging when?!? ^-^
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Didn't google's ai tell people to off themselves?
I think it was google, but I might be wrong
Honestly, if we ever brought servers back I think we would have to use some form of AI for flagging potentially rule breaking servers.
We could never keep up no matter how hard we tried.
The number of gateway servers was wild, hundreds per day
One message removed from a suspended account.
One message removed from a suspended account.
i think it knows something we dont
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
z
it was trained off data scraped from readit so wouldn't supprise me.
Readit?
readdit idk the spelling
meanwhile I have just clicked through a couple songs on youtube and gotten an ad for some henti mobile game and 4 for various dating/"hotsingles in your area" ads
if it wasn't for the 20 or so cool p[wople I watch on youtube i would just tell my dns ad block to block all google services too
anyway, not the rant I was intending to have, Just wanted to ask if i theoretically had a discord bot hosted on about 4 different systems or what not. Would I be able to have it so that when I command was run like !help only one responds? Im just thinking about having insane redundancy terms, no real other reason to do this but its an idea I had.
I know I could have something like "if last message content = the content thats gonna be sent dont send." That would mena that only the fastest bot would respond, but requires feedback from the discord api so in that time another faster instance could have meaningfully sent a repeated message.
reddit but yes
going to be harder to get training data from reddit now though since they banned scraping unless you pay them a lot of money
llm training and all they want a slice of it
if you mean having one bot run across multiple systems then yes discord lets you do that with sharding
you can split your bot across multiple systems with some synchronisation and discord will distribute the servers among them evenly
should i just make it a button?
-# im fixing the NaNms
still using reactions as buttons 🤮
i got bored
you could also make it an ephemeral message
am i doing something wrong? it works when make it react with the emoji but wont work in message
that's not how to send emojis one sec
dumb discord formatted my own message
yeah my message was auto formatted by discord...
its not working tho
try in the title field maybe
remove the \\
yeah or if you want \ before it do \\\\ i think
maybe upload a different app emoji and try with that jsut to see
how would that
just to see if that works
nope..
and doing this doesnt work either
const loading = interaction.client.emojis.cache.get("1337894298615808133");
try await client.application.emojis.fetch()
that's how you get application emojis at least that's how i did it
ok so i see them now
ok i got it work by doing this:
const loading = await interaction.client.application.emojis.fetch("1337894298615808133")
nice
also is this a bad idea? it works
google didn't literally scrape no but they did buy all the data from them.
i also found a way to make it easier to grab app emojis
mine uses something called a pcall so it looks a bit different
oh damn, never knew that sharding worked through multiple hosts too. Pretty interesting, thanks!
mine LOL
dang
i just based my pcall off the lua pcall
Hey everyone, I'm submitting my Discord bot game to top.gg, but the reviewer keeps getting an 'Interaction failed' error when clicking an embed button. The bot has been running fine for over a month with active users. I've tested it in empty servers and had players test in their own servers and everything works. I can't seem to replicate the issue.
It seems related to an interaction timeout, but the reviewer says they clicked the button immediately after the embed appeared. I have the collector timeout set for 10 minutes, so it shouldn't be timing out that fast.
Has anyone encountered something similar or have ideas on what might be causing this?
yeah because essentially each shard is its own connection so you can basically connect from anywhere
you just need to make sure you have some kind of master host or server directing all of these shards otherwise you might run into problems
you probably have a bug somewhere or arent listening for the specific button correctly, discord is usually very reliable when it comes to delivering interaction events
setup lots of logs and try to replicate the bug they are seeing
It's tough because there's not a lot of variables here. There's one command to run and one button to press. I've run that many times before, so have my players and have not been able to replicate it.
There's no required role permissions for slash command button interactions right?
Nope
I'd suggest replicating the test environment.
Create a new server, double check on the specified permissions are given to the everyone role, invite the bot with permissions=0
https://support.top.gg/support/solutions/articles/73000502501-how-the-bot-reviewal-process-works
Why does my bot page say it's "not yet approved"? When you submit your bot, we have a team of volunteers who review your bot to ensure quality and coherence with our guidelines. This process typically takes 1 to 2 weeks or more, but could vary b...
ah I see thanks!
Aw, still not replicating the error in a testing environment that matches what you have there. Only role my bot optionally needs is Manage Role.
Fair, though hqving q master defeats half the exercise since thats back to a single poibt of failure again.
i mean that would be assuming your goal isn't concurrency and more processing power
but it doesn't have to be that way, you just need to work out a system that will work in case a master server goes down
theres tons of different strategies that can be implemented, but the gist of it depends on how important synchronization between systems is to you
you can even choose to handle it extremely gracefully where workers will still continue to work and serve requests and refuse to process stuff that requires synchronization or communication with the master server, and then simply wait for it to go back online and maybe then choose to terminate if the master server is unresponsive for too long
backups as well where workers can fall back to connecting to a backup server if the first one isnt available
ive also seen "sort of" decentralized systems work extremely well, where one of the workers can be promoted to a master server, i think some databases use this approach
interesting, hadn't thought if it that way.
though its late here and I am not entirly able to think of anything at the moment lol
not sure beamNG is supposed to look like that
hay! i have some questions about macro detection for users who farm economy commands. im using behavior-based tracking (timing consistency, reaction time, command looping, slightly randomized timing, session length, randomized input detection). are there better ways to detect macros without false positives?
or maybe more i could be missing?
If people macro they likely have multiple accounts. Looking for constant spikes of the same(or similar) users is a good one.
add some sort of captcha to appear sometimes
im trying to avoid using captchas to keep it as user friendly and not annoying as possible, but its still an idea
Well, any slightly decent macro tool will make all other options futile
Using the timings won't work as they can always randomize delay between usages
i have it detecting those random delays over time
But how do you differentiate between macros and users?
humanity score
...?
lol
Like, a randomized macro and a human have no different between eachother
they do
Well, ig you could check total time spamming, as no human is gonna use commands for 8 hours
you cant tell instantly. but you can over time
Don't think so
Mine managed to have emotes
What's the difference???
emote
😔 Emoji
The latter is an unicode character
The former is a discord thing
Hmm
The latter works cuz u can't reduce an emoji, they're what they are
\😔
Huh, they changed how escaping emojis work
Anyway, when you escape an emoji u get the emoji itself
When u escape an emote you get the name + id mention
Their implementation of embed for some reason disallows emotes in title or footer, but works everywhere else
wrong you actually can
Huh, is it author that can't then?
this was a good idea, i added this and detection for feeder accounts aswell, do you have any other ideas? i think what i have now is good enough for 99.99% of user detection, just wanna make sure
There are 2 fields in the embed that can't have emotes, one is the footer and the other I thought was the title
But it's probably author if they're working on titles
ok dood
just double check next time your helping people so you dont give false information and look like you dont know what your talking about
Let's talk about overreacting
... everything you have said so far has been just plain wrong, i dont think thats overreacting
Except that was the only wrong thing
hay im not going to argue with you, you win
Footer author and field titles I believe
I do something similar and captchas are the easiest way. Give them to people that are more likely / doing more commands.
Idk why you're being so harsh after I said you can't detect macros through timing
Well, not harsh, there's probably a better word for that but I forgor
yes i know, captchas are the easiest, but im trying to avoid using them to make my bot as easy to use as possible
you can. please stop spreading misinformation please
???
Most people can figure out captchas
i said im not going to argue with you, just stop dood please and thank you. i asked for help, not an argument
i know 🙂 and itll be an easy add to my bot, but im going to do my best to avoid using them
i just dont want to use captchas
Another easy ish way I’ve found cheaters is by seeing if they’re doing commands in different server / channel at the same time
Not impossible but highly unlikely if they have a high command consistency
yes that is a good way to, i have that as one of the detections to
I know people who use multiple windows to farm stuff
They often leave the command pasted to use after cooldown is up
But well, in this case there oughta be a delay between each
But at the end of the day captchas are the best tool. If you use your own website for them you can get a lot more data about when they clicked the link etc.
I had some guy using OCR to autostop if a captcha message popped up
By captchas I meant in-discord methods, not sites
Like a scrabbled text image or buttons
Are they not more easily completed by a bot
right now i have these: timing consistency check, reaction time , reward commands pattern , randomized timings , session based farming, exclusive farming, humanity score system, multi account sync farming, money transfer frequency, multi source money transfers, feeder account, and targeted farming
as detections
Does it work?
yes
Then what’s the issue
ive tried multiple different types of macros and its working good so far
It depends, you can make it difficult enough for the OCR to read the text
Did you try bypassing it?
i want to see if anyone else has other ideas for more detections, if im missing something, just want to make sure i have it good as possible
but the only one responding to me, is a dood telling me it wont work hahah
...you really took it personal didn't you

I mean he’s right
There’ll always be someone that beats it
There’s only so much you can do really
There's also the issue of false positives
i just want to make sure i did the best i can
The more strict you make a system, the higher the odds of punishing innocent users
i know
anyone has ever got into this error when starting flutter app? this happens everytime i changed my network, sleep my laptop, after some time, etc. the. way i fix it temporarily is flutter clean && flutter pub get which is kinda annoying since i waited a long time for xcode to build
Reload project
hot reload?
I think so yea
the app is not even loaded yet
@jaunty wing
so you are using docker?
yes
(we use a server management panel to make our life easier, but yes everything is containerised
isn't using docker a bit over kill for a discord bot, especially just a custom instance for a server?
Docker is perfect for something like this
Honestly since I learned a little bit of docker I don’t see why you wouldn’t use it for almost everything unless you’re on like embedded hardware
even on embedded hardware its not the worst
docker is something that literally can run on anything
because of that its a lot easy to make stuff that can run on anything and not have to worry
i have been trying to find a charting library for nodejs, for literally 2h already.
can't find shit....
all charting libs are specifically made for web
chartjs bro, i can't get this shit fucking loaded
Whats going on
let me show you an example
if it looks weird you probably didn’t include the CSS or something
Error [ERR_REQUIRE_ESM]: require() of ES Module
all i fucking want is to create a crypto chart using the chartjs financial library
BUT LITERALLY ALL LIBS TELL ME TO IMPORT
Because you have to import an es module
const { createCanvas } = require("canvas");
const fetch = require("node-fetch");
const { Chart } = require("chart.js");
const { FinancialChart } = require("chartjs-chart-financial");```
i can't as i am not using it in a web interface.
I just created a simple nodejs interface, and want to generate an image using canvas.
Although no library supports fucking charts and nodejs for some reason bro.
Not really cause in most cases it can ensure you're running it the exact way it was intended. Docker can emulate almost all OS environments
like if you really wanted to theres an ubuntu 14 image
lol
I don’t understand what you mean, nodejs is nodejs, there’s not a difference between nodejs “web interfaces” and what you’ve described afaik
You have to set your package.json type to module
To use es6 imports
Node supports the import statement
To import esm packages, you must use the import statement
huh
am i tweaking
like the whole chartjs is created for es6 imports, like for websites etc..
The require however is used in nodejs?
i can't combine chartjs and nodejs.
Like, mix requires and imports in one file..
Yes you can.
You can
You can import es6 modukles in node
with require too
most of the time, and I mean most of the time depending on the module. You can do require('./module').default;
Please tell me if this easy or hard to figure out because I have some guy struggling to understand this as well this next part when I get to it.
THEY KEPT PICKING 6 NUMBERS!
honestly sounds like a skill issue
though to their defense the emebed has way too much information
should put in bold/underline the most useful information
"Numbers picked" is kinda useless, they know what they picked as they sent it
finally working on more rust projects 🔥
It shows ALL numbers picked in order. Overall, thank you. Planning on doing a complete redo of the game itself, but the game board has to stay which is the monofont looking part.
well yeah to be fair whoever reads has a big advantage, so for me it sounds like a skill issue from the user
if it's an isolated case, no need to worry much
I only had a problem from that user. Like the instructions are made to be very clear and I even checked to make sure it was showing up correctly because you know I like to make sure the game is mobile friendly.
yea honestly someone that reads understands it
maybe just make it bold or something, especially for data that changes over time like the amount of numbers to give
not necessarily the first time for 6 numbers, but once it moves to 5 it would be nice
what does this error even referring to 😭 😭 😭 😭 😭 😭 😭 i got it
i tried on different endpoint, it works, even with the same values. asn you can see the request above it, it works
Should I accept this PR? It's incredibly cursed. https://github.com/AmandaDiscord/Heatsync/pull/5?a
see I would agree with that for when its one big bot that is hosted on a vps since if you change providers or what not then it can be easily set up anywhere. but for loads and loads of custom instances doing not much, the over head would probably use more system resouces than the actual bots do.
fair point, but as in the other message resource usage over head. Plus its a discord bot arent they already pretty dynamic in what they can be moved to and set up since most just run on python of javascript?
@radiant kraken you can't define private functions in a file in python?
no
like a lib with a function that shouldn't be used by others
much pain
i'll just double underscore them lmao
same thing
pain
if you want functions then
i'm not sure it's possible
maybe you can exclude them in __init__.py, but never tried it tho
is this private function only used in one file or used throughout the entire library?
i just have __init__
there i have one function which should be usable
and there is like 3 functions that are used by that function
oh and also another file using those 3 functions
3 functions that are used by that function or 3 functions that use that function?
3 functions that are used
hey guys.
So i want to request a chart view of a certain coin on my frontend.
I want my backend to be sending requests to the chart view frontend.
However, how am i possible to security such that only my backend can be sending the requests?
I was thinking about using maybe some sort of verification.. using private keys or something?
or maybe i can set my cors so such taht it only accepts requests from my site, but wouldn't people be able to ip spoof
Isn't this the point of websockets? Do you need 2-way real-time communication?
Usually your backend isn't sending requests to your frontend
private key would probably be the safest method
oh, I mean to auth with the websocket
Ah
like, during handshake
I thought you meant like sending HTTP requests from backend to frontend lol
nah, that'd be awful to work with 
Which honestly wouldn't even be feasible for a client app without configuration due to port forwarding and firewalls and such
how to fix application not respond
either reply, edit or defer
I basically have a telegram bot that is sending requests to my frontend.
My frontend then loads a chart view.
in reality, i may not even need this.
because all it does is display a chart for the users without any api usage.
Docker is a lot more than just "running a bot"
-
The seperate environment means you can control packages and framework versions easily inside them and the container image itself can be swapped out for different versions with just an image name so you don't need to run a bunch of commands or worry about old version conflicts.
-
Docker is also containerised so the network and file system can't access the host machine and can also have read-only file systems and mounted directories which is more secure.
-
You can use docker apps like Poratainer to manage multiple servers and also monitor/health check those services.
-
Docker also lets you set specific environment variables for that service and you can view the logs for it entirely or remote console without the need of running a bunch of screen or service commands.
It's a lot more flexible and secure especially if you're running multiple stuff.
I know what docker is, you miss my point. Because docker is more than just "running a bot" I was saying its a bit unnecessary unless you have a massive bot, or already have other things running on the host using docker so everything is nicely segmented.
personally even if i had a large bot it seems like too much hastle to deal with since I don't use it for anything else.
my segmentation comes from having everything run on its own dedicated pile of crap host.
lol
Docker isnt just segmentation.
I don't use docker much, that's mostly just me being lazy. If I was going to do things right I'd use containers no matter the scale.
I know but the main point is having the "thing" sandboxed and in its own area is the main featre advertised. easy management is just a bonus
Including all the other things i listed
i use docker to run dynamodb locally for testing
whats that?
it's an aws database
Why do you say that docker is a hassle anyway for a large bot?
that is the exact oposite of what i said lol
?
thats just me personally, but me initial comment was to the order of "I only think it makes sence to use docker with a large bot"
you dont need docker if you use an interaction endpoint instead of sockets
and then I added that I just wouldn't do that either
interaction endpoint?
that a new thing?
not really kept up with the times for the last while
It's much more preffered to run everything in docker even if you're running interaction endpoints because it's more secure.
never understood that thing
aws lambda probably uses docker for me
Yeah, lambda uses containers afaik
For example if a malicious package was installed all the damage is controlled in that container they would not have access to your host system
I mean true but thats only an issue if you are running the bot as root
if you run the bot as a user with no perms its pretty much the same
bad take imo
It's better safe to be sorry regardless if you run it as a regular user
hosting anything on your home computers is a security issue. just use the cloud
That's like saying normal windows users accounts can't do damage without admin xD
no its not.... normal windows users still have perms to do stuff
Exactly
like run programs and open files
I said a user with NO perms so the only thing it can do is tun just the bot and thats it
Hackers will take the chance to use those normal permissions to leverage more access or leave malware or access your local network devices
Using a container solves those issues
At that point you're spending just as much time isolating perms and files as you would be making a container 👀
I know that its not a perfect alturnative solution, the best aproche would be to have a properly configured host AND the software to be sandboxed
That's what containers are sandboxes
aws lambda
lol
prboably but at least its not using any more system resources or potentially introducing issues
insert aws bad comment
lol
it even sandboxes your memory to 15 minute intervals
Wait what?
I've never used vps' so i cant comment on whats good or not there
Why do you need to sandbox memory for 15 mins xD
the memory is cleared. no long living memory
The 15-minute limit for AWS Lambda is the maximum amount of time a Lambda function can run before it is forcefully terminated by AWS. This limit is configurable and can be set to any value between 1 second and 15 minutes
ye, thats mostly single use instances
makes sence
most of my requests are <1s
That just means it's slower to startup though and that would also be bad for network sensitive apps like Discord bots xD
i use zig on aws lambda for fast cold starts
on interaction webhooks you dont have nearly as much network sensitivity
how do those work and what are they for?
when i used rust it was too slow so i switched to zig
It would still be enough of a difference rather than just paying $3-$5 flat out to run your bot with no limits
zero downtime is worth it though.
my api accepts 200,000+ requests per month and it's pennies
There isnt really any downtime if you choose a decent host that's not contabo
You're sacrificing performance though really in the end so not good for an api
performance? 👀
you get better performance.
your instance runs anywhere there's an aws server
bruh I just host my bot on my old raspberry pi
crazy to see the other end of the field where people are using enterprise stuff for the same thing
just bigger
You're only hitting 1 concurrent invocation at most 
?
and 0 at least
with sub 500ms response times
Yea not really a good metric then xD
vps cant go to 0
how much does that pi cost to buy and run?
its a pi 2 I got for christmas like 10 years ago
does your lambda scale up automatically?
running cost? probably like 20 quid a year cuz the power in this country is unafordable



