#development

1 messages · Page 267 of 1

wheat mesa
#

Idk, to each their own I suppose

#

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

surreal sage
#

i love when i get a minified react error in production

#

but not in development

wheat mesa
#

but yeah sometimes there's syntax that the minifier doesn't support, depending on the minifier you use

surreal sage
wheat mesa
#

My project at work uses an old ASP.NET jQuery MVC minifier that can't handle destructuring

#

which fucking sucks

surreal sage
#

oops music still playing

#

ignore

wheat mesa
#

solution

#

don't use react

#

yuck

surreal sage
#

solution SHUT THE FUCK UP!!!!!!!!!

wheat mesa
#

real

prime cliff
surreal sage
waxen flame
#

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)

digital swan
#

hetzner

surreal sage
#

get a vps, hetzner, contabo, anything known to be reliable

#

optional: put coolify on it (automated deployments)

waxen flame
#

A quick Google search later revealed their system was shutting it down.

fast marsh
waxen flame
#

Contabo is looking cool so far

lyric mountain
fast marsh
lyric mountain
#

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

waxen flame
#

I'll be looking at reviews after reading that

sharp geyser
#

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

tacit estuary
#

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.

lyric mountain
#

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

frosty gale
#

returns everywhere in my code

#

i would not be able to code without guard clauses because nested if conditions would make me crazy

deft wolf
#

@harsh nova

harsh nova
pearl trail
#

very useful error message™️

sleek cove
#

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?

lyric mountain
#

a port can only be used by one process, discord libs manage shards as individual threads/tasks

sleek cove
#

Hence my question

lyric mountain
#

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

sleek cove
#

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

lyric mountain
#

they're separate things

#

shards are shards, webhook is webhook

#

your bot will be in one port, the vote api will be in another

sleek cove
#

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?

digital swan
#

Broadcasteval

#

Or you could create a webhook on the channel

sleek cove
#

Ok i try

lyric mountain
#

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

sleek cove
#

I don't understand everything you're saying because I'm French, but I think you're talking nonsense.

lyric mountain
#
TopGG --(vote event)--> Your API --(notify)--> Bot
#

the bot process then sends the notification in the correct channel

sleek cove
#

Did I not mention the api?

lyric mountain
#

you'll need one

#

you cant receive http requests without one

#

if you use topgg library then that's the api

quartz kindle
#

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

sharp geyser
#

you're welcome

#

:)

sleek cove
sharp geyser
#

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)

sleek cove
sharp geyser
#

maybe im missing something here

quartz kindle
#

you should have a sharding manager

#

like index.js

sleek cove
quartz kindle
#

where you have new ShardignManager

#

so put the webhook the sharding manager file

sharp geyser
#

hello tim

quartz kindle
#

hai

#

ayayron

neon leaf
#

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)

quartz kindle
#

whats the content of the json?

neon leaf
#
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]
    }]
])
sharp geyser
#

ar nude

quartz kindle
#

:^)

neon leaf
#

elaborate

quartz kindle
#

lemme get home first

sharp geyser
#

Tim currently walking through the Brazilian jungle to his humble abode

quartz kindle
#

nah just sitting in a bar having a beer

sharp geyser
#

Wahhh

#

Tim drinking?

quartz kindle
#

chsllenging myself to do things i never do

#

typical post-heartbreak behavior

sharp geyser
#

We need to find you a new girl tim

quartz kindle
#

find me a gamer gurl who plays league

sharp geyser
#

Oh god

#

Easy

quartz kindle
#

she needs to be cute tho

#

and not a psychopat

lyric mountain
quartz kindle
#

most gamer gurls have mental issues

sharp geyser
#

I swear the hype died quick

lyric mountain
#

it is, some days we get slow queues but usually it's a few seconds to find a game

quartz kindle
neon leaf
#

🤔

#

how

#

I even did some optimizations and im still at 99 bytes

lyric mountain
#

no, we ain't gonna get into another contest for best X algorithm

neon leaf
#

hell yes we are

#

not sure if it also applies to tims thingy but nothing in my encoder can go over length 255

quartz kindle
#

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
...

quartz kindle
#

then you're wasting some space somewhere

lyric mountain
#

inb4 u encoded the tabs

neon leaf
#
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])
    }
}
quartz kindle
#

