#development

1 messages · Page 1931 of 1

proven lantern
#

if his ip address is dynamic he might get locked out

#

i guess he could proxy through the webserver

boreal iron
#

How can he get locked out if we don't touch the input policy? Wtf

proven lantern
#

yeah, good idea to be safe

#

so you dont get locked out

boreal iron
#

You can only lock out yourself if you don't know what you're doing

cinder aspen
#

Hi

proven lantern
#

I'd have to destroy everything i own and forget my name and ssn to get locked out of my hosting

shut sky
#

Im devlopere bot give mi role

boreal iron
#

Only if you pay $50

proven lantern
#

fake is selling his account

shut sky
boreal iron
#

huh, yeah why not freerealestate

#

gimme cash, now!

proven lantern
#

you can become FaKe

#

i mean FakE

boreal iron
#

... was close to say something, Sir!

proven lantern
#

my uppercasing skills are lacking

#

look at how small my lambdas are now

#

can someone else finish refactoring my code

#

each slash command has it's own github repo and ci/cd pipeline

#

instead of one big project with all the commands. so much better

boreal iron
#

Living "on" the Edge

#

I’m so fucking tired of that bullshit

split hazel
#

E

#

I swear e is 2g

boreal iron
#

Feels like 0G

coral sigil
#

How can I calculate the permissions from the channel objects' array of overwrite objects returned from GET /channels/{channelId} from discord api?

split hazel
#

yeah it is quite slow

#

I've had to use it as a main driver one day

#

the good old days

#

aren't some states in the US dropping support for 2G now?

boreal iron
#

Mobile carriers have managed to fuck up the internet here the last 5 years.
3G has been shut down, more and more areas basically have no connection at all etc.
It’s just a joke
Am I’m the retard paying for that shit

earnest phoenix
#

2G is still a thing?

split hazel
#

oh right 3gs been shutting down not 2

split hazel
earnest phoenix
#

Pain

split hazel
#

I don't get why they're shutting down 3g

boreal iron
#

Of course it is

split hazel
#

tons of phones still only support 3g

#

low income families

boreal iron
#

You have to support all possible devices

earnest phoenix
#

I have a phone that emits radiation

split hazel
#

a couple of years ago my daily phone was one without 4g support haha

boreal iron
#

Yeah mine too

earnest phoenix
#

I have 5G

boreal iron
#

Don’t need to upgrade if the phone still works

earnest phoenix
#

Cause I'm kool

split hazel
#

I'm on a really weird network where 3g is faster and more reliable than 4g

#

only reason I'm on it is because has the cheapest non contract unlimited data

boreal iron
#

It was here as well but got shut down to deal as antennas for 5G

#

At an area 4G already has a really bad coverage

slender wagon
#

Where is casi

#

Caasi

earnest phoenix
#

What

boreal iron
#

It’s just frustrating and annoying but yeah we’re moving back in time

slender wagon
#

WOOOPS

split hazel
#

mobile networks are so inconsistent

slender wagon
#

SHIT

#

My bad L

boreal iron
#

If you don’t live in a big city you’re fucked

split hazel
#

I also do wonder if some day access to Internet will become completely free

#

it's practically a necessity nowadays

#

if you want the same opportunities

boreal iron
#

Well maybe at the time anything has been censored due discrimination because any word is offending nowadays

split hazel
#

that'd probably also be the case

boreal iron
#

Because humanity nowadays means stupidity

split hazel
#

though I don't know if the government(s) would be too willing to kill the broadband market

#

maybe if you'd want faster speeds

boreal iron
#

Why should they… it’s the perfect mass spy fundation

split hazel
#

and delicious tax cuts

boreal iron
#

The free internet is dying anyways since providers have began to threat packages differently looking into them where they come from to sell services whitelisting any consumer portals instead of routing any package anonymously, meaning dealing exactly the same with every package

#

In the future any available service can be whitelisted if you pay for it and the rest of the packages will be dropped due bandwidth limitations

#

That also allows to censor and filter the whole internet by just dropping packages coming from not by the government whitelisted sources for examples

#

I mean China is the best example

split hazel
#

would tor be our only escape

boreal iron
#

And I mean it’s even a conspiracy theory, we can already see how it goes and Snowden has told us why, when, etc.

split hazel
#

the future of society is looking quite grim

boreal iron
boreal iron
split hazel
#

through entities trying to control something that doesn't realistically belong to them

boreal iron
#

Total control by your government, more and more rights and freedom is gone, anything you say can be discriminating because of any over sensible fucker out there and non-well payed jobs and increasing live costs are already the reality

split hazel
#

very true

boreal iron
#

A really, really great future, yeah

split hazel
#

there are too many people that are completely blindfolded to all of this happening or simply do not care

boreal iron
#

With the background, they tell us, to protect us pepowot

split hazel
#

thinking the government is on their side 😂

proven lantern
#

things will be better after the war

boreal iron
# split hazel thinking the government is on their side 😂

Yeah they all seem to grow up with the all this shit and don’t actually care about
It’s more important to introduce 20 different genders and remove any bad word or critism around the net to hope nobody ever feels bad reading some unrelated fucking opinion

split hazel
#

all the shit that doesn't matter in the long run

#

and im sure they know all about it and try to keep them satisfied

#

youtube comments are the biggest censorship definition I have ever seen

boreal iron
#

So sad sometimes to look back and see how shit has lots of stuff become

split hazel
#

for example they quietly delete comments their ai thinks has the smallest tint of criticism or bad language

#

or shadow them

boreal iron
#

lol

#

Where are the good old days you could call somebody an asshole and both laughed and moved on

split hazel
#

yeah I can imagine

boreal iron
#

Looks like anything "negative" needs to be controlled, fined and removed

split hazel
#

luckily all of the people I know in real life are very open to dark humour and just overall banter

#

and don't immediately get offended

lyric mountain
#

most people irl don't really care abt dark humour and laugh af

boreal iron
#

I read about people thinking of killing themselves just because there are millions of bad comments in their whatever.. Instagram account

Not that this is a joke but WTF why has the whole internet need to change or being censored because there’s somebody with mental illness?

I would better try to help that person and stop him/her from using that platform instead of censoring anything related to it

split hazel
#

yeah

boreal iron
#

But that’s where we are

