#development

1 messages · Page 210 of 1

solemn latch
#

Thats the permission discord says to give

wary totem
#

i have it

#

i'm really embarrassed

solemn latch
#

I'll goof around with it for a bit, I've not played around with discord bots in awhile so I cant remember exactly what permission it is

wary totem
lyric mountain
#

just as a tip, u can set the perm on discord for the bot role and use "view server as role" to see what the bot'll be able to do

#

flip switches till you can manage channel permissions through it

wary totem
#

😮

lyric mountain
#

this way u dont need to reinvite the bot everytime to test what perm u need

wary totem
lyric mountain
#

yes, view server as role and flip the perms till you can

#

the last perm u flip will be the one you need

solemn latch
#

It shouldnt be admin, admin essentially means 'all other perms'

lyric mountain
#

all other perms + ignore overrides

wary totem
solemn latch
#

I've been a mod here for 3 and a half years and have never seen a bot need admin

wary totem
#

cause with all perms my bot hasn't this perm

solemn latch
#

Which role does your bot have? 👀

wary totem
#

his own role

#

the managed

solemn latch
#

and test is the one its modifying?

wary totem
#

no

#

it's me

solemn latch
#

are you the owner of the server?

wary totem
#

yes

#

the video

#

where i test

#

you see, the bot needs admin

solemn latch
#

So you want to set other users to edit permissions of the channel via the bot?

#

In your code you're not setting that option at all

wary totem
#

no, the bot should simply ban the channel to everyone and create exemptions for players with the specific role in the channel

real rose
#

So you just need a combination of the permissions

#

you need to find the right combo

wary totem
#

please

solemn latch
#

It looks like you can edit those permissions at 33 seconds right, the one you hover over is just to allow other users to change permissions of the channel.

wary totem
solemn latch
#

Figured one way to do it.
When you create the channel you can edit all these permissions freely

  const channel = await guild.channels.create({
    name: "test",
    permissionOverwrites: [
      {
        id: User Or Role ID,
        allow: [
          PermissionsBitField.Flags.ViewChannel,
          PermissionsBitField.Flags.SendMessages,
         PermissionsBitField.Flags.ReadMessageHistory,
        ],
      },
      {
        id: User Or Role ID,
        deny: [
          PermissionsBitField.Flags.ViewChannel,
          PermissionsBitField.Flags.SendMessages,
          PermissionsBitField.Flags.ReadMessageHistory,
        ],
      },
    ],
  });
wary totem
solemn latch
#

intresting, my bot only has manage channels and it works fine.

wary totem
solemn latch
#

Did you try setting the permissions when you create the channel?

wary totem
#

yeah

#

in the CreateOptions

solemn latch
wary totem
#

both

solemn latch
#

both?

wary totem
#

i tried the both

solemn latch
#

Sadly I'm out of time today to help 😦

wary totem
urban delta
#

okay so, i got an idea for what i do with implementing languages in my macros language, and i'm planning to have a init folder to get the package

#

get the package in a function

#

and have a file with their names in, so i can get the transformer and the neutral class

#

have no idea how to load the modules

#

but i need to load them twice

#

like the non transformer version

#

and the transformer version

#

altogether

lyric mountain
#

the ONLY explanation for admin working and all perms not, is that you have an override

#

as that's the only thing admin has over all perms

urban delta
#

what did i didn't imported from Macro class?

lyric mountain
#

pass self to it

#

self=whatever

#

no idea what it's supposed to be tho

wheat mesa
#

I think your issue is that a static function shouldn’t need a self parameter, that’s the point

#

Either that or you’re trying to use a member function in a static context, which is also wrong

lyric mountain
#

can a static function even have a "self"?

#

like, there's no instance to be called a self

#

ah nvm, misread ur comments

frosty gale
#

since the whole point of static is to not have a class instance associated with it anyways

#

the equivalent of lying to the compiler lol