you have type and length as separate bytes

neon leaf
#

ah

quartz kindle
#

byte1 = type string
byte2 = length 5

#

i put them both together

neon leaf
#

hmm

#

I guess

quartz kindle
#

ie 0b00000101
type string as 0000 and length 5 as 0101

neon leaf
#

but that would make the string limit even smaller, no?

quartz kindle
#

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

neon leaf
#

mmmm

quartz kindle
#

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

wheat mesa
quartz kindle
#

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

wheat mesa
wheat mesa
#

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

quartz kindle
#

from what i can see, huffman coding requires you to read the string first to gather info

lyric mountain
#

is that the one where AAAAABBBCCCCCCCCCCDDDDDD becomes A05B03C10D06?

wheat mesa
#

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)

quartz kindle
#

goes against my performance goals

prime cliff
#

vibecat Yay got permission overrides fully working for all resource types and specific permissions for roles, members and api client.

earnest phoenix
#

14 ci: Fix commits later

sharp geyser
#

@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

solemn latch
#

If you use database I think so, yeah. I'll have to look

pearl trail
#

at this point, this prettier asks me to rebuild everything 💀

covert gale
sleek bear
#

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 TakinaThink

quartz kindle
#

you mean this?

#

or this?

sleek bear
quartz kindle
# sleek bear 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

sleek bear
quartz kindle
#

what does your developer portal say?

quartz kindle
#

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.

lyric mountain
#

lul so it is basically trading usage data for a badge

pearl trail
#

hello developers, i want to ask your opinion, do you prefer use yaml config or env for dockerized C# project's configurations?

sleek bear
#

thats why i said i waited 2 days since they stated it takes at least 24h lol2

lament rock
quartz kindle
#

json > *

#

:^)

pearl trail
vocal knot
small tangle
frosty gale
#

early verified developer badge is where its at

quartz kindle
small tangle
#

Damn

frosty gale
small tangle
#

Badge diff

frosty gale
#

chloe's elite economy bot simply never took off

small tangle
#

Even though its so elite? Sad

sharp geyser
frosty gale
sharp geyser
#

I cant imagine why sounds like an amazing bot

frosty gale
#

wouldnt know whats good for them even if it was waved under their nose

small tangle
#

Chloe was ahead of her time, they didnt see the vision

small tangle
sharp geyser
#

hm?

small tangle
#

You have your old profile picture again :D

quartz kindle
#

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

small tangle
#

You got this peepoFlower

deft wolf
pearl trail
# small tangle Why not use the appsettings.json for that?

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

small tangle
#

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

earnest phoenix
#

docker containers for these are likely super slow

#

if it even has any stable one

delicate zephyr
#
  1. It's stable enough that if you have a decent enough PC they wont crash randomly
earnest phoenix
#

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..

prime cliff
#

Woooo got fully working permission overwrites for my project just like Discords but with an extra category for api clients 🙂

sharp geyser
#

Good job

vocal knot
#

i would have never expected my bot to make it to corsair's discord server LOL

stark abyss
#

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

surreal sage
#

aint nothing like having gpt make gh workflows for you (pain and suffering)

prime cliff
#

Why not dont use gpt KEKW

earnest phoenix
#

Website's not mobile friendly, but something to do with Bluesky

#

Likely sending your Bluesky posts in Discord

bitter granite
earnest phoenix
#

multipurpose bot moment

harsh nova
#

Don't remember a single multi purp bot

bitter granite
harsh nova
bitter granite
#

its no longer at the site thou i think

harsh nova
#

Yeah it wasn't yours I approved but sounds like a cool bot!

bitter granite
bitter granite
#

almost no other new bot

#

If i have time ill update it so it connect to teamspeak too

lyric mountain
#

people still use teamspeak?

bitter granite
#

We use it for meeting and stuff (not topgg)

deft wolf
bitter granite
#

So one call is with client and another is for the team

earnest phoenix
#

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.

bitter granite
earnest phoenix
#

have/had ts 5 beta but never really used the new features

bitter granite
#

The only down side is

#

The mobile app is paid

deft wolf
#

You can still crack it no? kappalul

earnest phoenix
#

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

bitter granite
deft wolf
#

#2 top paid 💪

bitter granite
bitter granite
deft wolf
#