split hazel
lyric mountain
#

the issue is that behind the internet noone will know who you are

boreal iron
lyric mountain
#

being anon makes some people go crazy

split hazel
#

I'd rather have someone harass me anonymously than lose my right to privacy

boreal iron
#

Yeah that doesn’t change the fact the hate and criitsm hits people who are somehow need to present themselves on the net

sudden geyser
#

But how far are you willing to go for privacy

boreal iron
#

If you do that and share you life with the whole world that CAN happen

#

We wanna censor the whole internet just because of a minority feels like they can’t deal with he "pressure"?

split hazel
#

and to think this world for humans used to be about trying to survive in the wild and hunting animals for food as well as looking for shelter

boreal iron
#

I mean wtf

split hazel
#

now there's a modern equivalent to that

boreal iron
#

As nice as the talk is I’m leaving the highway now

#

See you later I guess

split hazel
#

see ya

lyric mountain
#

tbh the root of all evil is twitter

split hazel
#

yes

sudden geyser
#

what about facebook

lyric mountain
#

facebook is mild

split hazel
#

yes too

boreal iron
#

Most social platforms tbh

lyric mountain
#

twitter is what made the internet become what it is now

split hazel
#

Facebook just wants to harvest your data

sudden geyser
split hazel
#

or shall I say meta

split hazel
boreal iron
#

Well discord is more localized than global tbh

sudden geyser
# split hazel or shall I say meta

at least in a few years we'll have this
https://www.youtube.com/watch?v=Ibm3WhfLk08

split hazel
#

next zuck can track and store the amount of times you take a shit every day

lyric mountain
#

like, we all know zuckerberg is a twig

boreal iron
#

It’s just hard to see what slowly happens but be the reality in a few years in terms of privacy loss, censorship and so on

split hazel
#

I've been on some tor network forums

#

the people there are very different

#

it actually feels somewhat free in some sense

lyric mountain
#

what, meta?

#

meta will be free afaik

#

and some people are already selling land there

novel snow
#

Bruh

#

I been tryna do this for ages now;
How the hell do I delete guild specific commands from my bot?

split hazel
#

if anything is free nowadays that's a red flag on its own

split hazel
#

oh guild specific hm

#

not sure

novel snow
#

Tried just sending a different array not including any other commands and just 1 help command, Still piles up a fuck ton of my previous commands

#

It is so confusing and idk how to fix it

#

Tryna use this;

rest
  .get(Routes.applicationGuildCommands(client_id, '324195889977622530'))
  .then(data => {
    const promises = [];
    for (const command of data) {
      const deleteUrl = `${Routes.applicationGuildCommands(
        client_id,
        '324195889977622530'
      )}/${command.id}`;
      promises.push(rest.delete(deleteUrl));
      console.log('Wacko ' + deleteUrl);
    }
    return Promise.all(promises);
  });
#

Doesn't work sadly

#

Doesn't log anything either

split hazel
#

did you try sending a post request for specific guilds with an empty commands array

#

if its just your test server reinvite the bot?

wheat mesa
novel snow
#

For some reason the commands persist

novel snow
wheat mesa
#

Have you tried reloading your discord :p

proven lantern
#

you need to kick and reinvite or wait an hour

novel snow
#

How imma get a command id breh

wheat mesa
#

Guild specific commands update immediately do they not?

proven lantern
#

idk

#

maybe

novel snow
#

How would I get the id of a command?

proven lantern
#

GET https://discord.com/api/v8/applications/BOT_ID/commands

earnest phoenix
#

Or /guilds/GUILD_ID/commands instead of /commands

proven lantern
#

oh yeah, that will get you the guild level commands and not the global commands

novel snow
#

Lemme test

#

DiscordAPIError[0]: 404: Not Found
    at SequentialHandler.runRequest (C:\Users\jaspe\Projects\Axo's BGN Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\jaspe\Projects\Axo's BGN Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:99:20) {
  rawError: { message: '404: Not Found', code: 0 },
  code: 0,
  status: 404,
  method: 'get',
  url: 'https://discord.com/api/v9http://discord.com/api/v8/applications/897590420387815485/guilds/324195889977622530/commands'
}
#

.-.

#

I think I am just dumb

pale vessel
#

You sure you got the correct guild ID?

novel snow
#

Positive

#

324195889977622530

#

Now using this;