eternal osprey
#
PM2            | App [OfferteApi:22] exited with code [1] via signal [SIGINT]
PM2            | App [OfferteApi:22] starting in -fork mode-
PM2            | App [OfferteApi:22] online
22|OfferteApi  | Error: listen EADDRINUSE: address already in use :::8443
22|OfferteApi  |     at Server.setupListenHandle [as _listen2] (node:net:1751:16)
22|OfferteApi  |     at listenInCluster (node:net:1799:12)
22|OfferteApi  |     at Server.listen (node:net:1887:7)
22|OfferteApi  |     at Object.<anonymous> (/root/site/offerte.js:286:13)
22|OfferteApi  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
22|OfferteApi  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
22|OfferteApi  |     at Module.load (node:internal/modules/cjs/loader:1119:32)
22|OfferteApi  |     at Module._load (node:internal/modules/cjs/loader:960:12)
22|OfferteApi  |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
22|OfferteApi  |     at Module._compile (node:internal/modules/cjs/loader:1256:14) {
22|OfferteApi  |   code: 'EADDRINUSE',
22|OfferteApi  |   errno: -98,
22|OfferteApi  |   syscall: 'listen',
22|OfferteApi  |   address: '::',
22|OfferteApi  |   port: 8443```

hey guys how the fuck do i fix this
frosty gale
#

try kill the app running on that port and try again

eternal osprey
#

yah i know, i killed it like a minute ago

#

but it still returns the same error

lyric mountain
eternal osprey
#

I see

#

But ehh how can I fix it now

lyric mountain
#

else there are some cases when a process dies but still somehow hold the port's lock

lyric mountain
#

kill -9 $(lsof -t -i:port)

eternal osprey
#

i did

#

but i am still waiting with the same error

#

eventhough it's 100% dead

urban delta
#

okay so, i need to know how to access the classes

#

have no idea how to do it

lyric mountain
#

and use reuseaddr from now on

frosty gale
#

it shouldn't happen but it does

#

kernel should figure out after a bit of time the port is free though

#

but no one has time for that

#

there's usually a lot of complex dependencies and reliances in place so kernel can't just go "if program exited, free port"

earnest phoenix
#

i am senior full stack & blockchain & AI developer.
I have enough experience of developing website, dApps and AI project.
Is there anyone looking for a dev?

eternal osprey
#

a senior full stack dev wouldn't try to find jobs through dc

#

apply for a fucking job bro what you doing

spark flint
#

No web3 jobs is going to use a real job site

#

because most are scams and rugpulls

pearl trail
#

blockchain?

eternal osprey
#

they scared of working for a honeypot company

spark flint
#

does anyone know any good js sandboxes

#

i'm trying to make a feature that lets people code their own plugins, but i only want them to be able to access the context given to them

sharp geyser
#

not sure if it will work for you

spark flint
#

i was trying to find it

#

i forgo

sharp geyser
#
spark flint
#

either that or i use dockeer

#

ah nice

#

or cloudflare workers as a service

sharp geyser
#

whatever works best for ya

spark flint
#

tbh not sure

#

the code will run remotely on a vps that has no access to any other data at all

#

just to be safe

sharp geyser
#

use docker then

#

docker can be made to be completely isolated from the system iirc

spark flint
#

yes

sharp geyser
#

you could even use kubernetes and spawn small servers /joke

spark flint
#

hm i'll have a play around

#

lol

#

it can access filesystem apparently

sharp geyser
#

run that in docker

#

😏

#

Also wait

#

@radiant kraken its a sandbox

#

why can it access the filesystem

spark flint
#

can't get users anyways

sharp geyser
#

kinda strange it can access teh fs tho

#

its supposed to be sandboxed

#

Oh

spark flint
sharp geyser
#

I guess tio allows you to access the fs its running on

spark flint
#

would make sense

spark flint
#

welp got a working example

#

you define the post handler and do whatever you want

#

and you can get the full post object with .toJSON()

#

not working with Tio tho

#

hm doesn't support ?.

#

removed and it worked

sharp geyser
#

can I see the full source code if you dont mind

#

cause I want to try it myself

#

that ?. should work

spark flint
#
import tio from 'tio.js'

const evalCode = async () => {
    const response = await tio(`
class Post {
    constructor(obj) {
        this.postObj = {
            id: obj.id || '',
            title: obj.title || '',
            content: obj.content || '',
            tags: obj.tags || [],
            files: obj.files || [],
            user: obj.user || {},
            createdAt: obj.createdAt || '',
            updatedAt: obj.updatedAt || '',
            commentCount: obj.commentCount || 0,
            upvotes: obj.upvotes || 0,
            comments: obj.comments || []
        }
    }

    getId() {
        return this.postObj.id;
    }

    getTitle() {
        return this.postObj.title;
    }

    getContent() {
        return this.postObj.content;
    }

    getTags() {
        return this.postObj.tags;
    }

    getFiles() {
        return this.postObj.files;
    }

    getUser() {
        return this.postObj.user;
    }
    
    getCreationDate() {
        return this.postObj.createdAt;
    }

    getUpvotes() {
        return this.postObj.upvotes;
    }

    getComments() {
        return this.postObj.comments;
    }

    toJSON() {
        return this.postObj;
    }
}

const post = new Post({
    "id": "67b8cc16-4525-4278-a93b-f2d1ee0e6008",
    "title": "testtest",
    "content": "est",
    "tags": [],
    "files": [
        {
        "name": "Background (9).png",
        "hash": "7391c6c4239fbf5c947e0611b4bf46b859282100c0f19cc51020c109c68083be",
        "cdnPath": "posts/67b8cc16-4525-4278-a93b-f2d1ee0e6008/7391c6c4239fbf5c947e0611b4bf46b859282100c0f19cc51020c109c68083be.png",
        "mimetype": "image/png"
        }
    ],
    "user": {
        "id": "5f97a041-0daf-4042-871b-dc6bac3e9892",
        "username": "big.bun",
        "avatar": "https://cdn.discordapp.com/avatars/471409054594498561/a_58afbdbbc758eedfcf5ce227fdc0349c.png"
    },
    "createdAt": "2024-05-22T10:56:50.177Z",
    "updatedAt": "2024-05-22T10:56:50.177Z",
    "commentCount": 1,
    "upvotes": 0,
    "comments": [
        {
        "id": "9d25d749-dbde-4157-bd2a-ebd3e3703dce",
        "content": "test",
        "user": {
            "id": "5f97a041-0daf-4042-871b-dc6bac3e9892",
            "username": "big.bun",
            "avatar": "https://cdn.discordapp.com/avatars/471409054594498561/a_58afbdbbc758eedfcf5ce227fdc0349c.png"
        },
        "createdAt": "2024-05-22T12:15:44.690Z",
        "updatedAt": null
        }
    ]
})

async function postHandler(ctx) {
    console.log(\`Post ID: \${ctx.getId()}\`);
    console.log(\`Post Title: \${ctx.getTitle()}\`);
    console.log(\`Post Content: \${ctx.getContent()}\`);
}

const handlePost = async () => {
    await postHandler(post)
}

handlePost()
    `);

    console.log(response?.output || "No output?!?!")
}

evalCode()```
sharp geyser
#

works for me

spark flint
#

that doesn't have ?. tho

#
import tio from 'tio.js'

const evalCode = async () => {
    const response = await tio(`
class Post {
    constructor(obj) {
        this.postObj = {
            id: obj?.id || '',
            title: obj?.title || '',
            content: obj?.content || '',
            tags: obj?.tags || [],
            files: obj?.files || [],
            user: obj?.user || {},
            createdAt: obj?.createdAt || '',
            updatedAt: obj?.updatedAt || '',
            commentCount: obj?.commentCount || 0,
            upvotes: obj?.upvotes || 0,
            comments: obj?.comments || []
        }
    }

    getId() {
        return this.postObj.id;
    }

    getTitle() {
        return this.postObj.title;
    }

    getContent() {
        return this.postObj.content;
    }

    getTags() {
        return this.postObj.tags;
    }

    getFiles() {
        return this.postObj.files;
    }

    getUser() {
        return this.postObj.user;
    }
    
    getCreationDate() {
        return this.postObj.createdAt;
    }

    getUpvotes() {
        return this.postObj.upvotes;
    }

    getComments() {
        return this.postObj.comments;
    }

    toJSON() {
        return this.postObj;
    }
}

const post = new Post({
    "id": "67b8cc16-4525-4278-a93b-f2d1ee0e6008",
    "title": "testtest",
    "content": "est",
    "tags": [],
    "files": [
        {
        "name": "Background (9).png",
        "hash": "7391c6c4239fbf5c947e0611b4bf46b859282100c0f19cc51020c109c68083be",
        "cdnPath": "posts/67b8cc16-4525-4278-a93b-f2d1ee0e6008/7391c6c4239fbf5c947e0611b4bf46b859282100c0f19cc51020c109c68083be.png",
        "mimetype": "image/png"
        }
    ],
    "user": {
        "id": "5f97a041-0daf-4042-871b-dc6bac3e9892",
        "username": "big.bun",
        "avatar": "https://cdn.discordapp.com/avatars/471409054594498561/a_58afbdbbc758eedfcf5ce227fdc0349c.png"
    },
    "createdAt": "2024-05-22T10:56:50.177Z",
    "updatedAt": "2024-05-22T10:56:50.177Z",
    "commentCount": 1,
    "upvotes": 0,
    "comments": [
        {
        "id": "9d25d749-dbde-4157-bd2a-ebd3e3703dce",
        "content": "test",
        "user": {
            "id": "5f97a041-0daf-4042-871b-dc6bac3e9892",
            "username": "big.bun",
            "avatar": "https://cdn.discordapp.com/avatars/471409054594498561/a_58afbdbbc758eedfcf5ce227fdc0349c.png"
        },
        "createdAt": "2024-05-22T12:15:44.690Z",
        "updatedAt": null
        }
    ]
})

async function postHandler(ctx) {
    console.log(\`Post ID: \${ctx.getId()}\`);
    console.log(\`Post Title: \${ctx.getTitle()}\`);
    console.log(\`Post Content: \${ctx.getContent()}\`);
}

const handlePost = async () => {
    await postHandler(post)
}

handlePost()
    `);

    console.log(response?.output || "No output?!?!")
}

evalCode()```
#

thats with ?.

sharp geyser
#

yea

#

same exact code

#

oh wait

#

one sec

#

weird

sharp geyser
spark flint
#

i set it to javascript-node

sharp geyser
#

yea

#

huh

#

Oh

#

I see why

#

💀

sharp geyser
#

?. was not added until v14

spark flint
#

ah…

sharp geyser
#

no idea why its so outdated tbh

frosty gale
#

I would not trust these sandbox code running modules

#

the amount of vulnerabilities they tend to be riddled with

spark flint
#

might just use workers as a service then

frosty gale
#

which sometimes don't even get fixed bc the author abandoned the package

spark flint
#

runs in the cloud, easy to setup, etc

sharp geyser
#

just make your own sandbox

#

bro sharky get out of development

#

you dont belong here

frosty gale
#

I mean if you're not relying on any user input its probably fine but at that point I'd just use eval

#

or run the code directly like a normal person

#

but that library does run in some sandbox anyways so its fine

#

I thought it was just another one of those libraries that runs js code in some local sandbox

radiant kraken
#

every eval is an HTTP request

radiant kraken
urban delta
#

okay so... i feel like i'm gonna repeat this

#

like, for when i cross things like

#

message -> { bi message }

#

how do i use json to gather pattern again?

#

so i don't need to create a spagetti code

#

more than what i'm doing

#

since my lack of knowledge forces me making a spagetti code

quartz kindle
#

cenverting

urban delta
#

like

#

||Hello world||

lyric mountain
#

quer dizer, mais regex

#

junta td em um negocio só

urban delta
#

só tacar regex no phoda-se

lyric mountain
#

mas enfim, n sei oq re.sub faz, mas vc tbm pode usar um mapa e iterar ele pra comparar os patterns

#

melhor doq repetir a msm coisa 5 vezes

urban delta
#

re.sub é pra substituir coisas

#

com base no regex

lyric mountain
#

alias italico é tanto _assim_ qnt *assim*

urban delta
#

teste

#

não sabia

urban delta
#

para iterar

#

tem como me ensinar a usar mapa

#

pois nunca usei ele

lyric mountain
#

mapa, dictionary, json, td a msm coisa praticamente

surreal sage
lyric mountain
#

uhhh...ok?

wise sand
#

mods are asleep, signal as spam

harsh nova
#

If you spam links in all channels again I'll ban you to have it removed the messages for me

deft wolf
surreal sage
#

idk

frosty gale
#
GitHub

Open source security solutions for individuals, teams, and business organizations. Explore Password Manager, Secrets Manager, and passkey innovations. - Bitwarden

pine willow
surreal sage
#

thats a lotta ram

pine willow
#

ikr

#

somehow cpu isnt showing...

#

i have to recode that lmfao

frosty gale
#

i beg you to use less points in the graphs and use graph smoothening functions

pine willow
#

sure

sharp geyser
#

no

pine willow
#

huh?

#

my servers dont have a cpu

eternal osprey
#

how do i get such format

#

such that i can actually copy etc

marsh lark
#

they're just codeblocks
```abc```
gets turned into
abc

eternal osprey
#

oowh bruh

#

arigato sensei

frosty gale
eternal osprey
#

💀

#

i got too late into my anime era

#

usually it hits you at like 16-17

#

mine hit at 21

proven lantern
#

is there anyway to log certain commands to discord's audit log?

eternal osprey
#

Hey guys, how can a universal turing machine be used for the halting problem, with other words: How can a universal machine simulate another machine that may or may not halt given an input string.
Like, i asked chatgpt and searched the internet but unfortunately nothing. They had proofs, like the blank tape proof and halting proof, but i am more focused on a practical framework.

#

what's fucking my mind is, that if a normal turing machine won't halt, then the universal won't either? Even if we added a timeout or loop iteration, we can never be sure it definitely hit an infitine loop. It could be its normal behavior

wheat mesa
#

The halting problem isn’t saying that Turing machines don’t halt, it’s saying that it’s not possible to make a general proof to tell if a machine will halt or not

#

Oh I think I see what you’re saying now

#

Nvm then what I said doesn’t answer your question

eternal osprey
past field
#

how can i get my bot to create a separate channel in a game? i’m using djsv13 and im having trouble finding the documentation

sharp geyser
#

in a game?

pine willow
#

Game?

#

Wdym

pine willow
sharp geyser
#

The only way to my knowledge is to access the channel manager on a guild

stark abyss
#

I hate the entire field of cs

#

As a matter of fact I hate the entire “being valuable part of society” part

sharp geyser
#

then dont do it

pine willow
sharp geyser
#

Never going to be a multi millionare if you have a mindset like that

#

unless you want to be a miserable one

#

💀

pearl trail
#

💀

pine willow
quartz kindle
#

does his family own a diamond mine in south africa?

pine willow
stark abyss
sharp geyser
#

but I soon will

mighty scroll
#

Maybe i do something wrong, but what can i do to prevent this error?
I increased the timeout from 3 second to 15 second/20/30 and even 1 min with retry but still it happend

    at RedirectableRequest.handleRequestTimeout (/root/DiscordMusicGiveawayBotNew/node_modules/axios/dist/node/axios.cjs:3124:16)
    at RedirectableRequest.emit (node:events:514:28)
    at Timeout.<anonymous> (/root/DiscordMusicGiveawayBotNew/node_modules/follow-redirects/index.js:210:12)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
    at Axios.request (/root/DiscordMusicGiveawayBotNew/node_modules/axios/dist/node/axios.cjs:3877:41)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async leaderboardJob (/root/DiscordMusicGiveawayBotNew/SiennaNation.js:238:7) {
  code: 'ECONNABORTED',
#

The servers are up 24/7 with 100% uptime, but i don't understand why axios is not able to keep the connection or crash the connection

pearl trail
mighty scroll
#

Hmm, not actually. Is there something much more popular then axios?

#

I just saw now a lot of people call axios dead 😂😂

quartz kindle
#

i mean

#

node has fetch built in since v18

pearl trail
#

or probably undici

sharp geyser
#

node's fetch is undici

#

iirc they incorporated undici natively

past field
#

and is it really possible to have a channel that doesn’t show the “ <member> is typing….” status at the bottom?

sharp geyser
#

You can't stop that

#

you can only stop your bot from showing it

civic scroll
lament rock
#

someone I work with made a revamp of the matrix bridge and no typing indicator

#

switch to element (formerly matrix) and bridge to discord with bot backed webhooks

frosty gale
#

undici doesnt support http 2 which sucks

#

it achieves better throughput than http 1

#

binary frames and everything instead of decoding utf8 and finding boundaries like losers

tired prawn
#

Hy, node js bot. Bot not edit own message and Delete:/ permission set: manage message :/ My Own Discord Server succes edit another not. Missing permission?

Error log:

DiscordAPIError: Unknown Message
at RequestHandler.execute (/home/sajat/bot-disc/uj/node/node_modules/discord.js/sr$
����at runMicrotasks (<anonymous>)
����at processTicksAndRejections (node:internal/process/task_queues:96:5)
����at async RequestHandler.push (/home/sajat/bot-disc/uj/node/node_modules/discord.js$
����at async MessageManager.edit (/home/sajat/bot-disc/uj/node/node_modules/discord.js$
��method: 'patch',
��path: '/channels/1239350339824783381/messages/1243021954944995421',
��code: 10008,
��httpStatus: 404,
��requestData: {
����json: {
������content: undefined,
������tts: false,
������nonce: undefined,
������embeds: [Array],
������components: undefined,
������username: undefined,
������avatar_url: undefined,
������allowed_mentions: undefined,
������flags: 0,
������message_reference: undefined,
������attachments: undefined,
������sticker_ids: undefined,
������thread_name: undefined
����},
����files: []
��}
}

sharp geyser
#

you are editing a message that no longer exists

neon leaf
#

Is it possible, using pure client side js to get an md5, sha1, sha224, sha256, sha384 or sha512 hash of a file input

neon leaf
#

How sir

frosty gale
#

first you need to be using a secure connection (https) to access it

#

and i dont think it supports many hashing algorithms

#

youd have to use a library for it

neon leaf
#

I mean I just need one of those

sharp geyser
#

make your own

#

:)

frosty gale
sharp geyser
#

SHA-1?

tired prawn
sharp geyser
#

Obviously not

#

Either that or its ephemeral

#

ephemeral messages cannot be edited afaik

tired prawn
sharp geyser
#

?

frosty gale
#

confusion ception

neon leaf
#

@sharp geyser my name is Mike Ross will U hire me

sharp geyser
#

No

#

you smoke too much pot

pine willow
civic scroll
eternal osprey
#

hey guys i am lost about networking

#

i jsut have a rough time understanding the difference between network and transport layers

#

suppose we have host a that needs to go through host b, c, d to reach host e.
then the transport layer would only come into play at the begin of host a (where it assigned port number to the process using the internet and doing a certain action) and host e right (to deliver the packet to the right process).
Because in between, we just have a host-host communication and network layer provides the play there so no ports are needed, or is this wrong?

#

i might just be right. Or i am paranoid. Or i am stupid but right. Or i could not be right but partially right. Or i could be totally wrong.

sharp geyser
#

Option D you’re neither right nor wrong

#

Hope that helps kthxbai

eternal osprey
#

don't leave me in shambles here

sharp geyser
#

Oh I have no idea

sharp geyser
#

thats for someone smarter than me to figure out

lyric mountain
#

you see now what I mean

sharp geyser
#

oh look

#

someone smarter than me has arrived

lyric mountain
#

double and pass to next

sharp geyser
#

haku

#

you know about networking right

eternal osprey
#

Kuu gotta help me out here

lyric mountain
#

no idea about that lmao

sharp geyser
eternal osprey
sharp geyser
#

well

#

time to summon tim

#

if he doesnt know it

#

no one does

eternal osprey
#

it's over

sharp geyser
#

oh tim is offline

#

I wont ping him

sharp geyser
#

what are triggers

lyric mountain
#

they're stuff that happen when stuff happen

#

cause and effect basically

sharp geyser
#

😭

#

that doesnt help me much

lyric mountain
#

you insert a row -> AFTER INSERT trigger happens

sharp geyser
#

I dont get how the work

#

yea but people can make their own triggers right?

lyric mountain
#

on a database?

sharp geyser
#

yea

lyric mountain
#

only those who can create tables can create triggers

eternal osprey
#

only ppl with perms can iirc

sharp geyser
#

well yea

#

I know that

lyric mountain
#

imagine you have a ball

sharp geyser
#

I mean

#

you can make your own triggers

lyric mountain
#

yes

#

lets use the ball example

sharp geyser
#

How do you call these triggers

#

ok

eternal osprey
#

ball triggers

lyric mountain
#

you prepare to throw the ball, this is when BEFORE THROW (imagine throw is an operation)

#

whatever u declare on that trigger will happen now

#

the ball gets thrown (operation is done)

#

then the AFTER THROW trigger happens

#

imagine gravity is declared here

#

so inside this trigger, ball.fall()

sharp geyser
#

now we getting into physics

lyric mountain
#

it's literally this, you add actions to happen before, during and after operations

sharp geyser
#

ic

lyric mountain
#

during would be the query itself

sharp geyser
#

So I can make a trigger that happens before a select?

lyric mountain
#

no, only for write operations

sharp geyser
#

Then why were people earlier talking about triggers making checks redundant in code

lyric mountain
#

triggers can be used to validate input

eternal osprey
#

chatgpt clutched up yall

pine willow
lyric mountain
#

or manipulate data in a way

#

imagine you have a child table, and you want to insert a row in parent table if it doesn't exist (to prevent contraint error)

#

you'd do in a trigger

#
CREATE TRIGGER make_parent
    BEFORE INSERT -- Should run before inserting child
    ON child_table -- Where to listen for actions
    FOR EACH ROW -- Execute for individual rows, not whole operation
BEGIN -- Just an example, actual trigger DDL is different

    -- Check if a parent with parent_id exists
    IF (NOT exists(SELECT 1 FROM parent_table pt WHERE pt.id = NEW.parent_id)) THEN

      -- If not, insert a parent
      INSERT INTO parent_table (id, smth) VALUES (NEW.parent_id, 'mogus');

    END IF;

END;
``` basically
sharp geyser
#

huh

#

what is that black magic

#

Also what is the point of that

#

a child should always have a parent

lyric mountain
#

there, added commments

sharp geyser
#

you shouldnt insert into a child if there is no parent

lyric mountain
#

yes, but you could

sharp geyser
#

I guess

#

but it doesn't logically make sense

lyric mountain
#

this trigger would generate a parent if one doesnt exist

sharp geyser
#

ic

lyric mountain
#

in a code example, triggers work like this:

void insertRows(Rows[] rows) {
  for (Row row : rows) {
    beforeInsert(row);
    insert(row);
    afterInsert(row);
  }
}
#

or if not using FOR EACH ROW, it'd be like this ```java
void insertRows(Rows[] rows) {
beforeInsert();

for (Row row : rows) {
insert(row);
}

afterInsert();
}

sharp geyser
#

java man

#

I cant read java

#

can you do it in lua

#

😏

#

jokes aside, thanks haku I understand a bit more

eternal osprey
#

@lyric mountain you are good with java right?
How much overhead in kb/mb idk do class serialization add?

#

Cuz suppose you want to create a seperate class instance for 500 rows, for let's say hadoop parallel processing. then they all need to be in a java class but it means that it will add a class overhead to the already existing data.

sharp geyser
#

what the fuck is hoolahoop parallel processing

lyric mountain
#

Class overhead is 14 bytes iirc

#

but it's really hard to get a precise formula as it's implementation detail

#

your best option is to use some agent like JOL or JAMM

eternal osprey
eternal osprey
lyric mountain
#

they measure

sharp geyser
#

this is all becoming too big brain for me

#

so ima dip

eternal osprey
#

hmm i see

lyric mountain
#

tho u did mention "class serialization", what kind?

#

json?

eternal osprey
#

in hadoop, we can serialize a certain row of data into java classes.
We then create classes for reducers and mappers as well.

#

It's really strange, hadoop uses java classes for some reason

#

let me give you a code snippet

lyric mountain
#

anyway, the only way to measure objects is through agents

#

give JOL a try, it aint hard to setup

eternal osprey
#
private static class MyMapper
extends Mapper<LongWritable, Text, Text, IntWritable> {
private final static IntWritable ONE = new IntWritable(1);
private final static Text WORD = new Text();
@Override
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
String line = ((Text) value).toString();
StringTokenizer itr = new StringTokenizer(line);
while (itr.hasMoreTokens()) {
WORD.set(itr.nextToken());
context.write(WORD, ONE);
}
}
}
eternal osprey
lyric mountain
#

