#development

1 messages · Page 113 of 1

boreal iron
#

physical pain growing inside of me

grim aspen
#

fixed, too many packages that the system just breaks down

surreal sage
#

*place silly word here*

real rose
surreal sage
#

i have a question about mongodb

#

I am trying to query in a collection

#

to find ofc

#

and I basically get a bunch of query fields from a discord app. command

#

And all those query fields from the command are optional

#

now I'm not sure what to put in the query if the value wasn't given in the command

#

like /search _id:asdfjasdf

#

then { _id: "asdfajdf" }

#

but what if it just was /search

#

mongo would just fill undefined in

#

I'm trying to not have it do that

final verge
#

Maybe before adding it to db check the value?

#

What does your code looks like

surreal sage
#

Mongoose

#

The user passes in the query in the command's options/arguments

final verge
#

I usually code in python but maybe try the equivalent in your language of

if command.options.get("id")==None:
id: whatever you want 
else:
_id: command.options.get("id")?.value```
#

If that's even possible

surreal sage
#

guess i'll add the keys to the query if it's in the options

wooden ember
#

yeah that was an issue where the connection died entirely and the bot had to be restarted. that issue only happened when the bot was in a vc over night. this is after a minute and the bot just needs to be kicked and rejoined to fix it.

#

ah nice I will try that now

#

where in the UK do you live over here near wales its like £100 for one gig. whats more is we do use plussnet and we pay £20 for 10Mbps. well we are suposed to but since we still have adsl its 3Mbps and thats so low that they have to discount what we pay so our internet is like £6 atm

#

though we did have a cold snap like 5 months ago and it was -15*C abouts and because of that our internet was 5Mbps for a couple days

wooden ember
wheat mesa
#

@lyric mountain is there any decent way to render things behind one another other than sorting them and rendering in that order?

#

I’m trying to add a layering system to my engine so you can specify depth easily, but I’d rather not sort based on depth every time

lyric mountain
#

uhh

wheat mesa
#

Unless that’s the only option

lyric mountain
#

well, you can't really "render behind" since a pixel can only have one value

wheat mesa
#

Yeah

#

I would have to change my ECS 😭

lyric mountain
#

but u can use different blend modes based on Z index

#

tho I really dont know if it'd even work

#

a thing u can use is a treeset

wheat mesa
#

This is where I wish I could just tell the GPU “hey here’s some depth render it so it comes out right” and someone else could do the optimization for me

lyric mountain
#

then render based on encounter order

wheat mesa
#

I’ll have to test treeset’s performance

#

Unfortunately it’s probably going to be worse than hashset for sure

lyric mountain
#

not really, it just uses more space

wheat mesa
#

I also have to figure out a way to properly sort them anyways, because not every entity in the ECS is going to have depth

lyric mountain
#

treeset still uses hash

wheat mesa
#

Algorithmically it’s worse though

#

O(1) vs O(log_2(n))

lyric mountain
#

like, have various layers and render only entities that belong to that layer

wheat mesa
#

Yeah

lyric mountain
#

but that means sacrificing some memory

#

as you'll need to keep a set for every layer

wheat mesa
#

Pfft I couldn’t care less about memory, I just care that it doesn’t lag a ton

lyric mountain
#

Map<Integer, Set<Entities>>

wheat mesa
#

Yeah that’s fair for my engine I probably wouldn’t need many layers anyways

#

Maybe like 5 or 6 at the very most

lyric mountain
#

so when looping ```java
for (int i = 0; i < maxLayers; i++) {
for (Entity e : entities.get(i)) {
...
}
}

wheat mesa
#

I suppose that could work

#

It would be a bit of a hassle for my use case but I might be able to make it work

lyric mountain
#

wont be O(n^layers) as not all layers will have the same amount of entities

lyric mountain
wheat mesa
#

Nah but I’ll be modifying the entities within them

#

Actually I’m stupid

lyric mountain
#

well, just use whatever method u have already

wheat mesa
#

Ignore me

#

Yeah lmao

#

To think that I’m literally in CS class right now and I thought that would cause a CME

lyric mountain
#

lmao

spark flint
# wooden ember where in the UK do you live over here near wales its like £100 for one gig. what...

This is a company called https://zzoomm.com/ but I can't get it where I live. Virgin (I also can't get) offer 1gb for £40ish a month. I am on BT with their new full fibre, getting 900mbps (soon when they install it) for £43 ish a month

Reliable Zzoomm Full Fibre broadband with speeds from 150Mbps up to 2Gbps starting at £19.95pm. Rated Excellent on Trustpilot.

#

this is the west midlands

wooden ember
#

oh nice

#

there is a company called gigaclear and there is a fibre line going right nect to my house

#

however inorder to get a surveyor to get info on digging a conduit to the house from the road you have to set up direct debit and I'm not doing that

spark flint
#

ah

maiden gazelle
#

how can i make this for mutlitple words this is not working

#

on line 955

lyric mountain
#

well that'll not work ofc

maiden gazelle
#

i noticed that xddd

lyric mountain
#

you need to use an array for that

#

let testWords = ["test", "test2", "test3"]

maiden gazelle
#

ah okay

deft wolf
#

I would do it with array and then just do array.includes(msg)

lyric mountain
#

just note that it'll not match test abc for example

#

for that you need to process the input first

maiden gazelle
#

id dit not workpepowot

lyric mountain
#

yes and it's the same as the guild's id

maiden gazelle
#