What the fuck is Threema FeelsWeirdManW

#

Am I living under the rock or something

bitter granite
# deft wolf What the fuck is `Threema` <:FeelsWeirdManW:970083362091974746>

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

deft wolf
#

Sounds like Telegram for me kappalul

bitter granite
deft wolf
#

Let's be honest, all these messengers look similar

bitter granite
earnest phoenix
neon leaf
#

when 51$ gift

earnest phoenix
#

It's encrypted and swiss x)

deft wolf
#

It is paid

quartz kindle
earnest phoenix
#

the servers and data laws

#

not in EU garbage

quartz kindle
#

xD

earnest phoenix
#

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

quartz kindle
#

what about session? i never use it but i have it installed, its pretty good privacy wise

earnest phoenix
#

or discord's "voice encryption"

earnest phoenix
quartz kindle
#

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

vocal knot
bitter granite
vocal knot
#

i think so yeah

#

also people keep telling me mine is way better than the others

pine willow
deft wolf
#

Forward posts from bluesky to discord channel

pine willow
deft wolf
#

It's something like twitter

pine willow
#

Most likely a chat platform?

pine willow
#

thats cool

deft wolf
#

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 kappalul

vocal knot
#

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

untold vortex
#

hello sir i got an error how to solve?

pine willow
#

npm i topggcard ???

untold vortex
#

not working

pine willow
#

¯_(ツ)_/¯

untold vortex
pine willow
#

My bot does that automatic

untold vortex
#

ohh ok

pine willow
untold vortex
#

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

pine willow
#

a random string you create

#

that verifys requests

untold vortex
#

like how to create?

pine willow
#

🤦‍♂️

#

just type in a random string

untold vortex
untold vortex
pine willow
untold vortex
#

ohh ok

untold vortex
# pine willow ....
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?
pine willow
#

Do I know how your code looks like??

#

You are the developer

untold vortex
pine willow
#

No I dont.

untold vortex
#

uhh?

pine willow
#

How should I know your code??

untold vortex
#

ah ok

vocal knot
#

you should try this magic tool: https://google.com @untold vortex

bitter granite
#

yeah...

vocal knot
vocal knot
#

then in the bot you put the same authorization

deft wolf
#

But you don't have an approved bot on top.gg right?

vocal knot
#

could it be because it's under a team and you're the moderator of it not owner?

deft wolf
bitter granite
vocal knot
#

oh LOL i didn't realize that LOL

i need coffee

bitter granite
quartz kindle
vocal knot
#

i just put my french press in the fridge instead of the milk

long marsh
#

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

wheat mesa
#

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

long marsh
#

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?

wheat mesa
#

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

quartz kindle
#

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

tacit estuary
# untold vortex uhh?

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.

deft wolf
quartz kindle
pearl trail
vocal knot
#

and haven't hit any ratelimit

long marsh
vocal knot
#

also i think once your bot is verified the ratelimits are a bit more forgiving

long marsh
frosty gale
#

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

vocal knot
quartz kindle
vocal knot
deft wolf
#

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 masnakappa

quartz kindle
#

yeah pretty sure they only increase your limits if your use case really needs them

earnest phoenix
#

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

frosty gale
#

you have to write poopoo code to hit them anyways

#

a lot of the devs here are pretty good at that though

quartz kindle
deft wolf
#

I can't believe it, it's ruining my whole worldview

long marsh
crisp crown
#

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 ?
vocal knot
crisp crown
#

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

vocal knot
#

nvm it says to use the one you already have

#

can you show when client is set first

crisp crown
#
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
vocal knot
#

did you set the topgg api key?

crisp crown
#

yup

vocal knot
#

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

crisp crown
#
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
crisp crown
# vocal knot also what's in ClientLogin
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)));
    });
}```
vocal knot
crisp crown
#

idk

#

in an other bot

#

it works

wheat mesa
#

Check your package.json file

#

What does it say as the version for discord.js

crisp crown
#

"discord.js": "^14.17.3",

#

i dont understand fr thats wierd asf

wheat mesa
vocal knot
#

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

crisp crown
#

ty very much guys

#

i'll try it

#

tomorow

#

i'll sleep rn

#

have a nice night

neon leaf
#

in a modal, how can I edit the original message that has the button that triggered the modal? (same as interaction.update on buttons)

pearl trail
#

what lib

neon leaf
#

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)```
pearl trail
#