rest
  .get(
    `http://discord.com/api/v8/applications/${client_id}/guilds/324195889977622530/commands`
  )
  .then(data => {
    const promises = [];
    for (const command of data) {
      const deleteUrl = `${Routes.applicationGuildCommands(
        client_id,
        '324195889977622530'
      )}/${command.id}`;
      //promises.push(rest.delete(deleteUrl));
      console.log('Wacko ' + deleteUrl);
    }
    //return Promise.all(promises);
  });```
earnest phoenix
#

What's that url

#

You got multiple schemes even

novel snow
earnest phoenix
#

Get rid of everything before /applications I guess

novel snow
#

i trie my best

#

liek dis?

earnest phoenix
#

You need the slash

pale vessel
#

You're right, I didn't see that it already prepended the v9 base URL better_lollipop

earnest phoenix
#

At the beginning

novel snow
#

Still sends nothing

#

Returns with []

earnest phoenix
#

Have you tried turning it off and on again?

sudden geyser
#

why does the url even require a slash

#

when every call is going to require one anyway

novel snow
# wheat mesa

I mean I still gotta get the ID of a command for it to work I think

#

Where do I even get a command ID

shadow frigate
#

Does anyone plan their discord bot, or not really?

#

Like I have a google drive full of documents and shit for my bot

spark flint
#

I just get an idea and try get as far as I can coding it

shadow frigate
spark flint
#

Nice

shadow frigate
#

Even got a google group lmao

#

Idk if I’m going too far with it tho

#

But my bot be growing hella fast

shadow frigate
#

So could be useful 🤷‍♂️

jolly notch
#

We had an entire notion page for Ploxy

#

But I didn't use it

spark flint
#

My Christmas bot was coded in a day without any real plan

shadow frigate
#

What do you use to plan it?

spark flint
#

I just said fuck it, I’m coding

shadow frigate
#

I use google sheets and do a

#

Do a

#

Docs

#

If you go with a discord project (bot), it’s probably better to have it planned

jolly notch
#

I stopped using google sheets and docs. I switched to excel and word

shadow frigate
#

Aaaaaa

#

Why

jolly notch
#

I feel like it's better

shadow frigate
#

Better collaboration

jolly notch
#

I don't collaborate

shadow frigate
#

Oh rip

#

Bet it’s a illegally downloaded excel 😉

#

Fuck buying Microsoft office

spark flint
#

Lol

#

Google docs

shadow frigate
#

What’s wrong with google docs lol

jolly notch
#

It's legit excel

shadow frigate
spark flint
#

Ohhh

shadow frigate
#

Fair enough

spark flint
#

I thought you said you illegally used it

jolly notch
#

same with the full adobe suite(creative cloud)

shadow frigate
#

Damn

#

So you don’t use it to keep your bot planned?

spark flint
#

Online photoshop clone

jolly notch
shadow frigate
#

I use trello for tasks and project management

sudden geyser
#

You could also use GitHub issues

jolly notch
sudden geyser
#

Why is that?

#

Surprise?

jolly notch
#

Depends on the feature

#

If I find a moderation bug I am not going to disclose it to the world before I patch it

sudden geyser
#

For those issues, sure. But I guarantee 99% of bots won't need private issues. Most often it's just for privacy, but being open can't hurt that much given the bot's open source 😛

earnest phoenix
#

Can slash commands have more than 1 command in a command?

like /break **request** and then in another line /break **accept**

Ik how to do it in a Normal command, but do slash commands allow that?

#

Such as a uh, sub-command...?

sudden geyser
earnest phoenix
#

Yep^

sudden geyser
#

Then yes.

earnest phoenix
#

Sweet! Will go follow up with the docs, ty!

sudden geyser
boreal iron
#

… and we’re still waiting for auto complete and command nesting

#

Fricking discord

quartz kindle
#

is autocomplete not released yet?

boreal iron
#

I mean in combination with nesting

quartz kindle
#

ah

#

but you can just use a text command and have your own subcommands in it no?

#

parsing the autocomplete yourself

boreal iron
#

Don’t even get what you mean by auto complete. Auto compete commands or values?

quartz kindle
#

the autocomplete interaction

boreal iron
quartz kindle
#

i mean, i never tested it, but assuming it works like i think it works

boreal iron
#

Still all commands pop up even without calling the specific sub group

#

If you have 1000 sub commands and enter the slash, have fun finding something

quartz kindle
#

thats why im saying, get rid of sub commands and parse them yourself

boreal iron
boreal iron
#

That’s at least what Discord explained how it should work

#

in the future

sudden geyser
quartz kindle
#

not if the autocomplete works the way it should

boreal iron
#

Let’s see what the future brings if Discord ever moves forward

boreal iron
sudden geyser
#

but what benefit would autocompletion bring over the built-in search for subcommands

boreal iron
#

I mean what I’m speaking about is exactly what auto complete is but built into the UI

quartz kindle
#

for example, my bot has literally millions of possible input combinations, i cant possibly use subcommands or built in autocomplete

#

if i can receive autocomplete interactions and respond autocomplete suggestions to be shown to the user, then i could make my own system entirely

#

thats what i understand from the docs

#

Autocomplete interactions allow your application to dynamically return option suggestions to a user as they type.

round cove
quartz kindle
#

what

sudden geyser
#

would be a lot cooler if it did

woeful pike
#

why would anyone want to create a new C repo/project in this day and age

proven lantern
#

can i get some feedback on this architecture for slash command hosting.

start with a routing lambda that has an api gateway attached to it that is used as the interaction endpoint url. The routing lambda looks at the request and invokes a lambda to handle that logic asyncly. (There is a separate lambda with it's own codebase and ci/cd pipeline for each command) The routing lambda then acks the request.

woeful pike
#

wait why is every command its own codebase what

quartz kindle
#

btw just tested the autocomplete interactions

solemn latch
#

seems flawless to me

proven lantern
#

the lambda that is 15MB has all the logic in it currently.

#

if i split them up then cold starts will be faster

quartz kindle
#

i mean, depending on what your commands do, thats very cool

#

you can independently host different commands for extra redudancy

#

but if your commands require looking up a centralized database, that will likely make everything slower

#

idk if they do database replication, i know cloudflare functions dont, they just cache locally

proven lantern
quartz kindle
#

yes but arent they replicated on their edge network?

#

well, not that it makes any difference

#

since its all coming from discord

proven lantern
#

i think you can pay more to do edge network stuff with dynamodb

#

but i dont really need that

#

im cheap

quartz kindle
#

it would be completely useless in this case anyway

#

in general i like your idea

#

just worried about database latency

#

also are you using free lambdas or paid?

#

because if you're going paid, they will be more expensive than a vps, so that would be another downside

#

they have their own input options

#

inside them

proven lantern
proven lantern
quartz kindle
#

depends on the scale

proven lantern
#

the lambda is in the same datacenter as the database so the latency is going to be smol

quartz kindle
#

yeah should be good enough

#

i think anything below 100k guilds shouldnt warrant a dedicated server for a database

#

but also depends on the workload

#

im still using sqlite for all my projects anyway

proven lantern
#

my setup should scale from 0 to infinity. the lambdas take almost no time to spin up so they can scale up and down super quick. they can even scale down to 0 when there is no traffic

sudden geyser
#

but are you really going to need it?

solemn latch
#

I think as a concept its worth looking into

quartz kindle
#

definitely

#

also you can scale individual lambdas depending on command usage

proven lantern
#

the lambdas and the database both auto scale

#

and i have like 15 separate databases that each scale independently

quartz kindle
#

you can see which commands are most popular based on how much each lambda is costing you

#

xD

proven lantern
#

built in analytics

proven lantern
boreal iron
# quartz kindle

Does auto complete also include a match requirement?
Meaning if you enter a value you didn’t predefine in your code you can’t send interaction.

quartz kindle
#

but its set per option

#

so you only receive them for the specific options you enable it for

#

and only when the user is typing inside that option

boreal iron
#

But can’t I force the input to match my options?

quartz kindle
#

wdym

proven lantern
woeful pike
#

cloudflare workers has like a 30x higher free tier cap

proven lantern
#

cloudflare workers looks super cool

#

the lambdas all share the same instance

#

isolates or something like that

quartz kindle
#

but cf workers are on their edge network, which is a complete waste if you only use it for discord lul

woeful pike
#

lol

boreal iron
#

Or do they pop up as option if I type?

quartz kindle
#

you dont need custom autocomplete for choices

#

they have built in autocomplete

#

thats the whole point of choices

boreal iron
#

Yeah but I want to force a 100% match of my autocomplete value

quartz kindle
#

if you enable choices, the user can only pick those choices, nothing else

proven lantern
quartz kindle
#

choices are a type of its own

#

the user cant input freely with them

proven lantern
#

yeah you can

#

it already works like auto complete

quartz kindle
#

but doesnt the interaction invalidate if the choice doesnt exist?

proven lantern
#

yeah

quartz kindle
#

so yeah

proven lantern
#

i think you cant even send the request\

quartz kindle
#

exactly

proven lantern
#

but it is still like a forced auto complete. you start typing and the choices are filtered down

quartz kindle
#

yeah its built in

boreal iron
#

What’s autocomplete even based on? Your previous inputs?

quartz kindle
#

command history is a different thing

#

what im talking about is when you are in the middle of typing a command

boreal iron
#

Wtf is it me or …?

quartz kindle
#

and it shows you available options based on that partial you already typed

proven lantern
#

i should make a command with yes and no as the choice and then have autocomplete map yes to no and no to yes

quartz kindle
#

lul

#

i dont think you can do that with choices, i mean, you can reverse the value, but the user doesnt see it until they submit

boreal iron
proven lantern
quartz kindle
# boreal iron Available options you predefine like choices?

if you enable custom autocomplete in a string option, you receive an autocomplete interaction event for every character the user types (while focused on that string option), and on each of those events, you can reply with a list of options for the user to see in their autocomplete UI

boreal iron
#

Oh… ok got it now

#

Wtf an event for any char

quartz kindle
#

yes

#

idk if its any char or if it has a small timer on it

#

but i typed abc, and got 3 events

#

but this is nothing compared to presence updates, so...

#

¯_(ツ)_/¯

boreal iron
#

Ok so love querying

#

WTF

#

Autocomplete fail

quartz kindle
#

yes love querying

boreal iron
#

live querying

quartz kindle
#

:^)

boreal iron
#

I did that after 3 chars entered live querying the database with any char entered

quartz kindle
#

yes

boreal iron
#

Turns out to be a lot of traffic

quartz kindle
#

indeed

#

so you can throttle it a bit yourself at the backend

boreal iron
#

When tausounds of users of my community panel entered stuff simultaneously

#

Ya ya I did just took a while to figure it out and notice

#

Learning by doing, you know

quartz kindle
#

for me its not much of an issue, since im using sqlite, a LIKE query on 20k rows takes < 1ms

#

and my db is smol

#

compared to yours

boreal iron
#

Just didn’t got the difference between choices and autocomplete before you mentioned the event

#

Yeah the player database which was queried was huge

#

And indexing was complicated as I had to store lots of text and JSON

#

jasons

quartz kindle
#

just tested again

#

its not every character

#

i think its one event when the user starts typing

#

and nother when it stops typing

boreal iron
#

Yeah probably a timer/delay

#

Or this one

#

Sounds interesting tbh, very interesting

solemn latch
#

I bet typing speed bots could use that

boreal iron
#

Live searching possible values to enter in my database or by using any API

quartz kindle
#

its gonna be a huge upgrade to my bot

#

since the user can select from hundreds of thousands of options

solemn latch
#

I was thinking of making a new game bot with gifs, no art or anything this time just for fun

quartz kindle
#

currently the user needs to use a separate command to find the id of an object by name

#

with autocomplete they wont need that anymore

proven lantern
#

i'll be using the autocomplete to show a list of members in the server and things like that.

boreal iron
#

Yeah compared to what I know it does, that feature seems to be perfect for you

sudden geyser
#

Sometimes it fires autocompletion multiple times without additional input

#

Which is annoying

boreal iron
#

I still want command nesting tho! I want it! I want it! I want it!!!

quartz kindle
#

could be from focusing/unfocusing on the option

sudden geyser
#

yah

#

probably

proven lantern
#

i wish each command had it's own interaction endpoint

#

and then you could move the command to a new group or subgroup without needing to update code

#

it'd be so modular

sudden geyser
#

but that's for the sake of convenience

#

you can still get modularity

#

with the current design

boreal iron
proven lantern
#

yeah

sudden geyser
#

I think most people just end up coupling the definitions and implementation (like me)

sudden geyser
#

I've been avoiding cache but that would work

boreal iron
#

At least the last response

proven lantern
#

i do this to make it modular

sudden geyser
#

are you sure you want that

#

that's a lot of files for the same category

proven lantern
#

i just make sure the command name is unique across all categories

#

then i can move it around without code changes

lyric mountain
boreal iron
lyric mountain
#

Just so you save null checking up there

proven lantern
#

i dont think that's in the standard

lyric mountain
#

Also, NOT || NOT?

proven lantern
#

where do you see these things?

lyric mountain
proven lantern
#

oh yeah

#

forgot about that code

lyric mountain
#

It can be reduced to !options.options[0]?.options

proven lantern
#

that is pretty tricky

#

so that transpiles down to 2 separate checks?

lyric mountain
#

?. is optional chaining, so if the former is null it'll also result in null

proven lantern
#

is there a quick way to see what the resulting js is?

lyric mountain
#

No idea

#

Maybe u can compile node code into raw js

proven lantern
lyric mountain
#

Optional chaining afaik will basically add a ternary there

#

Depends

boreal iron
proven lantern
lyric mountain
#

How much data will you handle, the required performance, server capacity, knowledge, etc

sudden geyser
#

any database will probably work

lyric mountain
#

There's no web databases

#

You'll always need a backend somewhere

sudden geyser
#

unless you're doing local storage on the user's device

#

in which you got powerful localStorage

lyric mountain
#

Ah yea, there's ls

#

And ss

woeful pike
#

sqlite won't work if the platform you're on wipes your filessysem after every deploy

#

but other than that the db doesn't matter

sudden geyser
lyric mountain
#

Why, don't u like to kill ur data after using it? KEKW

woeful pike
#

useful for banks and stuff

lyric mountain
#

Yeah

#

Sites will be 80% of the time frontend + backend

#

Unless u want plain static pages

#

Frontend will be only visual stuff/user interaction

#

While backend will be the number crunching part

#

Either REST or websocket

woeful pike
#

that's not necessarily true I mean you have machine learning and stuff on the frontend

lyric mountain
#

Rest = basically api, you call it answers

#

Websocket is like a phone

sudden geyser
#

assistive technology probably

boreal iron
#

Why would you need an API at all?

lyric mountain
#

To establish a communication between both ends

#

Unless u run both front and back from the same code

boreal iron
#

Put the content you fetch from your bot into a database and query it

woeful pike
lyric mountain
#

Database ops on frontend topggDoge

sudden geyser
#

One day the utopia of the browser talking directly to the database will come true

boreal iron
#

Oh he means an interactive dashboard?

lyric mountain
#

Probably

boreal iron
#

Ah ok

sudden geyser
#

except that one

lyric mountain
#

While you can, anything visible to the user is also accessible by the user

#

Keep that in mind

boreal iron
#

Thought we’re just speaking about some numbers he wanna publish he got from his bot

lyric mountain
#

Either rest or websocket

quartz kindle
#

you can share the database

boreal iron
quartz kindle
#

you dont need a connection

#

you run a webserver, and you simply open the same database in the webserver

#

for example if your webserver is node.js + express.js

#

just open sqlite in there

#

and open the same file as your bot

boreal iron
#

Pay the support invoice before!

#

By editing your zone file or dns records

#

Whatever the panel offers

lyric mountain
#

You buy domain, then assign AAAA or tf I forgot how it's called to the ip

boreal iron
#

A

lyric mountain
#

Note, freenom is big trap

boreal iron
#

Record

#

AAAA is IPv6

lyric mountain
boreal iron
#

Wtf 20$

lyric mountain
#

There're cheaper domains

boreal iron
#

Which tld?

lyric mountain
#

Check namescheap

#

www.google.14usd

quartz kindle
#

a usual .com domain costs 11-15 per year

#

org domains are cheaper

#

xyz are super cheap

proven lantern
#

I have an embed with 2 columns, but discord has 3 columns by default. I add a blank field to make sure the fields show up in two columns, but it takes up some space still and is very noticeable on mobile. is there a better way to make 2 column embeds?

            name: "\u200b",
            value: "\u200b",
            inline: true
        },```