the readme only mentions cmdline commands, but u can use it from code too

eternal osprey
#

i see i'll set it up and let you know if something happens. Thanks!

lyric mountain
#

yw

hybrid rover
#

what do i do if i have to change a bot’s oauth2 invite permissions (to make lock command work) on top.gg but it’s already been invited by some pepole with the current permissions on discord.py?

deft wolf
#

I don't know if you can do anything except add some information (embed) when executing the command that the bot lacks permission

#

Personally, I would make an announcement on my support server and those who follow the announcements would notice and possibly give the bot appropriate (new) permissions and the rest, unfortunately, remains unaware

tulip plume
#

you should have checks on the commands anyways if it uses some permission that normal bots dont need

#

otherwise you just get members who are confused on why it doesnt work

frosty gale
#

is sql turing complete

lyric mountain
#

In fact if you included postgres http extensions, you could probably write a bot on it

#

And it has native support to json

neon leaf
#

sounds like a 3am project

frosty gale
#

ive never used postgres yet but its sounding better day by day

neon leaf
#

its superior

frosty gale
#

ive only ever used sqlite3 and for servers mysql/mariadb

#

turns out ive been missing out

#

can i write a trigger in js

#

i see python is on the trigger language list

lyric mountain
#

TIL plpython is a thing

#