how about <ModalSubmitInteraction>.message.edit ?

neon leaf
#

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)```
vocal knot
#

it should work for you

neon leaf
vocal knot
#

cuz you made it create a reply somewhere

#

so it edits the last one

neon leaf
#

yeah, deferReply creates one

vocal knot
#

you need to use that and edit it but somewhere in your code you create a new ephemeral msh

#

msg

neon leaf
#

I used what you sent

vocal knot
#

cuz it's what i do for one of my commands as a confirm prompt

neon leaf
#
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()```
vocal knot
#

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: []
    });
})
neon leaf
#

I think I found the issue, im using the wrong type for my modal interactions

#

it mentions the update() method

#

yep, that works

deft wolf
#

Lesson for today: check the documentation carefully noted

quartz kindle
#

and in case of doubt: yell kurwa jebana

deft wolf
#

I have never yelled while writing code, but I have questioned the meaning of life kappalul

vocal knot
pearl trail
#

yeah metal is heavy, i agree

deft wolf
prime cliff
queen needle
#

How come there isn't a sorting algorithm with a time complexity less than O(n * logn)? Is that even possible?

wheat mesa
#

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

surreal sage
#

i love when companies forget spf/dmarc records

#

and then get their shit spoofed for spam mail

lyric mountain
#

then there's the theoretical best case of bead sort which is O(1)

#

but it's impossible to implement digitally

lyric mountain
#

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

scenic kelp
#

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

lyric mountain
#

correct, blame gravity

scenic kelp
#

therefore we should run our computers on planets with higher gravity to improve performance

lyric mountain
#

supercondutors are possible at room temperature in neptune

#

imagine all the ghz you'd gain

neon leaf
#

not many with modern x86 processors

#

transistors so tiny, at a point the voltage will pass through the transistors completely

eternal osprey
#

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;
proven lantern
frosty gale
#

why should i bro

#

if i post this here people will send me money aah

earnest phoenix
#

@solemn latch is interested

solemn latch
#

I sent what i could

earnest phoenix
#

goodgood

frosty gale
#

to be fair he didnt do anything wrong other than misusing the channel maybe

eternal osprey
#

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

lyric mountain
#

I'll never touch react again, not even with a pole

solemn latch
#

classic

frosty gale
# lyric mountain

using other web frameworks makes you realise how convoluted and heavy react is

wooden ember
#

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?

deft wolf
#

Not really

#

Newest node.js is v22 and newest discord.js is v14 afaik

wooden ember
#

i'm still on node v16 and d.js 13

stiff dust
#

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?

deft wolf
#

Have you tried to ask on their support server?

sage bobcat
#

One message removed from a suspended account.

stiff dust
quartz kindle
#

but yeah 22 is LTS

vocal knot
elfin helm
#

The custom profile, name, etc are all done by the user on the developer portal

spark flint
#

^

#

then its the same source code but deployed under a different token

#

likely just a docker container etc

deft wolf
#

So it's exactly the same system as all these "cheap" hosting sites kappalul

vocal knot
vernal latch
#

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

stark grail
#

does anyone knows how this works?

#

status disappeared

deft wolf
#

Bots that have no connection with gateway have no status afaik

solemn latch
fossil coyote
#

Any way to get top.gg to reflect my bot's avatar change?

vocal knot
fossil coyote
#

Got it

#

Thanks

vocal knot
#

np

#

yuck (someone who uses my bot) to post ai slop to discord

i hate generative ai

prime cliff
#

vibecat With asp.net blazor SSR i can trigger server events to update the notification badge and list instantly too

solemn latch
#

👀

vocal knot
#

been doing a thing

solemn latch
#

very shadcn

#

;p

vocal knot
#

LOL

#

i hate html and css too much to do it all KEKW

solemn latch
vocal knot
#

lol

solemn latch
#

It even wrote the form action

vocal knot
#

erm it forgot the add new feed

#

JK LOL

solemn latch
#

I never asked it for that 😄

vocal knot
#

ik LOL

solemn latch
#

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 😄

sage bobcat
#

One message removed from a suspended account.

hidden gorge
#

is there a reason why .gitignore wont ignore .env's?