boreal iron
#

Yeah or less if it’s a special offer

sudden geyser
#

is there a better way to make 2 column embeds?
No.

proven lantern
#

that is disappointing

#

discord why

sudden geyser
#

so you have more questions to ask us 😛

quartz kindle
#

it would be cool if discord supported markdown in embeds

proven lantern
#

oh yeah

quartz kindle
#

or at least tables

proven lantern
#

it does

#

idk about tables

lyric mountain
#

It'd be cool if discord supported markdown at all

#

Not that half baked highlighting

#

Imagine tables

proven lantern
#

content title and description support half baked markdown

boreal iron
#

Tables and horizontal lines

quartz kindle
#

imagine the rich content you would output if discord allowed sending markdown pages

sudden geyser
#

markdown tables are annoying

lyric mountain
#

Ngl I use more html tables than md ones

sudden geyser
#

would a built-in table editor look better

lyric mountain
#

Cuz better customization

woeful pike
boreal iron
#

True but simple markdown aren’t bad at all tbh

#

"We’re different, we’re easy…"

lyric mountain
#

That's what scratch said

boreal iron
#

I can’t actually speak out what I think freerealestate

#

If I don’t wanna get a mute

quartz kindle
#

xyz is quite popular

#

currently ranked #5 in popularity

#