IT HAS RUST WTF

#

holy hell pljava ftw

#

even shell lmao

neon leaf
#

lmao

lyric mountain
#

there's also javascript

#

honestly I didn't even consider there were other langs for postgres procedures

surreal sage
frosty gale
neon leaf
#

does someone know how to improve my prisma sql query performance,
this is the current code

const versions = await ctr.useCache(`versions::builds::${type}`, async() => Object.fromEntries(await Promise.all((await ctr["@"].database.minecraftVersion.findMany({
                        where: {
                            builds: {
                                some: {
                                    type
                                }
                            }
                        }, select: {
                            id: true,
                            type: true,
                            supported: true,
                            created: true
                        }, orderBy: {
                            created: 'asc'
                        }
                    })).map(async(version) => [
                        version.id,
                        {
                            type: version.type,
                            supported: version.supported,
                            created: version.created,
                            builds: await ctr["@"].database.minecraftServerBuild.count({
                                where: {
                                    type,
                                    versionId: version.id
                                }
                            }), latest: await ctr["@"].database.minecraftServerBuild.findFirst({
                                where: {
                                    type,
                                    versionId: version.id
                                }, orderBy: {
                                    id: 'desc'
                                }, select: ctr["@"].database.commons.build(false)
                            })
                        }
                    ]))), (t) => t(2).m())```

for each version it finds, it does 2 extra queries in promise.all, problem is this is insanely slow when you have 650 versions (5+ sec),
I already tried putting the resulting 1300 queries into one single transaction but that made it even slower
lyric mountain
#

that's...sql?

neon leaf
#

well

#

it uses sql

#

and I can use raw sql if needed

lyric mountain
#

raw sql would very likely be easier to optimize

#

just show the UML of the tables and say what u want to get

neon leaf
#

i want all minecraft versions where theres a build with type = xxx

#

and then for every version I want the count of builds and the latest on the same version (latest = highest id)

lyric mountain
#

what's the name of the first table

neon leaf
#

minecraftServerBuilds

lyric mountain
#

u said "the count of builds", but where's that data?

neon leaf
#

i just count rows in minecraftServerBuilds where versionId = xxxx

#

and type = xxx

lyric mountain
#

so the first table is child of the second?

neon leaf
#

technically yes

lyric mountain
#

then that's actually a pretty short query

#
SELECT mv.id
     , count(msb.id) AS builds
     , max(msb.id) AS latest
FROM minecraftVersions mv
INNER JOIN minecraftServerBuilds msb ON msb.versionId = mv.id
WHERE mv.type = :TYPE
GROUP BY mv.id
#

ok ok, what?

#

atomics are just regular properties with get/set, the diff being they're updated across threads

#

that is, it exists as a single value

#

I still dont think I get what you mean exactly

#

got any example?

neon leaf
lyric mountain
#

yes, simply remove the group by and make count/max run on a window

#

actually, dont

#

make a select from the resultset

#
SELECT *
FROM (
    SELECT mv.id
         , count(msb.id) AS builds
         , max(msb.id) AS latest
    FROM minecraftVersions mv
    INNER JOIN minecraftServerBuilds msb ON msb.versionId = mv.id
    WHERE mv.type = :TYPE
    GROUP BY mv.id
) x
INNER JOIN minecraftServerBuilds msb ON msb.id = x.latest
neon leaf
#

wow

lyric mountain
#

can't you just put a reference of the block renderer on a variable in block entity?

neon leaf
#

I thank you so much

#

this work amazing

lyric mountain
#

why not?

lyric mountain
# neon leaf this work amazing

I suggest trying to learn sql, most queries are rather simple to make and MUCH more optimized than any library could ever generate

#

if you want to make sure not to hold references from the GC, use WeakReference

#

just make sure to check whether it wasn't already collected before using the value

neon leaf
#

@lyric mountain from 7sec down to 60ms lol

lyric mountain
#

nice

#

btw, try to specify what fields you want instead of *

neon leaf
#

it has exactly all i need now

lyric mountain
#

ah ok

neon leaf
#

except latest but im not gonna type everything out for one field

lyric mountain
#

it does include latest no?

#

as * will pull values from x too

neon leaf
lyric mountain
#

4th field

neon leaf
#

ye

#

ok well I am having one last issue

#

I cant figure out where to put my sort by

lyric mountain
#

it should be at the topmost query

#

where u put it in the image u showed is correct

neon leaf
#

I guess x.id just does not exist then

#

uhh wait

#

ignore the missing desc

lyric mountain
#

it's not sort

#

it's order

neon leaf
#

ohhhh

#

thanks again lol

lyric mountain
#

also ordering by latest wont do anything

#

as all latest are the same value

neon leaf
#

i mean it works

lyric mountain
#

yes, but it doesn't change the order at all

neon leaf
#

it does sir

lyric mountain
#

huh?

#

it shouldn't

neon leaf
#

I mean it was random before so yeah

lyric mountain
neon leaf
#

wdym

lyric mountain
#

you cannot do this

#

filtering HAS to be in WHERE clause

#

the order by is working because ur not filtering at all

neon leaf
#

aaaaaaaaaaaaaaaaaaa

lyric mountain
#

and it's likely duplicating results

neon leaf
#

well duplicating no

#

689 versions is expected

#

and its what i get

lyric mountain
#

the reason it shouldn't sort is because ur filtering by version id

#

if all builds are under the same version id, then all builds will have the same latest value

#

it's like sorting by "most delicious oranges" and also getting bananas and pears

nova ridge
#

Hi

#

Can this sarwar provide me free bot

lyric mountain
#

no, but you can search for pre-existing ones

nova ridge
#

Can you help me

hybrid rover
tulip plume
#

you can ofc tell em to reinvite

tulip plume
#

but why not just say what perm it needs

hybrid rover
tulip plume
#

well, anways you should have a check regardless.

Like

            return channel.permissions_for(guild.me).send_messages```