wheat mesa
#

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

hidden gorge
hidden gorge
#

i also feel like this is redundant

sharp geyser
#

Why is it redundant

proven lantern
#

my api docs look so nice

untold vortex
deft wolf
#

You can't anymore

bitter granite
gilded plankBOT
#

@untold vortex

Servers have been removed as they were getting harder to moderate. For more info, please read: #announcements message

frosty gale
#

im not a fan of that argument there has to be another motive

#

thats like youtube removing comments because they cant moderate them properly

deft wolf
#

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

frosty gale
#

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

real rose
#

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

delicate zephyr
#

People like ignoring rules :^)

#

especially if there's no quick auto-flagging

solemn latch
#

AI Auto flagging when?!? ^-^

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sharp geyser
#

Didn't google's ai tell people to off themselves?

#

I think it was google, but I might be wrong

solemn latch
#

The number of gateway servers was wild, hundreds per day

sage bobcat
#

One message removed from a suspended account.

frosty gale
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

ancient lily
#

z

wooden ember
deft wolf
#

Readit?

wooden ember
#

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.

frosty gale
#

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

frosty gale
#

you can split your bot across multiple systems with some synchronisation and discord will distribute the servers among them evenly

deft wolf
hidden gorge
#

should i just make it a button?

-# im fixing the NaNms

frosty gale
#

still using reactions as buttons 🤮

hidden gorge
vocal knot
hidden gorge
#

am i doing something wrong? it works when make it react with the emoji but wont work in message



vocal knot
#

that's not how to send emojis one sec

hidden gorge
#

dumb discord formatted my own message

hidden gorge
vocal knot
#

it's like this <:name:id>

#

like this

#

ohhh

hidden gorge
#

its not working tho

vocal knot
#

try in the title field maybe

neon leaf
vocal knot
#

yeah or if you want \ before it do \\\\ i think

neon leaf
#

no

#

having a \ before an emoji escapes it

vocal knot
#

ik

#

but \\ escapew each other

hidden gorge
#

en still

#

even*

vocal knot
#

maybe upload a different app emoji and try with that jsut to see

hidden gorge
#

how would that

vocal knot
#

just to see if that works

hidden gorge
#

and doing this doesnt work either

 const loading = interaction.client.emojis.cache.get("1337894298615808133");
vocal knot
#

that's how you get application emojis at least that's how i did it

hidden gorge
#

ok i got it work by doing this:

const loading = await interaction.client.application.emojis.fetch("1337894298615808133")
vocal knot
#

nice

hidden gorge
#

also is this a bad idea? it works

wooden ember
hidden gorge
#

mine uses something called a pcall so it looks a bit different

wooden ember
hidden gorge
hidden gorge
lost forge
#

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?

frosty gale
#

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

frosty gale
#

setup lots of logs and try to replicate the bug they are seeing

lost forge
#

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?

solemn latch
#

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

lost forge
#

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.

wooden ember
frosty gale
#

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

wooden ember
#

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

cyan basin
#

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?

solemn latch
lyric mountain
#

nor footer

#

everything else can

lyric mountain
cyan basin
lyric mountain
#

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

cyan basin
lyric mountain
#

But how do you differentiate between macros and users?

cyan basin
#

humanity score

lyric mountain
#

...?

cyan basin
#

lol

lyric mountain
#

Like, a randomized macro and a human have no different between eachother

cyan basin
#

they do

lyric mountain
#

Well, ig you could check total time spamming, as no human is gonna use commands for 8 hours

cyan basin
#

you cant tell instantly. but you can over time

lyric mountain
#

Don't think so

cyan basin
#

ok

#

thanks for your help

hidden gorge
lyric mountain
#

Emote or emoji?

#

Emoji can be used, emotes can't

#

They always become text

hidden gorge
lyric mountain
#

KEKW emote

#

😔 Emoji

#

The latter is an unicode character

#

The former is a discord thing

hidden gorge
#

Hmm

lyric mountain
#

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

vocal knot
lyric mountain
#

Huh, is it author that can't then?

cyan basin
#

jesus christ

cyan basin
lyric mountain
# cyan basin jesus christ

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

cyan basin
#

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

lyric mountain
#

Let's talk about overreacting

cyan basin
#

... everything you have said so far has been just plain wrong, i dont think thats overreacting