yes

lyric mountain
boreal iron
#

Don’t take the cheapest tho

#

Look for a big provider

quartz kindle
#

the cheapest popular domain is .top

grim aspen
quartz kindle
#

at ~4.5 usd (renewal)

boreal iron
#

Godaddy also is damn good

lyric mountain
#

Sus name

quartz kindle
#

.top is ranked #9 in popularity

boreal iron
#

Some providers rely on external name service providers taking hours until a dns update is live even with a low TTL

#

Sometimes a day or longer

#

Hmm which tld do you want?

quartz kindle
#

.gg is expensive af

#

50-60 bucks

lyric mountain
#

Good game

boreal iron
quartz kindle
#

if you want cheap, go for .top .in .eu

boreal iron
#

Capitalism, you know

lyric mountain
#

.club

boreal iron
#

.net is cheap

quartz kindle
lyric mountain
#

What country is gg?

quartz kindle
#

.gg is the country code top-level domain for the Bailiwick of Guernsey.

lyric mountain
#

Glasgow?

#

Ah

boreal iron
#

Uh yeah

quartz kindle
#

best website

lyric mountain
#

There's also .wtf

quartz kindle
#

quite expensive at 21 bucks

grim aspen
quartz kindle
#

brezil

boreal iron
#

Omg

grim aspen
#

What if I just

boreal iron
#

Took me 4 years to collect all of my xxdns tld

grim aspen
#

Yoink all domains

lyric mountain
#

That's what google did

quartz kindle
#

some shitty discord bot took my bot's domain name

#

now all the good ones are taken

boreal iron
#

Lots of services buying cheap unpopular domains trying to sell them for big money if the popularity increases for similar domains

grim aspen
#

I’m planning on making my meme website redirect to my bot

lyric mountain
boreal iron
#

Like I said just took 4 years KEKW

#

But now it’s mine until I forget to pay for it

lyric mountain
#

Wasn't there a dude who bough a google domain after they forgot to renew it?

#

Then sold to them for big money

boreal iron
#

I heard about that, too

solemn latch
boreal iron
#

Sounds promising

solemn latch
quartz kindle
#

and do what with it?

#

oh i know

lyric mountain
#

Do like elgooG

quartz kindle
#

make a full page iframe to top.gg but with a color invert filter

solemn latch
quartz kindle
#

lmao

#

yeah

lyric mountain
#

Buy gg.pot

solemn latch
#

😔

lyric mountain
#

Damn

#

Potenza

boreal iron
# quartz kindle lmao

I know but once a beautiful day my ddns service gets popular if I ever build a website for it I got lots of domains for it, all tlds