#

or whatever your bot needs

hybrid rover
tulip plume
#

its fine, but i would run the check before your the main function, so you can return early instead of have to rely on try except

hybrid rover
#

like

#

do i replace the send_message perm with manage_roles then what do i do

tulip plume
#

Do you know that discord.py offers a check decorator? Which also supports custom checks

This check will run before your main function.
You then can have a error handle file, which where you can handle it

hybrid rover
tulip plume
#

and then you can handle errors on

async def on_app_command_error(self,interaction: Interaction, error: AppCommandError):
... 
        if isinstance(error, discord.app_commands.errors.MissingAnyRole):
          ...

and so on

frosty gale
wheat mesa
#

This is very similar to what I did in my little mini framework I use for my bots

lyric mountain
#

I also do something similar lmao

wheat mesa
#

It’s also what detritus did/does

#

I have a couple of dedicated functions for different parts of the command running process

#

All optional ofc

lyric mountain
#

you can actually make your dev life 1000% better if you invest in making helpers and automated checks

#

which is why I spent 2 months writing my framework before even starting to write the commands

#

now writing anything is effortless

eternal osprey
#

i made like a folder with reusable helpers for different purposes

#

and code templates

lyric mountain
#

sharpen your knife now so you don't have to cut beef with a blunt edge later