lyric mountain
#

Except that was the only wrong thing

cyan basin
#

hay im not going to argue with you, you win

digital swan
#

Footer author and field titles I believe

digital swan
lyric mountain
#

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

cyan basin
cyan basin
lyric mountain
#

???

digital swan
cyan basin
#

i said im not going to argue with you, just stop dood please and thank you. i asked for help, not an argument

cyan basin
#

i just dont want to use captchas

digital swan
#

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

cyan basin
#

yes that is a good way to, i have that as one of the detections to

lyric mountain
#

They often leave the command pasted to use after cooldown is up

#

But well, in this case there oughta be a delay between each

digital swan
#

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

lyric mountain
#

By captchas I meant in-discord methods, not sites

#

Like a scrabbled text image or buttons

digital swan
#

Are they not more easily completed by a bot

cyan basin
#

as detections

digital swan
#

Does it work?

cyan basin
#

yes

digital swan
#

Then what’s the issue

cyan basin
#

ive tried multiple different types of macros and its working good so far

lyric mountain
lyric mountain
cyan basin
#

but the only one responding to me, is a dood telling me it wont work hahah

lyric mountain
#

...you really took it personal didn't you

cyan basin
digital swan
#

I mean he’s right

#

There’ll always be someone that beats it

#

There’s only so much you can do really

cyan basin
#

of course, its not perfect, i didnt say it would be

#

captchas would be the same

lyric mountain
#

There's also the issue of false positives

cyan basin
#

i just want to make sure i did the best i can

lyric mountain
#

The more strict you make a system, the higher the odds of punishing innocent users

cyan basin
#

i know

pearl trail
#

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

sharp geyser
#

Reload project

pearl trail
#

hot reload?

sharp geyser
#

I think so yea

pearl trail
#

the app is not even loaded yet

errant ore
#

@jaunty wing

vernal latch
#