#

probably never

quartz kindle
#

lel

#

i dont like buying domains too soon, because more often than not they will just sit there and be abandoned

boreal iron
#

But multiple domains from different providers are needed anyways for a redundant dns system

#

Even if only my infrastructure uses it

#

Omg I hate autocomplete

quartz kindle
#

well this one is available

boreal iron
#

Ahaha freerealestate

#

lmao

#

Take it, now!

boreal iron
quartz kindle
#

most of those combinations are already taken

#

i bought astro.watch though

#

gonna do something with it eventually

boreal iron
#

That sounds like something you can sell to the NASA

quartz kindle
#

who knows :^)

#

gotta finish my api tho 😩

boreal iron
#

I have FINALLY finished so much stuff the last days I still had to do since I moved the dedicated server

quartz kindle
#

ayy

boreal iron
#

Yeah finally some progress and some stuff being finished at all

lyric vapor
#

I need help

sudden geyser
#

Feel free to ask a question about it

errant flax
#

any suggestions on how i can i add a delay on a loop?

earnest phoenix
errant flax
#

js

#

wait nvm i think i found the solution
weirdsip

earnest phoenix
#

You can work with promises:

// Declare a function to return a promise which will lock the code execution until the promise is resolved when you await it, this can be used outside a function but we're doing for the sake of readability and usability in other files or areas as well.
function wait(milliseconds) {
  return new Promise((resolve) => {
    setTimeout(resolve, milliseconds);
  });
}

// Now with the `wait()` function we declared, we can add a delay in-between iterations, remember that have to use the `await` keyword for that to work properly, which can only be used in the top level of modules and in async functions.
for (...) {
  // Some code here.

  // Wait 5 seconds before going into another iteration.
  await wait(5000);
}
errant flax
#

lmao

earnest phoenix
#

yea, you did; just explaining it mmLol

errant flax
#

lolz

eternal sierra
#

hey guys

#

i am just starting out to create my own bot in python, but it seems that i have an issue with ti, can anyone help me out

#

kek

solemn latch
#

token leak, please reset your discord bot token

eternal sierra
#

why is this module thing not callable?

#

ohh sorry ok

solemn latch
#

otherwise other users will have access to your bot

eternal sierra
#

done !

#

now its ok i guess

#

help me out guys, if anyone knows how..

sudden geyser
#

commands.bot is a module

#

like a namespace

#

or something that groups other stuff

eternal sierra
#

ohh

#

so what should i do now

sudden geyser
#

You should capitalize bot

eternal sierra
#

ohh tysm bro

#

lemme try it and let you know

sudden geyser
#

At the same time, are you using Discord.py, or some fork of it, like nextcord?

eternal sierra
#

im using visual studio thingy and ig i am using discord.py coz i installed it in my tetminal

#

the files needed for discord

sudden geyser
#

Although you seem to be new, you may want to use something else like Pycord or Nextcord since Discord.py has been deprecated.

eternal sierra
#

oh

#

btw klay is pylance something like that?

#

like pycord or nextcord

sudden geyser
#

Nope

eternal sierra
#

ohh

sudden geyser
eternal sierra
#

yea i am using that in my VS so got confused with em lol

#

help me how to use pycord bro, imma better dm u

#

if u have no prblm

sudden geyser
#

It's more convenient to ask your questions here so others can help you.

eternal sierra
#

kk

#

then help me out with using pycord bro

#

what should i do

#

i am using linux btw

sudden geyser
#

I haven't used it myself, but I've used Discord.py.

eternal sierra
#

ohh lemme check it

#

hey bro btw the code seems to be right now

#

but bot isnt online yet

sudden geyser
#