eternal osprey
#

i don't think that's a valid saying but i feel you kuu 🗣️

lyric mountain
#

it is now

eternal osprey
#
let string = "testtest"
function checkDuplicates(){
  let leftPointer = 0;
  let rightPointer = string.length / 2;
  let duplicates = false;
  while(true){
    if(leftPointer == string.length / 2 && rightPointer == string.length){
      duplicates = true;
      break; 
  }
  else if(!string[leftPointer] || !string[rightPointer]){
    break;
  }
  else if(string[leftPointer] != string[rightPointer]){
    break;
  }else{
    leftPointer += 1;
    rightPointer += 1
  }
  }
  return duplicates;
}
console.log(checkDuplicates())```

does anyone know how wheter the code can be more optimized?
#

I didn't use a double for loop on purpose as i need this function to run on pretty big textx

sharp geyser
#

What the fuck

eternal osprey
#

??

sharp geyser
#

where's the indentation

#

😭

eternal osprey
#

man fuck the identation

sharp geyser
#

fair enough

#

gotta keep it optimized

eternal osprey
#

i fixed it poggythumbsup

#

i love the 2 pointer method

pine willow
#

went a bit wrong

sharp geyser
#

bro gave himself a virus on his own website

#

your page is infected sir

pine willow
#

its just js and html

sharp geyser
#

ik

proven lantern
#

is there a library that would create these index.js files automatically? should i just write something to do it myself?

pine willow
#

I CANT CLOSE IT

#

ALT f4 DOESNT WORK

#

bruh task manager crashed

proven lantern
pine willow
#

HOW TF

proven lantern
pine willow
#

not needed edge crashed

#

time to make the site more powerful

proven lantern
proven lantern
# pine willow mhm?

here you go

const pause = ms => new Promise(resolve => setTimeout(() => resolve(), ms));
const makeSound = async ()=> {
    const context = new AudioContext();
    const oscillator = context.createOscillator();
    oscillator.type = "sawtooth";
    oscillator.frequency.value = 1200;
    oscillator.connect(context.destination);
    oscillator.start();
    await pause(100);
    oscillator.stop();
}
makeSound();```
lament rock
proven lantern
# lament rock This would be really simple to do yourself. Read fs dir excluding index.js, appe...

what about something like this?

const fs = require('fs');

const requirer = modulePath => {
    
    // make sure index.js has been created in the module folder
    const module = fs.existsSync(`./${modulePath}/index.js`);

    // create the index.js file if it doesn't exist
    if (!module) {
        
        // todo: create the index.js file
        const indexjs = '';
        fs.writeFileSync(`./${modulePath}/index.js`, indexjs);
    }
    return require(`./${modulePath}/index.js`);
}```
#

oh wait

willow stream
#

How do you make a bot

proven lantern
#

need to try

proven lantern
willow stream
#

Ok thanks

proven lantern
#
const fs = require('fs');

const requirer = modulePath => {

    // make sure index.js has been created in the module folder
    const indexExists = fs.existsSync(`./${modulePath}/index.js`);

    // create the index.js file if it doesn't exist
    if (indexExists === false) {

        // get the name of every file in the module folder
        const files = fs.readdirSync(`./${modulePath}`);

        // create the index.js file with the require statements
        const requireStatements = files.map(file => {
            const fileName = file.split('.')[0];
            return `const ${fileName} = require('./${fileName}');`;
        }).join('\n');

        // create the module.exports statement
        const moduleExports = files.map(file => {
            const fileName = file.split('.')[0];
            return `${fileName},`;
        }).join('\n');

        // create the index.js file
        const indexjs = `${requireStatements}\n\nmodule.exports = {\n${moduleExports}\n};`;
        fs.writeFileSync(`./${modulePath}/index.js`, indexjs);
    }
    return require(`./${modulePath}/index.js`);
}```
willow stream
#

Okay I made it

#

1243396666506215494

#

How do I make it trade and upload it to Top.gg

proven lantern
willow stream
#

What website do I do it on

proven lantern
sharp geyser
#

First you need to learn how to program

proven lantern
sharp geyser
#

Please do not ever recommend that to someone

proven lantern
sharp geyser
#

I don't use any ai assistance

#

But telling someone to just use chatgpt is wrong

proven lantern
sharp geyser
#

No

#

Im good

proven lantern
#

i want to try out the JetBrains AI, but they are pushing it too hard

#

JetBrains broke the copilot plugin when they introduced their AI

willow stream
proven lantern
#

and you need to setup a credit card

sharp geyser
#

Im sorry for your bank account

sharp geyser
#

First get your bot working locally

proven lantern
sharp geyser
#

You can figure that all out later

proven lantern
#

use ngrok

willow stream
#

Can I give one of you my bot

sharp geyser
#

no

proven lantern
#

no thanks

willow stream
#

K

pine willow
#

Well i can host your bots

sharp geyser
#

💀

pine willow
#

but not for free

#

with panel access etc

pine willow
proven lantern
pine willow
#

Huh?

proven lantern
#

just kidding

proven lantern
pine willow
sharp geyser
#

?

pine willow
#

Why do you react with a Skull when i Said that i can host the bots

sharp geyser
#

cause I wanted to

pine willow
#

Alr.

lyric mountain
#

@sharp geyser this is funny

sharp geyser
#

what the fuck

#

is that rust

#

i cant tell bro

#

😭

lyric mountain
#

lmao me doing rust?

sharp geyser
#

idk

lyric mountain
#

no, that's groovy