(we use a server management panel to make our life easier, but yes everything is containerised

wooden ember
#

isn't using docker a bit over kill for a discord bot, especially just a custom instance for a server?

wheat mesa
#

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

sharp geyser
#

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

eternal osprey
#

i have been trying to find a charting library for nodejs, for literally 2h already.

#

can't find shit....

sharp geyser
#

huh

#

theres so many

eternal osprey
#

all charting libs are specifically made for web

#

chartjs bro, i can't get this shit fucking loaded

sharp geyser
#

Whats going on

eternal osprey
#

let me show you an example

wheat mesa
#

if it looks weird you probably didn’t include the CSS or something

eternal osprey
#

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

wheat mesa
#

Because you have to import an es module

eternal osprey
#
const { createCanvas } = require("canvas");
const fetch = require("node-fetch");
const { Chart } = require("chart.js");
const { FinancialChart } = require("chartjs-chart-financial");```
eternal osprey
# wheat mesa Because you have to import an es module

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.

delicate zephyr
#

like if you really wanted to theres an ubuntu 14 image

#

lol

wheat mesa
#

You have to set your package.json type to module

#

To use es6 imports

lament rock
#

To import esm packages, you must use the import statement

eternal osprey
#

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..

lament rock
#

Yes you can.

delicate zephyr
#

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;

tacit estuary
#

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!

earnest phoenix
#

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

neon leaf
#

finally working on more rust projects 🔥

tacit estuary
earnest phoenix
#

if it's an isolated case, no need to worry much

tacit estuary
earnest phoenix
#

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

pearl trail
#

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

lament rock
wooden ember
wooden ember
earnest phoenix
#

@radiant kraken you can't define private functions in a file in python?

radiant kraken
#

no

earnest phoenix
#

like a lib with a function that shouldn't be used by others

#

much pain

#

i'll just double underscore them lmao

radiant kraken
earnest phoenix
#

not but like in a lib

#

no class whatsoever

radiant kraken
#

same thing

earnest phoenix
#

pain

radiant kraken
#

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

earnest phoenix
#

haven't seen anything

#

there's just that __all__

#

but that's when importing *

radiant kraken
#

is this private function only used in one file or used throughout the entire library?

earnest phoenix
#

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

radiant kraken
#

3 functions that are used by that function or 3 functions that use that function?

earnest phoenix
#

3 functions that are used

eternal osprey
#

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

wheat mesa
#

Usually your backend isn't sending requests to your frontend

lyric mountain
#

private key would probably be the safest method

wheat mesa
#

Still seems like the wrong approach

#

I'd opt for websockets if you need 2-way comms

lyric mountain
#

oh, I mean to auth with the websocket

wheat mesa
#

Ah

lyric mountain
#

like, during handshake

wheat mesa
#

I thought you meant like sending HTTP requests from backend to frontend lol

lyric mountain
#

nah, that'd be awful to work with KEKW

wheat mesa
#

Which honestly wouldn't even be feasible for a client app without configuration due to port forwarding and firewalls and such

covert silo
#

how to fix application not respond

lyric mountain
#

either reply, edit or defer

eternal osprey
#

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.

prime cliff
# wooden ember isn't using docker a bit over kill for a discord bot, especially just a custom i...

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.

wooden ember
#

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

solemn latch
#

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.

wooden ember
#

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

prime cliff
#

Including all the other things i listed

proven lantern
#

i use docker to run dynamodb locally for testing

wooden ember
#

whats that?

proven lantern
#

it's an aws database

prime cliff
#

Why do you say that docker is a hassle anyway for a large bot?

wooden ember
#

that is the exact oposite of what i said lol

wooden ember
#

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"

proven lantern
#

you dont need docker if you use an interaction endpoint instead of sockets

wooden ember
#

and then I added that I just wouldn't do that either

wooden ember
#

that a new thing?

#

not really kept up with the times for the last while

prime cliff
#

It's much more preffered to run everything in docker even if you're running interaction endpoints because it's more secure.

proven lantern
wooden ember
#

never understood that thing

proven lantern
#

aws lambda probably uses docker for me

solemn latch
#

Yeah, lambda uses containers afaik

prime cliff
#

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

wooden ember
#

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

solemn latch
#

bad take imo

prime cliff
#

It's better safe to be sorry regardless if you run it as a regular user

proven lantern
#

hosting anything on your home computers is a security issue. just use the cloud

prime cliff
#

That's like saying normal windows users accounts can't do damage without admin xD

wooden ember
#

no its not.... normal windows users still have perms to do stuff

prime cliff
#

Exactly

wooden ember
#

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

prime cliff
#

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

solemn latch
#

At that point you're spending just as much time isolating perms and files as you would be making a container 👀

wooden ember
#

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

prime cliff
#

That's what containers are sandboxes

solemn latch
#

lol

wooden ember
solemn latch
#

😄

prime cliff
#

insert aws bad comment

wooden ember
#

lol

proven lantern
#

it even sandboxes your memory to 15 minute intervals

prime cliff
#

Wait what?

wooden ember
#

I've never used vps' so i cant comment on whats good or not there

prime cliff
#

Why do you need to sandbox memory for 15 mins xD

wooden ember
#

program runns very fast?

#

lol

proven lantern
#

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

wooden ember
#

1 second

#

lol

solemn latch
#

ye, thats mostly single use instances

wooden ember
#

makes sence

proven lantern
prime cliff
#

That just means it's slower to startup though and that would also be bad for network sensitive apps like Discord bots xD

proven lantern
solemn latch
#

on interaction webhooks you dont have nearly as much network sensitivity

wooden ember
#

how do those work and what are they for?

proven lantern
#

when i used rust it was too slow so i switched to zig

prime cliff
#

It would still be enough of a difference rather than just paying $3-$5 flat out to run your bot with no limits

solemn latch
#

zero downtime is worth it though.

proven lantern
#

my api accepts 200,000+ requests per month and it's pennies

prime cliff
#

There isnt really any downtime if you choose a decent host that's not contabo

prime cliff
solemn latch
#

performance? 👀

#

you get better performance.

#

your instance runs anywhere there's an aws server

proven lantern
wooden ember
#

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

prime cliff
#

You're only hitting 1 concurrent invocation at most Thonk

wooden ember
#

?

proven lantern
#

with sub 500ms response times

prime cliff
#

Yea not really a good metric then xD

proven lantern
#

vps cant go to 0

proven lantern
wooden ember
#

its a pi 2 I got for christmas like 10 years ago

solemn latch
wooden ember
#

running cost? probably like 20 quid a year cuz the power in this country is unafordable