If I had to assume, that's due to a bug in your code (<#development message>). client.run(...) is indented under the on_ready function, which is wrong, as it won't be called until your bot starts (which client.run(...) does, but that won't be called in its position).

The solution? De-dent it (remove the space behind it) so it sits at the top-level.

#

Python uses indentation to determine scope.

eternal sierra
#

ohhhh

#

ahh man thanks a lot, it worked!!

#

if any doubt i will post it here then!!

earnest phoenix
#

this is why im never using python

sudden geyser
#

I don't get why people complain about indentation

#

You'd still indent it regardless

earnest phoenix
#

iife

#

arrow functions

sudden geyser
#

lambda

#

IIFE sucks imo

#

JS is the only language I know that uses such a pattern.

earnest phoenix
#

it always runs in a different scope so it won't interfere with other scripts

#

which is why every single module bundler uses iife instead of directly outputting the code

sudden geyser
#

The only thing I've seen it used for is top-level async/await

#

How's it any different than a named function you may only call once

earnest phoenix
#

var (minified variable name) = Object.someFunction

#

every bundle has this

#

which can cause interference

slender thistle
#

If you know your shit it's not a problem

lament rock
#

I just stay in my own lane and let people suffer in their own ways. Not to say I'm not suffering from my language choices

stray gulch
#

I'm going to hate myself for trying to train a neural network for wakeword huh

#

getting the data is... interesting

split hazel
#

you also never know if you have enough or don't have enough

#

you have to kind of guess

eternal sierra
#

whats the error in this

earnest phoenix
#

Indentation, wrong init naming, wrong thing to inherit, wrong object to get the listener attribute from

woeful pike
#

are any of yall doing advent of code

quartz kindle
#

wuts that

simple bough
#

...

earnest phoenix
#

Some challenges I guess

novel jetty
#

Anyone know how i can fix this?

hollow depot
delicate zephyr
delicate zephyr
#

because the type is like text,voice

#

nsfw is a boolean

#

but DM's dont hold that

hollow depot
rustic nova
#

Yupyup

earnest phoenix
lyric mountain
#

dms are never nsfw

earnest phoenix
#

@rustic nova

lyric mountain
rustic nova
#

-upto

gilded plankBOT
#

The average up-to-date approval times are stated [here](#support message).

This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.

There is no exact time for how long bot approval will take.

There is a queue and you're not first, nor are you last.

Read more about our reviewal process here.

earnest phoenix
lyric mountain
#

read the embed above

novel jetty
#

@lyric mountain I somehow got it but im stuck here, i tried pretty much everything but cant seem to be able to fix

rustic nova
#

Not related to me, but probably message.channel

lyric mountain
#

you didn't define channel

hollow depot
#

or let { channel } = message

novel jetty
lyric mountain
#

dm cant have guild

novel jetty
#

Its not a DM

lyric mountain
#

it is

#

add if (channel.type === 'DM') return; above that line

#

I mean, that's how I think it is to check if it's dm

novel jetty
#

I see

#

Thanks

quartz kindle
#

type casting

#
if(message.channel.isText()) {
  const channel = message.channel as Discord.TextChannel
}
#

or const channel = <Discord.TextChannel>message.channel

novel jetty
#

Thanks!

#

It worked!

earnest phoenix
#

cring

quartz kindle
#

its not a getter?

earnest phoenix
#

Should i lie to my verification assigned person and say that i made it for 30d or I actually implement it? It's too hard and there isn't a straight way to do it as you guys said to me

#

he can't accept it for 1y (a lie that i made it for 1y)

#

and has to be 30d

#

this is the thing to implement

earnest phoenix
#

yeah i wouldn't too

#

but i already did it with a person's advice so i can't say him straightly that i lied

#

any advice?

spark flint
#

just say that you've reconfigured how the data is stored

#

and it auto deletes after 30d

earnest phoenix
#

that's a lie (?)

spark flint
#

true

earnest phoenix
#

i'll say it anyways

#

and see

#

¯_(ツ)_/¯

#

or if you have better advice

boreal iron
#

Store the data for 30d only?

earnest phoenix
#

nope

#

store the data forever but if the user leaves the bot (entirely and doesn't have it in any mutual servers) delete data after 30d

boreal iron
#

What's the issue of adding a "last_seen" or "last_usage" timestamp to your data and add a routine removing that data after 30d?

earnest phoenix
#

that's not the thing

boreal iron
#

doesn't explain why you can't remove the data... as long as user is associated with your bot, not data deletion is required, if he's not anymore, delete the data after 30d

earnest phoenix
#

how to check if the user is not in any server with the bot

boreal iron
#

As I explained above add a user last seen/usage timestamp to your data storage, a routine clearing users after 30d but actually before removing the user data, fetch the user to check if he's still associated with your bot - if so don't remove it, if not remove it

earnest phoenix
#

he's still associated with your bot

#

fetch always gives you a user's basic info how do i check that? All is done like 1 week ago the thing is the mutual servers or if the user is associated with the bot check

boreal iron
#

By fetching the guild member the user is associated to to check if he's still a member of that guild(s)

#

Which does require to save all guild IDs of an user using your bot's commands in your database

#

which shouldn't be a big deal if you wanna deal correctly with the user data

earnest phoenix
#

my brain: ^

boreal iron
#

Ok step by step...

#

When do you begin to store any user data in your database?

#

If an user enters a guild (member intent) or if an user uses your bot's commands the first time?

earnest phoenix
#

tim said that

earnest phoenix
boreal iron
#

Alright. Just store the guild ID(s) in your database.

earnest phoenix
#

how

#

all the guild ids?

boreal iron
#

Just the guild IDs the user has used a command in

earnest phoenix
#

ok

boreal iron
#

Without fetching all guild members (without the intent) it's impossible to check if a user is still a member in a guild of your bot

earnest phoenix
#

and then?

boreal iron
#

But that's not important

earnest phoenix
#

then I ask for the intent in ticket?

boreal iron
#

If he's not a guild member of the guilds he has used your bot's commands in (for 30d) data deletion is justified

earnest phoenix
#

so if I use the bot in a server and then in another and leave in one and I stay in another, the bot will delete data anyways?

boreal iron
#

Nah as I said, after not using any command for 30d, you gonna check if the user is still a member of the guilds you store in your database, and if so do nothing, if not delete the user data

#

I don't see an easier way if you wanna deal correctly with the user data

#

Except just saying you do...

stray gulch
#

So I'm just collecting stuff atm

quartz kindle
# earnest phoenix so if I use the bot in a server and then in another and leave in one and I stay ...

example:

on member join (or on first command), add user data to database, with a list of guilds, for example { userid: id, guilds: [guildid here] }
when the member joins another guild, check if the user already exists, it it does, add the new guild to the list: { userid: id, guilds: [guild1, guild2] }

when a member leaves, remove the current guild from its list: [guild1, guild2] -> [guild1]
when you do this, check if the list becomes empty. if the list is empty, for example [guild1] -> [], then delete the user

boreal iron
#

That would require the member intent tho

quartz kindle
#

no?

boreal iron
#

At least the part of knowing if a member left a guild

quartz kindle
#

ah yes

#

if he doesnt have the intent, then there is no way of checking

boreal iron
#

You explained almost the same I did

boreal iron
#

After not seeing the user for 30d, fetch the guild member object of the guilds stored in your database the user is in

delicate zephyr
#

I mean

#

that use case would require member intent

boreal iron
#

If he's still in a guild, no deletion is required

delicate zephyr
#

you could just apply for it

#

they'd likely give it for that

boreal iron
#

If he's not, delete the data

delicate zephyr
#

they'll likely give it for that as it's hard to implement without especially at scale

boreal iron
delicate zephyr
#

no

#

but its not scalable

#

at all

#

you'd hit global ratelimit after having to check 60 users lol

#

unless you did like 1 user per second

#

which isnt really efficient

#

the intent would make more sense

#

since you get it directly from the gateway

boreal iron
#

That’s about right but I doubt the users using commands at the same time, then not for 30d for example, will all need to fetched at the same time

#

That may get an issue if the bot is really in 100000s or millions of guilds I assume

delicate zephyr
#

doesn't really matter, but after a certain scale you will hit that limitation

boreal iron
#

Yeah that’s for sure

delicate zephyr
#

even with 2k guilds you could hit that limitation

#

there's too many factors at play that would risk API Ratelimits, which means it's more of a risk to implement it like that

#

not saying your idea isn't right, just logically it wouldn't make sense to use it if you want to build for scale

boreal iron
#

I mean djs should do queueing the requests for him anyways

#

It could just end up in a short delay before the deletion happens

delicate zephyr
#

Yea, but still not really scalable at all

boreal iron
#

But yeah the intent is the easier solution here

delicate zephyr
#

especially considering you have more than just those requests happening

#

nearly* all api requests count towards the global rl

#

send messages, fetch guilds, fetch user etc

boreal iron
#

Let’s agree to the fact that is plan B if the intent gets rejected for some reason

delicate zephyr
#

yea

#

it's a good alternative

#

just should be last resort

boreal iron
#

If he wants to deal correctly with the user data

delicate zephyr
#

ye

wheat mesa
#

Can data be saved permanently if the user has an easy way to request a deletion of it?

#

Seems like something discord would approve of

urban moon
#

i
just started discord.js
its showin
this

Error: Cannot find module 'node:events'

can anyone help?

split hazel
#

I doubt they'd care but pretty much all data protection laws request the data has some kind of expiration date

earnest phoenix
delicate zephyr
#

the fact i have this bookmarked

#

lmfao

split hazel
#

time to lie about deleting the data

delicate zephyr
#

Although the general rule is that you cannot hold personal data indefinitely ‘just in case’ it might be useful in future, there is an inbuilt exception if you are keeping it for these archiving, research or statistical purposes.

You must have appropriate safeguards in place to protect individuals. For example, pseudonymisation may be appropriate in some cases.

This must be your only purpose. If you justify indefinite retention on this basis, you cannot later use that data for another purpose - in particular for any decisions affecting particular individuals. This does not prevent other organisations from accessing public archives, but they must ensure their own collection and use of the personal data complies with the principles.

split hazel
#

I'll send the data to Russia

#

unless they have similar laws

delicate zephyr
#

You'd have to abide by that regardless lol, since you store data for users outside of russia

jolly notch
delicate zephyr
#

You shouldnt be storing them fully

#

at all

jolly notch
#

just address and name and that

delicate zephyr
#

I mean

#

you simply answered your own question with a single word

#

insecure

jolly notch
#

We haven't been hacked yet so like it works

delicate zephyr
#

thats

#

not the point

split hazel
#

get another company to handle that so when they have a data breach you have nothing to do with it lmao

delicate zephyr
#

You know you can be fined hundreds of thousand for a databreach right

#

most companys that arent huge that get hit

#

go bankrupt

#

or just cease existing

jolly notch
#

oh

#

welp not my company

split hazel
#

I'll go make my company limited and purposefully get fined

#

then I'll laugh

sudden geyser
#

For example, I wouldn't want to delete a user's account because some guy at the GDPR thought they were inactive for too long

delicate zephyr
sudden geyser
#

So there's no explicit time limit

#

But still want you to keep it for as short as possible

delicate zephyr
#

ye

sudden geyser
#

Seems more targeted towards analytics/short-lived data like a command usage

#

But long term data like accounts can exist forever

delicate zephyr
#

^^

#

yea

jolly notch
#

But then any data a bot holds shouldn't really be deleted as I may leave a server being level 86 and come back a few years later expecting to have the same level unless the server reset it

(websites are different)

simple stump
#

When attempting to register slash commands and running node deploy-commands.js, I get the message, “Successfully registered application commands.” But the commands don’t appear in the server.
Code: https://sourceb.in/nJ5yRstSKQ

boreal iron
#

As I already explained yesterday, get rid of that fucking code copied of the djs guide, it's trash, trash, trash

#

Registering commands over and over again is nonsense, not to say bullshit

#

Also registering global commands can take up to an hour until they're pushed to all guilds

#

That's the reason they don't appear in the guild

#

And registering them over and over again will always cause the same issue and can end up with multiple commands with the same name show up and all interactions will fail

lethal trout
#

if (data) data.delete();

simple stump
lethal trout
quartz kindle
#

how are we supposed to know? its your code

#

you need to figure it out, first of all console.log(data) to see what it is

boreal iron
sullen tartan
#

Did anyone has a Slash Command Handler for me?

spark flint
#

find one online

sullen tartan
#

I don't find one online

spark flint
sullen tartan
#

I don't want to install packages just for Slash Commands

quartz kindle
#

make your own like everyone does

boreal iron
#

I wonder what's so difficult to make your own? Nothing different to a common command handler...

novel jetty
#

Is there anything wrong with this code?
Even though the channel is NSFW, the bot says that its not

#
if(!message.guild) return
    let { channel } = message
    if (channel.type === 'DM') return;
    var errMessage = "This is not an NSFW Channel";
    if (channel.isText() && channel.guild.nsfwLevel !== 'AGE_RESTRICTED') {
      message.react('❌')

      return message.reply(errMessage).then((msg) => {
        setTimeout(() => msg.delete(), 3000);
      });
    }
tulip ledge
#

the guild.nsfwLevel checks if the guild is age restricted, not the channel

spark flint
#
app.post("/deltodo", async function(req, res) {
    console.log(req.body)
    const userId = req.body.userID
    const todoId = req.body.todoID
    users.updateOne({
        _id: userId
    }, {
        $pull: {
            todos: {
                todoId: todoId
            }
        }
    })
    res.redirect("/todo")
})```
#

why doesn't that save any data to the db

split hazel
spark flint
#

const MongoClient = require('mongodb').MongoClient;

#

that

#

I usually use MySQL but we're using Mongo for this project

split hazel
#

what is $pull supposed to do?

spark flint
#

@solemn elk

#

you help lol

#

its your part of the code i'm working on

split hazel
#

im not too experienced in advanced mongo syntax but I'm sure an update query shouldn't require that?

grim aspen
#

It’s pulling the information needed to a table

split hazel
#

would be easier to know what exactly the code is trying to achieve

spark flint
#

its meant to delete the todo id from the database

split hazel
#

delete the attribute or the document

spark flint
#

no idea how lol

#

scoopy is dead so i can't ask him lol

split hazel
#

that was a question

spark flint
#

oh

#

brb gonna login to mongo

split hazel
spark flint
#

will do

spark flint
#

how would i remove todoId 788

#

using NodeJS mongodb?

delicate zephyr
#

lol

spark flint
#

not for what i'm using it for

delicate zephyr
#

Ah

spark flint
#

when you click the "Mark as complete" button it needs to remove it

#
users.updateOne({
            _id: userId,
        }, {
            $pull: {
                todos: {
                    todoId: todoId
                }
            }
        })```
#

thats my current code

old pebble
#

hi, someone know hot to get member info in JS for a dashboard ? I make it in python, but in JS I understand nothing ,-,