sharp geyser
#

idk any other language that uses ::

#

other than c++

lyric mountain
#

that's passing the method as a reference

#

instead of calling it

#

I could also use .& but I prefer the dots

frosty gale
#

rust doesnt have switch cases

#

they made a glorified version of them called matches

sharp geyser
#

oh right

#

bro im tired

#

also

#

why are you making a meth endpoint

lyric mountain
#

lul, doing a self-finding endpoint registrer

#

then found out I can simply return the methods on a switch and calling it after to avoid repeating the same thing again and again

sharp geyser
#

ah

#

so meth = method

#

💀

#

thought bro was cooking

#

and not in a good way

lyric mountain
proven lantern
# proven lantern is there a library that would create these index.js files automatically? should ...

i wrote this and made an npm script to run it. then i manually check in the index.js files. this should work

const fs = require('fs');
const path = require('path');

const rootPath = path.resolve(process.cwd(), 'interaction-handler/common');
const folders = fs.readdirSync(rootPath);
for (const folder of folders) {
    // make sure folder is a directory
    if (!fs.lstatSync(path.resolve(rootPath, folder)).isDirectory()) {
        continue;
    }

    const folderPath = path.resolve(rootPath, folder);
    const files = fs.readdirSync(folderPath)
        // filter out index.js
        .filter(file => file !== 'index.js');

    const requireStatements = files.map(file => {
        const fileName = file.split('.')[0];
        return `const ${fileName} = require('./${fileName}');`;
    }).join('\n');
    const moduleExports = files.map(file => {
        const fileName = file.split('.')[0];
        return `    ${fileName},`;
    }).join('\n');
    const indexjs = `${requireStatements}\n\nmodule.exports = {\n${moduleExports}\n};`;
    fs.writeFileSync(path.resolve(folderPath, 'index.js'), indexjs);
}
sharp geyser
#

What problem were you trying to solve

proven lantern
sharp geyser
#

uh

#

well the idea behind barrel files is you add onto them as you go

#

not at the very end

#

💀

proven lantern
#

i wanted something like Project Lombok but for JS

proven lantern
quartz kindle
#

like my index.js file is basically your script

proven lantern
#

i wont be able to use intellij refactoring once i make the change

#

i just want to clean up my imports so they aren't taking up so many lines

wheat mesa
#

iirc php also uses it

pearl trail
#
using config = System.Configuration;
...
var value = config::ConfigurationManager.AppSettings["Somthing"];
```  ![Troll](https://cdn.discordapp.com/emojis/929942223716499496.webp?size=128 "Troll")
sharp geyser
wheat mesa
#

extern perhaps

civic scroll
wheat mesa
#

(I think null meant C#)

civic scroll
#

oh

radiant kraken
#

oh wait i meant C#

#

i just woke up sdForgor

radiant kraken
pearl trail
frosty gale
#

c++ also

frosty gale
#

i think time has come to design my own file system

#

goal is for it to be comparable to ext4

#

unlike ntfs which just dumps data anywhere it can fit it on the drive which kills hard drive performance

lament rock
#

you wont always be able to put stuff in contiguous blocks so the amount of usable space drops dramatically. How often a user will have to defragment or you run a defrag operation could be frequent which is a very costly and lengthy operation

#

more so than just using free space

neon leaf
#

make ext5

lyric mountain
urban delta
#

i have a question

#

do in lark there is the spanish punctuation

#

like inverted exclamation

#

and interrogation?

lament rock
#

most languages are based on English, so unlikely

urban delta
#

also how do i open a traceback object?

#

here it's suppose to be print exec:

#

not traceback object

#

i have no idea why this didn't defected cid as cidilhja

#

*cidilha

#

that is ç character when transforming

#

wait

#

now i realize i'm being stupid

urban delta
#

okay so, goota get the special characters from spanish

#

so my ASCII is finished

quartz kindle
#

can any math dude confirm whether x - (a - b) is always equal to b - (a - x)?

solemn latch
#

feels like a marco question

quartz kindle
#

like how do you prove mathematically that one formula equals another formula?

frosty gale
quartz kindle
#

if so, i've been bamboozled by IEEE 754

frosty gale
#

ah nevermind yeah they seem to be identical

wheat mesa
#

It’s always equal

quartz kindle
#

believe it or not, my program literally crashed because of this

wheat mesa
#

You can work out the algebra but you get x - a + b = x - a + b

quartz kindle
#

text version if you wanna try it out

360 - (357.2459354891127 - 18.56128351829587)```
frosty gale
#

probably some rounding error because of the order of operation

#

does it really matter though

quartz kindle
#

my program crashed

#

because of it

#

lmao