if(array.includes(testWords)) { etc

#

like that

lyric mountain
#

yes

#

but not array

#

since ur variable isn't called array

maiden gazelle
#

testWords.includes

spark flint
#
testWords.some(word => message.content.toLowerCase().includes(word))```
#

that should work

lyric mountain
#

any returns the match, some returns a boolean

spark flint
#

that should work

lyric mountain
#

startsWith

#

string always

#

(discord) ids should never be used as a number else you might face precision issues

maiden gazelle
spark flint
#

awesome

grim aspen
#

the correct bitfield for the VIEW_CHANNELS permission is VIEW_CHANNELS (with an 'S' at the end). The full list of other Discord permission bitfields can be found in the Discord API documentation.

#

which library for the string?

maiden gazelle
#

is this going to work

#

oh shi

grim aspen
#

ye

quartz kindle
#

lel

grim aspen
#

make sure to check if the message contains the advertisement before deleting the message

maiden gazelle
#

its not 😦

grim aspen
#

can you give the error?

maiden gazelle
#

i dont got a error

#

didn't*

#

you want me to send my messageCreate event in sourcebin

grim aspen
#

yes

maiden gazelle
grim aspen
#

maybe it doesn't have message permissions

#

is it deleting messages

maiden gazelle
#

no

deft wolf
#

Why it's antilink_?

grim aspen
#

missing message deletion permissions

maiden gazelle
#

it got admin perms xd

grim aspen
#

first off do not ever give it administrative perms

deft wolf
grim aspen
#

second off there's a manage_message permissions

maiden gazelle
deft wolf
#

How do you save it in the database then?

grim aspen
#

i think it's the second line of code block

maiden gazelle
#

exactly the same as i get it but instead of db.get its db.set

hushed robin
#

you need to await interaction.guild.channels.create

deft wolf
#

But there is a difference between _ and -

hushed robin
#

or you can do something like
interaction.guild.channels.create(...).then(channel => channel.send(...)) i think

deft wolf
#

First, just test if the code itself works without this whole enabled. Then add a enabled to it. If by some miracle the code stops working then you will be sure that something is wrong with the database

maiden gazelle
#

my db is working bc all my other commands using my db are working

deft wolf
#

But check first if the code the guys gave you works

maiden gazelle
#

dam

#

thats true

quartz kindle
#

technically sending someone a dm means youre giving them permission to have that info

#

its not a privacy breach, its willfull sharing

earnest phoenix
#

It's fine honestly

#

Doesn't make sense but not privacy breaching

deft wolf
#

You'd have to be quite an idiot to do something like that. I understand you can save links, but not passwords

quartz kindle
#

its a breach of you later share it without permission tho

hushed robin
#

whats the point in logging all bot dms tho uhh

quartz kindle
#

but as long as only you read it, its fine

maiden gazelle
quartz kindle
#

always try to make it as dumb-proof as possible

#

because people are dumb

grim aspen
#

it's still risky

quartz kindle
#

mega dumb

hushed robin
#

true

#

people should make things more dumb proof

grim aspen
#

yeah and try telling that to people who dumb things

quartz kindle
#

they are great testers tho

#

you always find something to fix because someone was dumb enough to try something that makes zero sense

hushed robin
#

my bots support channel is dead because everyone who uses it isn't dumb

quartz kindle
#

i had to change a lot of my bots error messages

#

to be super explicit in telling the user what they did wrong, and how to do it right

hushed robin
#

sounds like a lot of work uhh

quartz kindle
#

and sometimes its still not enough lol

maiden gazelle
hushed robin
#

yes

#

i am a verified bot developer

quartz kindle
#

surprisingly

#

:^)

hushed robin
#

bruh

maiden gazelle
#

mine is pending for request but they have that kind of bug atm

hushed robin
#

no

#

thats fixed

#

i think

quartz kindle
#

what bug

hushed robin
#

there was a bug where

#

verification and intent applications were getting "lost"

quartz kindle
#

weird lol

hushed robin
#

it was fixed like 6 days ago

quartz kindle
#

discord being discord

hushed robin
#

dance yup

spark flint
#

wut

grim aspen
#

discord doing server maintenance:

spark flint
#

wut

#

i log dms for the bot in combat warriors

#

we get a lot of people dm it for help stupidly

#

its their fault if they send a password in DMs

hushed robin
#

i like sending stuff in bot dms

#

good way to store stuff

wheat mesa
#

lmao

grim aspen
#

yeah battleless likes to terrorize the bots

hushed robin
#

bruh

wheat mesa
#

Just have a server that’s you only…

hushed robin
#

it's a robot

hushed robin
wheat mesa
#

That’s what I do

hushed robin
#

i did that once and invited a bot from top.gg

#

and the owner instantly joined the server

wheat mesa
#

I don’t send ANYTHING private there though

hushed robin
#

was kinda scary

grim aspen
#

BuT BoTs HaVe FeElINgS

wheat mesa
#

I don’t trust passwords in any sort of raw text form on an internet application

hushed robin
#

tbh they should make it so you can see a bots intents before inviting it

wheat mesa
#

They…do…

grim aspen
#

wtf

hushed robin
grim aspen
#

AH HELL NAH

wheat mesa
#

Literally right in front of you when you invite the bot and it says “this bot has permission to…”

grim aspen
#

do you want bots to be invited to your discord without you knowing what it will have access to?

grim aspen
#

and i missed that

wheat mesa
#

Scopes and intents are pretty much the same thing in this context

grim aspen
#

what he said

hushed robin
#

no

grim aspen
#

no?

hushed robin
#

yes no

#

how are they the same in this context uhh

grim aspen
hushed robin
#

my guy

#

i know what a privileged intent is

grim aspen
#

explain it then

hushed robin
#

Gateway Intents were introduced by Discord so bot developers can choose which events their bot receives based on which data it needs to function. Intents are named groups of pre-defined WebSocket events, which the discord.js client will receive. If you omit DirectMessageTyping, for example, you will no longer receive typing events from direct messages. If you do not specify intents, discord.js will throw an error.

#

privileged intents are the same thing except you need approval for them after verification uhh

grim aspen
#

there we go

#

something not even right

hushed robin
#

what

grim aspen
#

they aren't the same

#

two different concepts

hushed robin
#

what aren't

grim aspen
#

intents and permissions

hushed robin
#

i never said they were uhh

quartz kindle
#

privileged intents will show up in the bots list of things it can do

#

for example "this bot can read channel messages" or something like that

hushed robin
#

it doesn't

quartz kindle
#

non provileged intents will not show because its not needed

grim aspen
#

bruh

hushed robin
#

i don't see that here

digital swan
#

on the bots profile

#

it tells you

hushed robin
#

yes thats after inviting it

#

read the context of this conversation uhh

digital swan
#

if youre that concerned why would you invite a bot you dont trust in the first place

hushed robin
#

i'm not concerned

#

it would just be nice to see the intents it have before inviting it

#

or privileged ones ig

quartz kindle
#

its a good idea tbh

#

but

#

not using the term "intents"

hushed robin
#

yeah non developers probably won't understand it

quartz kindle
#

because the invite information is for users, not for developers, so it has to ne user friendly language

grim aspen
#

they should have a battleless friendly language

hushed robin
#

why

opaque acorn
#

anybody had an error with mongoose?

earnest phoenix
#

anybody had an error in one of their typescript files?

boreal iron
#

imagine using typescript

opaque acorn
#
          const err = new MongooseError(message);
                      ^

MongooseError: Operation `cmds.findOne()` buffering timed out after 10000ms
    at Timeout.<anonymous> (Z:\RAILBANG\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:175:23)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
deft wolf
#

Everything works fine on my VPS poggythumbsup

#

And seriously, it can be due to either a poor internet connection or trying to get something from the database before it is properly connected

#

This topic has been discussed here before and there was even a link to stackoverflow somewhere

boreal iron
#

Don't u need to whitelist the source ip connections are coming from for this type of online database?

deft wolf
#

Here is a link related to this problem

opaque acorn
#
            return new error_1.MongoNetworkError(err);
                   ^

MongoNetworkError: connect ETIMEDOUT ip:port
    at connectionFailureError (Z:\RAILBANG\node_modules\mongodb\lib\cmap\connect.js:387:20)
    at TLSSocket.<anonymous> (Z:\RAILBANG\node_modules\mongodb\lib\cmap\connect.js:310:22)
    at Object.onceWrapper (node:events:628:26)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  cause: Error: connect ETIMEDOUT ip:port
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
    errno: -4039,
    code: 'ETIMEDOUT',
    syscall: 'connect',
    address: 'ip',
    port: port
  },
  connectionGeneration: 0,
  [Symbol(errorLabels)]: Set(1) { 'ResetPool' }
}

even better now

grim aspen
#

ip leak?

opaque acorn
#

but if u want

grim aspen
#

it sounds like it timed out

opaque acorn
grim aspen
#

hence ETIMEDOUT

#

This error typically occurs when a connection cannot be established to the MongoDB server. This could be due to one of several reasons such as the server being down, network problems or incorrect login credentials provided. You could try the following steps to resolve this error:

Check if the MongoDB server is up and running
Ensure that you have provided the correct login credentials
Check the network connection to the MongoDB server
Try restarting the MongoDB server

found online

topaz terrace
#

why cant vm boot into the file

#

this is the iso file

#

maybe im stupid about os

#

oh

#

wait

maiden gazelle
#

Hey they finally verified my bot but I don't see a that check mark think after my bots name

rustic nova
#

Give it a day or two

#

If it doesn't ask you about verifying on the dashboard, you're aight

maiden gazelle
#

It does

#

It's still saying this

deft wolf
#

It will be added some time after your bot has been verified by discord

#

It's the same with the app directory. There, the bot category is also assigned by discord based on your bot's description

crystal wigeon
#

Hey is there any recommended query builder lib for postgres in python?

#

that supports migrations and all

lament rock
#

make your own

#

I made my own ORM that batches statements together

crystal wigeon
lyric mountain
#

@wheat mesa added new stuff

#

training in this case is practicing against one specific enemy

#

I REALLY need to optimize my hit checker tho

topaz terrace
#
        const message = msg.update.message;
        const swearwordTest = await openai.createCompletion({
            model: "text-davinci-003",
            prompt: `Does the following message contain any swearword?\n\n${message.text}\n\nReply with "no" if you're not sure that the message contains a swearword and reply with "yes", if you're sure.`
        }).data.choices.text

        if (swearwordTest.replaceAll("\n", "").toLowerCase() === "yes") {
            console.log('a')
        }``` why is this saying that data.choices is not a thing
lyric mountain
#

but cant find a way to do so without iterating

topaz terrace
lyric mountain
topaz terrace
#

why is it undefined

#

im using telegraf with open ai to check if a message has a swear word

lyric mountain
#

print the thing before it

#

like, before data

topaz terrace
#

ok

lyric mountain
#

what about the rest of it?

topaz terrace
#

it have my open ai key

#

cant show that

#

i searched for data in it

#

theres none

lyric mountain
#

edit the image to remove it

topaz terrace
#

but theres one in config

lyric mountain
#

like, draw a line over it

topaz terrace
#

i have sent it into your dms

earnest phoenix
topaz terrace
#

yes

earnest phoenix
topaz terrace
#

whats that sh

earnest phoenix
#

its owned by fb but its great

lyric mountain
earnest phoenix
topaz terrace
lyric mountain
#

not that

#

the very last field

topaz terrace
#

oh

earnest phoenix
#

train it enough data and its good as fuck

lyric mountain
#

it has a property choices, I suppose your answers are there

topaz terrace
#

ok

neon leaf
#

you need to json parse it

lyric mountain
#

it's already a json obj

topaz terrace
#

what

lyric mountain
#

else it'd not be like this

#

jade put () around the request

topaz terrace
#

ok

lyric mountain
#

(await ...).data.choices[0]

#

see if it works

neon leaf
topaz terrace
lyric mountain
#

well, there's ur answer

topaz terrace
#

why is it only saying no

lyric mountain
#

because it said no

topaz terrace
#

when i said a bad word

earnest phoenix
#

because that's called AI

#

and that's why you shouldn't rely on it

topaz terrace
#

Ai

lyric mountain
#

lul, well, also depends on what it considers a bad word

earnest phoenix
#

but rather use proper services made for it

lyric mountain
#

instead, ask it to say if it's a curse word

earnest phoenix
#

as Reis already mentioned as well

earnest phoenix
#

no need to bump both of your messages that are literally following each other KEKW

topaz terrace
crystal wigeon
topaz terrace
#

i cant understand this docs

crystal wigeon
#

i still got no answer

#

pls

topaz terrace
deft wolf
topaz terrace
#

oh

#

wow

#

it needed admin perms

#

time to add a command to add hw

deft wolf
#
text: `cum`

👀

topaz terrace
#

oh

#

totally not sussy

#

being used for testing

#

wait, how do i add something like this

#

my brain doesn't work with the documentation

deft wolf
#

I have no idea what it's called correctly but it's some kind of keyboard on telegram

deft wolf
topaz terrace
#

wow

#

thank

#

but how do i reply with it

#

for example

#

if i add a keyboard thingy

#

how do i listen for it

#

wait

#

how do i add options?

olive acorn
#

A

deft wolf
# topaz terrace how do i listen for it

Probably the same as normal commands. The keyboard simply allows you to send chat messages more easily. It's basically like a slash command on discord would just send a text command and you would run it like a normal text command

topaz terrace
#

oh

gusty linden
#

Would my bot Get declined it can advertise minecraft servers not discord I think and it only does it when the server has a channel and you have a channel to send ads in?

It limits the ads you can send by 1 hour cooldown time

deft wolf
topaz terrace
#

nvm

surreal sage
#

This one's about Discord embeds

#

fields: [
  {
    "name": "a",
    "value": "b",
    "inline": false
  },
  {
    "name": "a",
    "value": "b",
    "inline": true
  }
]```
#

Would this be 2 next to each other anyway?

topaz terrace
#

bruh 💀

#

when i say the swear word in a sentence

#

it said no

boreal iron
surreal sage
#

Righty ThumbsUp

topaz terrace
#

how do i check for the homework message?

surreal sage
#

What?

#

the homework message?

topaz terrace
#

yes

#

for example

#

if they picked the morning option

#

it would send

#

"Morning"

#

and then the bot will listen for it

#

after the bot got the signal

#

it would reply

gusty linden
#

AYO Bros tryna make a bot for schools

topaz terrace
#

"What's the homework for the morning class?"

surreal sage
#

Discord.js?

topaz terrace
topaz terrace
#

:what:

surreal sage
topaz terrace
#

and then the bot would add that thing to the db

#

but how would i know which one is the homework?

lament rock
#

Create a message collector

#

although messages unrelated can be sent so its up to you to filter what's relevant and what isn't

#

but natural language processing is very tedious

topaz terrace
#

ok

#

how do i define the session state?

#

this is generated by ai too

#

i wanna know how it do it

lyric mountain
#

dont rely too much on ai

topaz terrace
#

ik

#

wait

#

i tried using maps

#

but how do i

#

like

#

wait

#

how do i filter stuff thats in an array and that stuff is an object?

#

for example
[
{
a: true,
b: false
},
{
a: false
b: true
}
]
how do i only filter the stuff that only has a: true?

lyric mountain
#

.filter()

topaz terrace
#

bruh

#

i got no brain cells left

#

idk im doing anymore

#
bot.command("homework", async msg => {
    await msg.reply("a", {
        "reply_markup": {
            "one_time_keyboard": true,
            "keyboard": [
                [{
                    text: "Morning",
                    one_time_keyboard: true
                }],
                [{
                    text: "Afternoon",
                    one_time_keyboard: true
                }],
            ],
            resize_keyboard: true
        }
    })
})
bot.hears("Morning", async msg => {
    await msg.reply("What's the homework for the Morning class?");
    session.push({
        session: "Morning",
        date: new Date()
    })
})

bot.hears("Afternoon", async msg => {
    await msg.reply("What's the homework for the Afternoon class?");
    session.push({
        session: "Morning",
        date: new Date()
    })
})


bot.on(message('text'), async msg => {
    const onlyToday = session.filter(stuff => stuff.date === new Date());

    const today = new Date();
    if(today.getHours() === 4 && today.getMinutes() === 50) {

    }
    if (msg.telegram) {
        const message = msg.update.message;
        const swearwordTest = (await openai.createCompletion({
            model: "text-davinci-003",
            prompt: `Does the following message have any curseword?\n\n${message.text}\n\nReply with "no" if you're not sure that the message have a curseword and reply with "yes", if you're sure.`
        })).data.choices[0].text;
        console.log(swearwordTest.replaceAll("\n", ""))
        if (swearwordTest.replaceAll("\n", "").toLowerCase() === "yes") {
            await msg.telegram.deleteMessage(msg.chat.id, msg.message.message_id)
        }
    }
})``` im trying to do like 
user: /homework
bot: shows 2 options morning and afternoon
user: picks morning
#

and then

#

the bot would ask what's the homework for the morning

#

how do i make it so that it listen for the user homework?

#

bye

quartz kindle
topaz terrace
#

telegraf

quartz kindle
#

oh its a telegram bot, not discord

topaz terrace
#

ye

mental matrix
#

Dear developers,

I am looking for a simple book bot called "DarkBook bot" that can help members recommend and search for books on Amazon or any other book website. It would be great if the bot could also support the Hungarian language.

Thank you for your time and consideration.

Best regards,
Lois

spark flint
#

wut

#

@solemn latch -needdev

solemn latch
#

-needdev

gilded plankBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

shell echoBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

solemn latch
#

shush luca

quartz kindle
#

and then ```js
bot.action("mycallbackname", ctx => ...)

mental matrix
hushed robin
#

your welcome

surreal sage
#

Empty field discord.js v14?

#

{ name: "\u200b", value: "\u200b", inline: true } just throws "Error: Invalid number value"

boreal iron
#

replace the value and name by " \u200b "

surreal sage
#

Same thing

#

"fields" is an array

boreal iron
#

Using the unicode char on line breaks or as empty values, you will always need to add another whitespace infront of it or behind as the unicode char will be parsed as "one whitespace" and will be removed

boreal iron
surreal sage
#

😩

boreal iron
#

only thing you can try is to insert some special unicode char(s)

surreal sage
#

Such as?

quartz kindle
#

what are you trying to do?

surreal sage
#

I'm trying to have 2 fields next to each other instead of 3

quartz kindle
#

i've always had success with the braille blank character

boreal iron
#

yeah me, too

#

seems like that doesn't work anymore

quartz kindle
#

U+2800

boreal iron
#

uhm what char is this

surreal sage
#

not sure why it says "Invalid number value"

quartz kindle
#

⠀ <- braille pattern blank character

surreal sage
quartz kindle
#





a

#

also works for doing this kind of shit

boreal iron
#

The only thing you can do is to insert a 3 inline field using TABS and spaces

surreal sage
boreal iron
#

This is how I'm doing it atm

#

But it will end up looking weird on mobile sadly

surreal sage
#

damn

boreal iron
#

hmm

#

still works for me

quartz kindle
#

illegal

#

straight to jail

boreal iron
#

got a card to get out

quartz kindle
#

:^)

boreal iron
boreal iron
slender wagon
#

can someone help me setup postgresql on my linux os

slender wagon
#

i have only used on windows once

hushed robin
#

just use sqlite

boreal iron
#

what issues do you run into?

slender wagon
#

i am confused by the first step

#

it says its already built in but then it says some other gibberish i can't process

boreal iron
#

you can pretty much skip adding it the repository as it already is by default

#

u usually only change that to switch to other postgres versions

#

when using apt to install / update your lib

#

just go on installing the package

#

apt-get install postgresql-12

gusty linden
#

Wait what is the server name for the test server of the admins as I have build monitoring guild stats and a random one appeared that went from 7 to 27 members

boreal iron
#

and see if v12 is already in your repository

slender wagon
#

okay

boreal iron
gusty linden
gusty linden
boreal iron
#

which debian version is your system?

slender wagon
#

2022.4

#

i am using kali

#

Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2022.4
Codename: kali-rolling

boreal iron
#

errr desktop version

#

dunno which version that's based on

#

do lsb_release -a

gusty linden
# slender wagon i was joking dw

Ok, It's to collect data on my bot like it says in my bots terms of service/privacy policy I only use it to keep the bot up to date and better as I want the community to get the best use of it as they can 🙂

slender wagon
#

it states kali is baded on debian testing

boreal iron
#

hmm i'm not familiar with this one tbh

sick agate
#

doesnt kali have its own erpos?

slender wagon
#

not sure

boreal iron
#

just search for available packages please

sick agate
boreal iron
#

apt-cache search postgresql

sick agate
#

^^

boreal iron
#

might wanna filter by version

slender wagon
#

i just got a endless

#

list

boreal iron
#

like | grep postgres-12

#

or -13

#

or -14

#

dunno what release version postgres is

#

apt-cache search postgresql | grep postgresql-14

#

or 13 or 12

hushed robin
slender wagon
slender wagon
boreal iron
#

wut

#

all?

slender wagon
#

yes

boreal iron
#

is there a typo

hushed robin
slender wagon
boreal iron
#

did u update the system beforehand?

#

apt update && apt dist-upgrade

boreal iron
#

just try searching for it

hushed robin
#

guys

earnest phoenix
#

(Use apt full-upgrade over apt dist-upgrade for a full upgrade)

sick agate
#
    while True: # time ticking
        time.sleep(0.5)
        print(int(time.time()) % 15 == 0)
        if int(time.time()) % 15 == 0:
            print("15")
        if int(time.time()) % 60 == 0:
            print("60")
        time.sleep(0.5)

it got ends up called twice welp

hushed robin
#

who has a good html tutorial

boreal iron
sick agate
earnest phoenix
#

oh my fucking god

#

kali in 2023

hushed robin
#

idk how to move stuff in html

#

its confusing

#

i dont want my button to be in the top left

slender wagon
#

updating it it looks like it will take some time

sick agate
earnest phoenix
#

kiddie choice yeah

boreal iron
slender wagon
slender wagon
#

to get used to my vps's

earnest phoenix
#

twice in a row

hushed robin
#

whats this

#

can u send link

#

wait

#

i dient reply to the message

boreal iron
hushed robin
earnest phoenix
#

60%15=0
60%60=0

sick agate
#

well uhh

#

no @earnest phoenix

slender wagon
#

so after this update i will have god's power yes?

boreal iron
#

maybe

#

we will see

slender wagon
#

i'd love it to see it work and finish setting up postgres

#

after this i will have to do it again on my vps

boreal iron
#

definitely should work tho

#

unless your system last update was 1999

slender wagon
#

it's a freshly installed system

#

like 3months max

#

it doesn't come with these important updates?

sick agate
boreal iron
#

this is the channel for weird issues

#

(and weird people)

slender wagon
sick agate
slender wagon
boreal iron
#

oh oh... Nerdtrex writing an essay

earnest phoenix
#

Unless you're running a distribution that goes by rolling releases (such as Arch Linux) that always runs on latest versions of packages

slender wagon
#

ah ok

earnest phoenix
#

Yes, I'm the biggest nerd :^)

boreal iron
#

always good to know a nerd

#

or at least where one is living in his basement

earnest phoenix
#

FakE you literally live in a goofy ahh car your whole life

boreal iron
#

true

#

but very comfortable

earnest phoenix
#

Found FakE's car

boreal iron
#

lol

#

catgirl transformation is real

sick agate
#

def main():
    
    while True: # time ticking
        time.sleep(0.5)
        print(int(time.time()) % 15 == 0)
        if int(time.time()) % 15 == 0:
            print("15")
        if int(time.time()) % 60 == 0:
            print("60")
        time.sleep(1)

any idea why it is getting double run @earnest phoenix

gusty linden
earnest phoenix
sick agate
#

it prints twice

#

i fixed it by

        
        times = int(time.time())
        if times % 15 == 0:
            print("15")
        if times % 60 == 0:
            print("60")
        time.sleep(1)
earnest phoenix
#

Well yeah calling time.time() gets the current time, it doesn't return the previous value, so if a little bit of time has passed since it's last call it'll return a different value

sick agate
#

¯_(ツ)_/¯

slender wagon
#

@boreal iron so i ran this:

#

i think i should've done this from the beggining

sick agate
earnest phoenix
#

Wait you're using Kali Linux??

slender wagon
#

yes

earnest phoenix
#

Why? 💀

slender wagon
#

idk

#

y not

boreal iron
#

no risk no fun Sir

earnest phoenix
#

hackerman my guy

#

Kali Linux is only supposed to be used for security and vulnerability research, as well as penetration testing and similar, it's developers also say that

#

Other than that it shouldn't be used for anything else

#

that's what he is cat_clown

#

obviously not but yeah

sick agate
#

it runs twice again come on

surreal sage
boreal iron
surreal sage
#

no

slender wagon
#

but i am using to work on my projects

surreal sage
#

gave up on the idea of inline

#

it's just 1 col now

boreal iron
#

might have been changed/fixed in a newer api version then

slender wagon
#

now apart of what kind of clown i am, im trying to run postgres

earnest phoenix
#

Expect things to break

slender wagon
#

ok good

#

so i am basically good to go

slender wagon
#

so it doesn't really matter that much

#

i use 2 machines to work on my projects and i switch between them alot

#

i got postgres running on my windows but not on kali

earnest phoenix
#

It doesn't matter if it's the host machine or not, just in general you can run into very annoying issues

#

But if you accept breakages then go ahead

slender wagon
#

i am not installing another OS no

#

its gonna be a pain

#

setting everything up again

slender wagon
#

also isn't it beautiful

final tangle
#

so happy rn

slender wagon
#

what the hell is that quality

boreal iron
#

unorganic growth warning soon

earnest phoenix
sick agate
#

i love when i import the same code and run it directly the results are diffrent

#

WAIT ITS CALLED TWICE???????

#

why would you do that

#

clarification: i am not the one who calls it twice

slender wagon
#

no one is defined by the OS they use

#

you should fix that way of thinking, or at least don't reflect it

#

i mean Krypton has been hating on me for forever might as well block u now, thank you for the support

earnest phoenix
#

May be called twice because of bad timing

#

Though when I run it, doesn't get executed twice krShrug

sick agate
#

well flask decided to execute it twice

earnest phoenix
#

Why do you even need code like that

sick agate
#

well uh it's goings to be used as a timer

earnest phoenix
#

for?

#

eventually don't need to do it in flask or can be done another way

sick agate
#

uh

#

its going to be used for interacting with an database

earnest phoenix
#

A timer for that

gusty linden
slender wagon
earnest phoenix
#

skidmaster69420 lmao

gusty linden
#

just me making a command that works and people spam it

#

as it sent 10 different messages too make it work

sick agate
earnest phoenix
#

Well you don't connect to the gateway for every command executed

gusty linden
sick agate
earnest phoenix
earnest phoenix
gusty linden
earnest phoenix
#

Intents have nothing to do with that

#

The gateway is to get events from discord

#

Message events, reaction events, whatever else

gusty linden
#

the intents apparently are appart of gateway intents settingsw

sick agate
earnest phoenix
#

If you don't connect to the gateway, like every library like d.js does, you will never receive any of the intents

earnest phoenix
earnest phoenix
#

like every library like d.js

#

It's an example

#

Could be eris

#

could be d++

#

you definitely connect to the gateway otherwise you never get events

gusty linden
#

ah i dont see any liabries i only see folder and variables storage and button that lets me host it for a while

earnest phoenix
#

So your bot connected more than 1000 times to the gateway

#

In a short time span

#

At least that's how I understand it from the message

gusty linden
#

i think its the message things

earnest phoenix
#

Especially if you didn't have slash commands

boreal iron
gusty linden
earnest phoenix
#

So either buggy code, unstable VPS or hosting provider or token leaked

earnest phoenix
#

Probably didn't implemented in your code krShrug

earnest phoenix
gusty linden
#

my bot didnt say anything about / commands as i used the app since 2021?

earnest phoenix
#

Your bot doesn't need to say anything for you to be able to implement slash commands

gusty linden
sick agate
gusty linden
#

and if they werent before that they wouldnt of existed

earnest phoenix
sick agate
#

you are right (still gonna use my way tho)

earnest phoenix
gusty linden
#

as i used prefix commands like *

#

like the earlist i can find of one of my bots is here @earnest phoenix and i barely knew anything about coding

earnest phoenix
#

August 2021 CS_pepehmm

deft wolf
#

$authoricon

earnest phoenix
#

Don't remember if slash commands were a thing back then honestly

#

Small brain that I have, can't remember smart

gusty linden
#

ok

earnest phoenix
#

slash commands were added in early 2022 iirc

gusty linden
#

i barely coded and knew nothing so i went to the interent yet nothing helped so i just copied pastebins and test them randomly

#

but now im quite okay at making it myself

earnest phoenix
#

You'll see, after a few months/years bot development ends up being boring ThumbsUp

#

At least based on my experience and the other developers I know

gusty linden
#

nah im still into after what like 2-3 years now

earnest phoenix
#

pain

#

bot dev is pain on any platform

gusty linden
#

i did have my 4 month burnout at one point but since then i been coding bots still

earnest phoenix
#

i only maintain a single bot rn and its a private bot lol

#

chad

#

well, 3 bots if we count all 3 different platforms

hushed robin
#

im now moving onto websites

#

so much more difficult than discord bots 💔

earnest phoenix
#

@radiant kraken

slender wagon
#

setting up postres is such a pain smh

#

i gotta instal pgadmin

#

i am so used to ui

earnest phoenix
#

From the readme of the github page

hushed robin
#

simple setup

earnest phoenix
#

What's the purpose of that lmao

knotty quartz
#

Hey, how would make a script to every hour or so check if premium needs to be removed (30 days)

boreal iron
#

interval/timer?

earnest phoenix
#

Code your script, run as a cron job every x time

#

Like every day at midnight or something

#

Or internal task/thread running in background of your bot

knotty quartz
earnest phoenix
#

cron jobs are available in your operating system

#

The cron command-line utility is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs (commands or shell scripts), also known as cron jobs, to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its genera...

knotty quartz
earnest phoenix
#

Otherwise yeah, just make a task or thread or background process in your bot's code

#

And run it every hour, day, whatever time you need

#

In discord.py you can create tasks that run every x minute, x hour, etc. etc. You can eventually do the same with other libraries

knotty quartz
earnest phoenix
slender wagon
#

i have to manually start postgres using systemctl command that's not a good sign is it?

lyric mountain
#

how are u starting it?

slender wagon
#

sudo systemctl start postgresql

lyric mountain
#

there are 2 different commands, one is a one-time start, the other is always-start

slender wagon
lyric mountain
#

try systemctl enable postgresql

slender wagon
#

also yes

#

it shows up disable

#

d

lyric mountain
#

I dont remember which command was it, if anything do systemctl -h

lyric mountain
slender wagon
#

yup it worked

#

i tried that command earlier

#

but it didn't work

#

i assume because the server wasn't started

lyric mountain
#

it shouldn't matter, maybe u mistyped something

slender wagon
#

so now all i have to do is create a db a user and set a encrypted password?

#

and then the server should be on and good to go?

#

or is there more into it

earnest phoenix
#

chad free copilot alternative

quartz kindle
#

are those things actually good and useful?

#

never tested them

slender wagon
#

neither did i

earnest phoenix
#

Sometimes yes sometimes not

quartz kindle
#

di di

earnest phoenix
#

Copilot fucks intellisense

quartz kindle
#

di di grainger, distant cousin of hermione granger

earnest phoenix
#

A short video that shows how to sign up for Amazon CodeWhisperer with IntelliJ. It walks you through the process of installing the AWS toolkit extension for IntelliJ, setting up your AWS Builder ID and activating Amazon CodeWhisperer so it can start providing code suggestions.

Learn more about Amazon CodeWhisperer: https://go.aws/3lSPZJ9

Subsc...

▶ Play video
#

holy shit the microphone

earnest phoenix
#

Much better intellisense handling

#

Will test it for some time, maybe it's good krShrug

slender wagon
#

now which lib should i use to connect my postgres db with express

lyric mountain
#

pg

slender wagon
#

ty

#

it seems like 5432 is the default port of postgres

hushed robin
#

how do i access SQLite database outside of the server

boreal iron
#

by copying your database file poggythumbsup

#

SQLite doesn't come with any network endpoints

lyric mountain
#

can sqlite even be used in as a remote database?

#

the concurrency level would kill the poor thing

boreal iron
#

Well I guess you can share the database via file sharing

#

Will get quite funny when more than process writes and blocks the database

hushed robin
#

bruh

#

what am i going to do then

lyric mountain
#

skill issue

hushed robin
#

i want to make a website that will insert a new row

#

it's not possible ?

quartz kindle
#

you can easily create an endpoint to access your own sqlite db

lyric mountain
hushed robin
#

why

#

i want to put data

wheat mesa
#

No no, let him open up a vulnerability please

lyric mountain
#

instead make an api to handle all transactions exclusively

hushed robin
#

why tho?

lyric mountain
#

anything that's in clientside can be seen and manipulated

#

webdev 101

hushed robin
#

ok

quartz kindle
#

theres nothing vulnerable about it lol, as long as its done correctly

hushed robin
#

i will do it in not client side

boreal iron
wheat mesa
#

Those last 2 words matter a lot tim :^)

lyric mountain
hushed robin
#

so i should make an api?

#

that sounds like a lot of work

lyric mountain
#

how else do you plan on not making clientside transactions on clientside?

hushed robin
#

idk

quartz kindle
#

the question was how do i access SQLite database outside of the server, the correct answer is make an api to access it, there is no other possible answer

#

sqlite does not have any network features built in

hushed robin
#

so

#

i must make one?

quartz kindle
#

yes

hushed robin
#

bruh

quartz kindle
#

its very easy to do

hushed robin
#

but can't people see API requests in network tab?

lyric mountain
#

if you're making a site there's 99% chance you'd have to make one sooner or later

quartz kindle
#

yes they can

hushed robin
hushed robin
boreal iron
hushed robin
#

then they can just do a request to the api

boreal iron
#

But blocking will become an issue

lyric mountain
quartz kindle
#

blocking is not a big deal in sqlite, as long as you use wal mode with synchronous off

lyric mountain
#

since they'd have 100% control over the database

quartz kindle
#

i mean

hushed robin
#

so

quartz kindle
#

thats basically the same as any other db

#

mysql is just sqlite with a built in network server lol

hushed robin
#

can i just make an api endpoint where i put my sql in the body

quartz kindle
#

oversimplified of course, but kinda

hushed robin
#

and it does the sql?

lyric mountain
#

race condition go brrr

quartz kindle
hushed robin
#

ok

quartz kindle
#

but

hushed robin
quartz kindle
#

that will leave you vulnerable of course

hushed robin
#

bruh

#

how else am i suppose to do it

quartz kindle
#

standard practice is to hide the sql

#

for example

#

website makes request to api, ie: /createuser

hushed robin
#

😐

#

so much work

quartz kindle
#

the api checks for credentials, checks for data, etc, and then makes the sql query internally

boreal iron
#

cough file sharing

quartz kindle
#

without exposing the sql to the user

lyric mountain
#

can you go 10 minutes without sending that emoji or "bruh"?

hushed robin
#

what will they do with the sql?

#

all it is is a basic insert

quartz kindle
#

they can insert a bunch of crap, delete crap

lyric mountain
#

inject crap

hushed robin
#

bruh

#

but i am going to protect endpoint

#

so only i can use it

quartz kindle
#

then its fine

boreal iron
#

Nobody will do anything if you authorize the requests coming from your own server for example by filtering the source IPs of the requests

#

Which is the easiest solution

quartz kindle
#

most people have dynamic ips at their homes tho

boreal iron
#

Maybe together with an authorization header

quartz kindle
#

that only works for people who use static ips / corporate networks, etc

boreal iron
#

THEN USE A FUCKING DYNDNS SERVICE

#

my gosh mmLol

hushed robin
#

bruh wym

#

my server will make the requests?

boreal iron
#

Also I Said Server not home and expected a static ip

#

And assumed the database is at home

hushed robin
#

no

#

database is on my digitalocean droplet

#

it's with my bot

lyric mountain
#

holy that's a money sink

hushed robin
#

only $14 / month

#

or $16

#

i forget

boreal iron
hushed robin
boreal iron
#

Well then there you go filter the static ip for the requests and done

hushed robin
#

ok

#

sounds hard

boreal iron
#

Let the webserver listen to a specific port and filter the source IPs connecting to the port in the firewall

hushed robin
boreal iron
#

That's the easiest solution you can use

#

Instead of going through authorization checks etc

lyric mountain
#

that's cuz they aren't supposed to be kept online 24/7 (they are on-demand)

boreal iron
#

Well actually the easiest solution still is to share the database file and keep in mind what Tim said about how to not get in trouble with blocking

lyric mountain
#

plus DO itself is expensive as-is

hushed robin
#

bruh

lyric mountain
#

idk, any vps would suffice, or dedicate providers for remote database

hushed robin
#

why does it say my ip is 127.0.0.1

#

ok guys

#

with express

#

how can i make something run on every endpoint

#

that way i don't need to check the ip for everyone

quartz kindle
#

there was an experiment in south africa or something

#

a pigeon carrying a 4gb flash drive

#

vs a telecom company transferring the file via its network

#

distance of like 70km

#

when the pidgeon arrived, the transfer didnt even reach 20%

lyric mountain
quartz kindle
#

xD

hushed robin
#

guys is this okay

cold hearth
#

have you run it yet

hushed robin
cold hearth
#

Did it work

hushed robin
#

yes

cold hearth
#

Ok so its ok, why are you asking?

hushed robin
#

well

lyric mountain
#

not OR not OR not oh god

hushed robin
#

it could be bad

earnest phoenix
#

probably because it's like all his code, AI generated

hushed robin
boreal iron
earnest phoenix
#

chatgpt ftw kek

hushed robin
#

bruh

lyric mountain
hushed robin
earnest phoenix
#

very sad );

surreal sage
#

D.js v14 is throwing me 'AbortError: Request aborted' when logging in

hushed robin
#

does anyone know this

surreal sage
#

app.get("/*")?

hushed robin
#

but

surreal sage
#

can be behind other stuff as well

hushed robin
#

how will i make it so my code doesnt execute before i check ip

#

if i do that

surreal sage
#

app.get("/users/*/test")

surreal sage
hushed robin
surreal sage
#

Not really

hushed robin