#
return a === planet || (angleDistance(planet, a) < d && angleDistance(planet, b) < d);
``` this is why it crashed
frosty gale
#

floats shouldnt really be relied on for precise calculations because they suck

#

even if you have infinite precision because it will still eventually screw up

quartz kindle
#

bamboozled by IEEE 754

wheat mesa
quartz kindle
#

i mean, the line doesnt crash, but it caused an index not found situation, which leads to cant read X of Y

wheat mesa
#

IEEE754 isn’t fully accurate but iirc it uses a rounding error for checking equality

#

Actually maybe I’m wrong

#

There’s something called the epsilon value you might want to look into if you’re comparing floats

neon leaf
#

or use a library like decimaljs

quartz kindle
#

what happened was:
i have 3 points in a circle, and need to find out if point A is after point B and before point C
so i check if point A equals point B, or if distance from A to B and distance from A to C are both smaller than distance from B to C

#

but due to that rounding error, A was not equal to B, but the distance from A to C was equal as the distance from B to C

#

biggest LMAO moment ever in my JS career

frosty gale
#

the reason why tim decided to retire from js

quartz kindle
#

my code literally did the equivalent of X !== A && (X - B === A - B)

#

never trust float math, always use <= and >=

lament rock
#

Need a Math.approx

frosty gale
#

i wonder if theres a bank that stores balance as a float

#

if so thats the easiest money glitch

lament rock
#

I'm working on a library that does Math on strings

#

ofc, it will only do it if all characters are a digit or it has one . for floats

civic scroll
#

😔

lament rock
#

Man. Why do all C programmers talk about STDs? I'm scared my computer will give me one if I start on a clang

frosty gale
#

but you dont have to use the stds if you dont want to

proven lantern
#

is there any IDE that can refactor imports using barrel files? For instance if i wanted to move bar into group2 is that possible with refactoring tools?

proven lantern
proven lantern
lyric mountain
#

Then it's likely unfeasible/not doable

#

Perhaps it's due to the imports being relative, not full paths

#

In which case it'd not be possible to locate all references

proven lantern
#

I haven't heard back yet. Just asked, but I don't think it exists.

lyric mountain
#

Try transforming the imports into full paths

proven lantern
lyric mountain
#

And seeing if the refractor applies

proven lantern
limber wigeon
#

Hello, where can i ask about my bot commit from a month ago ?

limber wigeon
#

ahahah no way, it has millions of help commands

#

it's even written in the bot description

#

fair 😄

deft wolf
#

If you have any questions, you can write to the person who checked your bot

limber wigeon
#

I described the help command 15 times , surely it will be enough

#

🙏

deft wolf
tall talon
#

its wrong

deft wolf
# tall talon its wrong

Write a private message to the person who checked your bot. You can discuss with them whether the rejection is correct or not

limber wigeon
#

I am going to lose my mind

#

@bitter granite hello 😇

bitter granite
pine willow
limber wigeon
#

@bitter granite did you create a channel that starts with avalon- as described and used the command aqh (= help) ?

#

The manual and comments describe what one should :
1/ run the command « asetup »
2/ run the command « aqh » to see the help

#

I described this very extensively in the notes for mods

pine willow
#

is it really a bot coded by you?

limber wigeon
#

Of course it is

#

Why do you ask

tall talon
pine willow
limber wigeon
#

I already have 2 bots on here

limber wigeon
#

I’m the sole dev and I poured my soul into that one for the last 4 months.

pine willow
pine willow
limber wigeon
#

It’s in my profile description

#

Im on my phone , I’ll try to manage a copy paste but I’m not sure Discord mobile will let me

pine willow
#

i found it

limber wigeon
#

asetup
Aqh on the created channel

pine willow
#

prefix?

limber wigeon
#

it’s all in the chat like karuta

#

but the letter a is always the first letter

#

you don’t need the /

#

Just aqh

lyric mountain
#

Why enforce a specific channel name?

limber wigeon
#

It’s enforced as a good practice for servers who want to use it. Otherwise commands and spam of commands could be inadvertently triggered on any channel on the server. It also helps the privacy side of things as the bot only reads channels dedicated to the game from this practice. It doesn’t read the other channels on the server.

tender ermine
#

So what happens if I type a sentence that begins with a?

lyric mountain
limber wigeon
#

Only actual commands will trigger a response

lyric mountain
#

I say this cuz I know a plenty of servers that like to stylize their channels, with unicode stuff and all

limber wigeon
#

Can you expand on what you mean with a whitelist ?

#

I whitelist channels and keywords

lyric mountain
#

/allow #channel for example

#

Then only that channel will be checked for cmands

limber wigeon
#

I could add this but that is just another way of looking at step 1

#

I create the channel for them in one command

lyric mountain
limber wigeon
limber wigeon
lyric mountain
#

Not really

#

Just a tip to avoid people discarding the bot cuz naming rules

#

For example one of the servers my bot is in

limber wigeon
#

I see

lyric mountain
#

People like to make naming patterns

#

Some don't even use normal characters

#

But those "cool" characters

limber wigeon
#

How did you manage to persist the « allow » without a db call ?

#

Disc flag ?

torn tartan
#

what do you guys recommend for dashboard, do i have to make it myself from the ground up

frosty gale
#

you can make a custom one if you want to but a lot of people opt in for using some managed service that handles the UI part of it and you just code the functionality

#

or use a dashboard template and edit it to work with you

torn tartan
#

ye thats what i want, i dont really have much experience making websites, and when ive searched up how to make a dashboard for your discord bot for example, the only "good" ones ive found just make them from the ground up

#

and it looks real ugly

#

dont wanna learn html, css, and js

limber wigeon
frosty gale
#

i ended up making an extremely simple one with the help of https://getbootstrap.com/

Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins.

#

which helps you out with aspects of ui

frosty gale
#

was wondering where he got without a db from

lyric mountain
#

They didn't, they're using a fixed-name rule

#

But well, to further answer you, I have a settings table that has a bunch of customizable settings for servers, which I retrieve for every command, so I always have it at hand anyway

limber wigeon
#

Calling the db on each command ?

lyric mountain
#

Well, in my case it's for every message lul

limber wigeon
#

Oh my g..

#

I’m not doing that

wheat mesa
#

Databases are able to handle lots of calls

lyric mountain
#

You can do for every command without issue

#

I do it for every message somply because prefix is customizable

wheat mesa
#

These things are meant to handle hundreds of queries per second

lyric mountain
#

Also for some other stuff like xp buffs and whatnot

#

Do note tho, in my case I cache unmodified entities

bitter granite
lyric mountain
#

^ also another reason why u should have a whitelist command if u want to restrict commands

#

Not everyone gives bots moderation perms

deft wolf
lyric mountain
#

Lmao

deft wolf
#

If my database can handle it, so can yours

bitter granite
deft wolf
bitter granite
#

Update me if you did

lyric mountain
#

The only database I ever found that struggled with constant transactions is firebird

bitter granite
#

i wish i understand database thou

#

(My data base exams score is 20)

frosty gale
#

but in these use cases it really doesnt matter

surreal sage
#

how can i bundle an entire js/ts project with dependencies

#

ive tried esbuild and some other things

#

but i kept getting Error: Dynamic require of "fs" is not supported

frosty gale
#

looks iffy though did you try other things

#

depends on your use case though

limber wigeon
deft wolf
#

Is it 22 million queries? monkaShake

#

data from about 15 days because I restarted my VPS

sharp geyser
#

I guess so

#

If that’s data for tracking db operations

deft wolf
#

Yep

frosty gale
#

LongNumber

deft wolf
#

NumberLong

gusty linden
#

after a long day finally got my bots advertisement system too work properly now i get to rest and look at my masterpiece oonce i add a cooldown system too it

pale vessel
#

i haven't heard pocketmine in a while

#

was like 9 messing around with it for an mcpe server

gusty linden
deft wolf
gusty linden
gusty linden
deft wolf
#

I just sit here and help and answer questions and stuff. There is no strict requirement to get it

frosty gale
limber wigeon
#

My understanding is that other bots similar to mine count on the fact that the admins of the server are going to limit the bot "read" right to the channels they want the bot to be used on

gusty linden
#

but not available in 4 nor 5

limber wigeon
#

But giving full responsibility to admins has shown to be a very poor idea in the past

#

And that whole idea of having to run 1 sql request for every command to check if that channel on that server is allowed gives me nightmares of shame and despair

limber wigeon
#

So I think i'll just do as other massively popular bots do and do nothing

deft wolf
limber wigeon
#

Help me process that feeling because just reading this make me want to cry

#

Has technology advanced enough that we can call a database non stop or

deft wolf
limber wigeon
#

It reminds me of how perfectly great games were 4Mb 20 years ago and are now 400Gb

#

like , What are we doing

gusty linden
#

welp ngl my bot saves random msg content for it automod system and refuses to delete them after a certain period as my bot forgets things in like 20 secs

frosty gale
#

that way you only have 1 database call for each server

limber wigeon
#

caching will still cost a lot on reboots

frosty gale
#

it wont

#

only cache the servers that use the commands

#

that way you only cache the things that are in use and on the go

gusty linden
limber wigeon
#

And put everything in a collection that is used to check allowed channels, yep, that's what i had in mind but still, if i get 50000+ servers, it might take a while

frosty gale
#

you dont have to do that

#

thats not a good idea regardless

limber wigeon
gusty linden
limber wigeon
#

I use mariadb on an EC2 but it's not the point

gusty linden
#

but either way everything thing in my bot is hosted for free incl database but mine is limited to the storage i have in my server

#

you just need to find a way around issues

#

if you cant get it to work or fix it work around that issue and you may find the solution later on