#development
1 messages · Page 113 of 1
fixed, too many packages that the system just breaks down
*place silly word here*

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
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
guess i'll add the keys to the query if it's in the options
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
all updated and still the same issue
@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
uhh
Unless that’s the only option
well, you can't really "render behind" since a pixel can only have one value
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
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
then render based on encounter order
I’ll have to test treeset’s performance
Unfortunately it’s probably going to be worse than hashset for sure
not really, it just uses more space
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
treeset still uses hash
a thing u can do is work with layering
like, have various layers and render only entities that belong to that layer
Yeah
but that means sacrificing some memory
as you'll need to keep a set for every layer
Pfft I couldn’t care less about memory, I just care that it doesn’t lag a ton
Map<Integer, Set<Entities>>
Yeah that’s fair for my engine I probably wouldn’t need many layers anyways
Maybe like 5 or 6 at the very most
so when looping ```java
for (int i = 0; i < maxLayers; i++) {
for (Entity e : entities.get(i)) {
...
}
}
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
CME time 🧌
wont be O(n^layers) as not all layers will have the same amount of entities
you wont be creating layers during runtime will you?
well, just use whatever method u have already
Ignore me
Yeah lmao
To think that I’m literally in CS class right now and I thought that would cause a CME
lmao
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
this is the west midlands
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
ah
well that'll not work ofc
i noticed that xddd
ah okay
I would do it with array and then just do array.includes(msg)
just note that it'll not match test abc for example
for that you need to process the input first
id dit not work
^
yes and it's the same as the guild's id
testWords.includes
testWords.some(word => message.content.toLowerCase().includes(word))```
that should work
any returns the match, some returns a boolean
this?
that should work
startsWith
string always
(discord) ids should never be used as a number else you might face precision issues
yup thanks!!
awesome
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?
ye
lel
make sure to check if the message contains the advertisement before deleting the message
its not 😦
can you give the error?
i dont got a error
didn't*
you want me to send my messageCreate event in sourcebin
yes
no
Why it's antilink_?
missing message deletion permissions
it got admin perms xd
first off do not ever give it administrative perms
There it's antilink- for some reason
second off there's a manage_message permissions
that is bc i tried to change it if it would work
How do you save it in the database then?
i think it's the second line of code block
exactly the same as i get it but instead of db.get its db.set
you need to await interaction.guild.channels.create
But there is a difference between _ and -
or you can do something like
interaction.guild.channels.create(...).then(channel => channel.send(...)) i think
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
my db is working bc all my other commands using my db are working
But check first if the code the guys gave you works
technically sending someone a dm means youre giving them permission to have that info
its not a privacy breach, its willfull sharing
You'd have to be quite an idiot to do something like that. I understand you can save links, but not passwords
its a breach of you later share it without permission tho
whats the point in logging all bot dms tho 
but as long as only you read it, its fine
its funny to see people calla bot trash bcus they dont know how to set it up xd
it's still risky
mega dumb
yeah and try telling that to people who dumb things
they are great testers tho
you always find something to fix because someone was dumb enough to try something that makes zero sense
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
sounds like a lot of work 
and sometimes its still not enough lol
is your bot verified
mine is pending for request but they have that kind of bug atm
what bug
there was a bug where
verification and intent applications were getting "lost"
look in #discord-news
weird lol
it was fixed like 6 days ago
discord being discord
yup
wut
discord doing server maintenance:
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

lmao
yeah battleless likes to terrorize the bots
bruh
Just have a server that’s you only…
it's a robot
true
That’s what I do
i did that once and invited a bot from top.gg
and the owner instantly joined the server
I don’t send ANYTHING private there though
was kinda scary
BuT BoTs HaVe FeElINgS
I don’t trust passwords in any sort of raw text form on an internet application
tbh they should make it so you can see a bots intents before inviting it
They…do…
wtf
where
AH HELL NAH
Literally right in front of you when you invite the bot and it says “this bot has permission to…”
do you want bots to be invited to your discord without you knowing what it will have access to?
thats not intents 
and i missed that
Scopes and intents are pretty much the same thing in this context
what he said
no
no?
explain it then
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 
what
what aren't
intents and permissions
i never said they were 
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
it doesn't
non provileged intents will not show because its not needed
bruh
i don't see that here
if youre that concerned why would you invite a bot you dont trust in the first place
i'm not concerned
it would just be nice to see the intents it have before inviting it
or privileged ones ig
yeah non developers probably won't understand it
because the invite information is for users, not for developers, so it has to ne user friendly language
they should have a battleless friendly language
why
"Solve a mistery with Scooby and the gang"

anybody had an error with mongoose?
anybody had an error in one of their typescript files?
imagine using typescript
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)
Everything works fine on my VPS 
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
Don't u need to whitelist the source ip connections are coming from for this type of online database?
Here is a link related to this problem
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
ip leak?
it sounds like it timed out
this problem is about me or mongo
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
why cant vm boot into the file
this is the iso file
maybe im stupid about os
oh
wait
Hey they finally verified my bot but I don't see a that check mark think after my bots name
Give it a day or two
If it doesn't ask you about verifying on the dashboard, you're aight
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
Hey is there any recommended query builder lib for postgres in python?
that supports migrations and all
mmm, dont have the time, so would rather just use something that's already available
@wheat mesa added new stuff
training in this case is practicing against one specific enemy
I REALLY need to optimize my hit checker tho
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
but cant find a way to do so without iterating
(idk how to use the open ai npm package)
print what data is returning
why is it undefined
im using telegraf with open ai to check if a message has a swear word
what about the rest of it?
edit the image to remove it
but theres one in config
like, draw a line over it
bros rly using chatgpt for swear detection
yes
whats that sh
its owned by fb but its great
there's one data field there yes
nlp
oh
train it enough data and its good as fuck
it has a property choices, I suppose your answers are there
you need to json parse it
it's already a json obj
what
ok
ah, I looked at that screenshot
well, there's ur answer
why is it only saying no
because it said no
when i said a bad word
Ai
lul, well, also depends on what it considers a bad word
but rather use proper services made for it
instead, ask it to say if it's a curse word
as Reis already mentioned as well
bump
bump
ok
no need to bump both of your messages that are literally following each other 
Documentation for telegraf.js - v4.12.2

i cant understand this docs
like how do i delete the users messages?
Documentation for telegraf.js - v4.12.2
text: `cum`
👀
oh
totally not sussy
being used for testing
wait, how do i add something like this
my brain doesn't work with the documentation
I have no idea what it's called correctly but it's some kind of keyboard on telegram
oh
Here's a pretty good example of how it works. You can experiment with it
📢 One-hour free RDP at no cost visit: https://www.fiverr.com/xeroxnet69/provide-remote-desktop-linux-rdp
Build Telegram Chat Bots with Node.js using the Modern Telegraf Framework
👉🏼
https://bachatexpress.myinstamojo.com/
https://www.youtube.com/playlist?list=PLX2ojSA27XYhIopdU2RRQIMe7...
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?
A
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
oh
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
What options?
nvm
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?
nope, as the first one has inline disabled
how do i check for the homework message?
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
AYO Bros tryna make a bot for schools
"What's the homework for the morning class?"
Discord.js?
yes

and then the user would say for example
workbook page 69420
and then the bot would add that thing to the db
but how would i know which one is the homework?
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
ok
how do i define the session state?
this is generated by ai too
i wanna know how it do it
dont rely too much on ai
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?
.filter()
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
what library is that?
telegraf
oh its a telegram bot, not discord
ye
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
-needdev
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.
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.
shush luca
never used the telegram api, but from reading a bit of their docs, it seems you can do ```js
{
text: "Morning",
one_time_keyboard: true,
callback_data: "mycallbackname"
}
and then ```js
bot.action("mycallbackname", ctx => ...)
no
Oh, okay, thanks.
your welcome
Empty field discord.js v14?
{ name: "\u200b", value: "\u200b", inline: true } just throws "Error: Invalid number value"
replace the value and name by " \u200b "
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
well then, it looks like that's not possible anymore
😩
only thing you can try is to insert some special unicode char(s)
Such as?
what are you trying to do?
I'm trying to have 2 fields next to each other instead of 3
i've always had success with the braille blank character
U+2800
uhm what char is this
not sure why it says "Invalid number value"
yeah thats also strange
⠀ <- braille pattern blank character
commenting the fields.push results in no error
The only thing you can do is to insert a 3 inline field using TABS and spaces
aint work 
damn
got a card to get out
:^)

did u test that?
can someone help me setup postgresql on my linux os
no
i have only used on windows once
just use sqlite
what issues do you run into?
i am confused by the first step
it says its already built in but then it says some other gibberish i can't process
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
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
and see if v12 is already in your repository
okay
something like DBL or Topgg Verification Center
average stalker
Okay it's just that I got suspicious of a random server
No I check my bots average server stats to see an average on how many members there are per server that my bot is in
i was joking dw
which debian version is your system?
2022.4
i am using kali
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2022.4
Codename: kali-rolling
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 🙂
yeah that's what it did
it states kali is baded on debian testing
hmm i'm not familiar with this one tbh
doesnt kali have its own erpos?
not sure
just search for available packages please
it does
apt-cache search postgresql
^^
might wanna filter by version
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
why debian
all come up empty
why not
yes
is there a typo
cus ubuntu is better
i think postgresql-14 should be postgres-14
could be possible, yeah, like I said im not familiar with the package
just try searching for it
guys
(Use apt full-upgrade over apt dist-upgrade for a full upgrade)
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
who has a good html tutorial
meep meep, that nerd's here

mdn
idk how to move stuff in html
its confusing
i dont want my button to be in the top left
updating it it looks like it will take some time
i guess its convience choice
should do that sometimes Sir
i have used plenty of them
sorry i use kali only for vsc
to get used to my vps's
because both conditions are true
twice in a row
yeah people do strange things 
^^^^
true
60%15=0
60%60=0
so after this update i will have god's power yes?
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
it's a freshly installed system
like 3months max
it doesn't come with these important updates?
weird issues
it's definetly happeneing cuz of cosmic rays
i mean i dont have cosmic rays every 15 seconds so
yes yes u do
A distribution comes with specific package versions in the form of an ISO or something similar, it's not gonna be up-to-date as it these things ship with stable versions tested thoroughly
Unless you're running a distribution that goes by rolling releases (such as Arch Linux) that always runs on latest versions of packages
ah ok
Nerd
Yes, I'm the biggest nerd :^)
FakE you literally live in a goofy ahh car your whole life
Found FakE's car
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
That car look cool af I wish I had one 😭
Wdym by it getting double run?
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)
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
¯_(ツ)_/¯

Wait you're using Kali Linux??
Why? 💀
no risk no fun Sir
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 
obviously not but yeah
it runs twice again come on
yes

and yes i do that too
did this work?
no
but i am using to work on my projects
might have been changed/fixed in a newer api version then
i kind of am yeah
now apart of what kind of clown i am, im trying to run postgres
Then you might have a bad experience, Kali Linux doesn't ship with stable releases of packages, Kali goes by rolling releases so you're gonna get THE literal latest releases that aren't even tested
Expect things to break
this is not the hosting machine just a place where i develop my stuff
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
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
i am not installing another OS no
its gonna be a pain
setting everything up again
again you can do a little research about me, it bugs me seeing someone talk like this about smthn they don't know
also isn't it beautiful
so happy rn
what the hell is that quality
unorganic growth warning soon
Kali is like the kiddie "hacker" distribution they believe that if they use it they're real hackermans 
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
high quality cringe message
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
May be called twice because of bad timing
Though when I run it, doesn't get executed twice 
well flask decided to execute it twice
Why do you even need code like that
well uh it's goings to be used as a timer
lol i remember my first message from discord it went something a little like this
you know its bad when discord points out that there is a bug on your code

skidmaster69420 lmao
not a bug
just me making a command that works and people spam it
as it sent 10 different messages too make it work
basically it's going to check if the time in database is below the current time
Well you don't connect to the gateway for every command executed
it wasnt / command and idk if it had gateway at the time
since i don't want to spam it with requests it seemed as the most sensible solution
You definitely do otherwise you can't use commands
Yeah though for what purpose, no point on doing it
the only one its ever had is message content intent
Intents have nothing to do with that
The gateway is to get events from discord
Message events, reaction events, whatever else
the intents apparently are appart of gateway intents settingsw
it's going to subtract an amount from the database
basically it's just billing
If you don't connect to the gateway, like every library like d.js does, you will never receive any of the intents
who says i use discord.js?
It's time to grow up and use some common sense. As well as learning the meaning of the word sarcasm and joke jeez chill 
Dude just read
like every library like d.js
It's an example
Could be eris
Could be d.py
could be d++
you definitely connect to the gateway otherwise you never get events
ah i dont see any liabries i only see folder and variables storage and button that lets me host it for a while
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
i think its the message things
Especially if you didn't have slash commands
Yeah within 24h
/ commands were not available at the time to me
So either buggy code, unstable VPS or hosting provider or token leaked
In September 2022 they were available to everyone
Probably didn't implemented in your code 
idk
And why not run a proper cron job?
my bot didnt say anything about / commands as i used the app since 2021?
Your bot doesn't need to say anything for you to be able to implement slash commands

you litterrally said that they were available in september 2022
code is just easier
Yeah.. and?
and if they werent before that they wouldnt of existed
Code is the same, you can run a python script as cron job if you want
you are right (still gonna use my way tho)
Well you said they were unavailable in September 2022 from the time of the message you've received. Unless you meant since the beginning
i didnt realised they were a thing until december time
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
August 2021 
$authoricon
Don't remember if slash commands were a thing back then honestly
Small brain that I have, can't remember 
ok
slash commands were added in early 2022 iirc
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
You'll see, after a few months/years bot development ends up being boring 
At least based on my experience and the other developers I know
nah im still into after what like 2-3 years now
i did have my 4 month burnout at one point but since then i been coding bots still
i only maintain a single bot rn and its a private bot lol
chad
well, 3 bots if we count all 3 different platforms
ive only been doing it for a few months and im bored
im now moving onto websites
so much more difficult than discord bots 💔
URL is https://docs.rs/topgg
From the readme of the github page
thats why sqlite is better
simple setup
What's the purpose of that lmao
Hey, how would make a script to every hour or so check if premium needs to be removed (30 days)
interval/timer?
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
I cant figure out cron tho? Is there something i need like a npm download?
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...
Ohh thank you!
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
Thanks, I just need to write the .js file now for it to run.

i have to manually start postgres using systemctl command that's not a good sign is it?
how are u starting it?
sudo systemctl start postgresql
there are 2 different commands, one is a one-time start, the other is always-start
if i don't run this the psql command doesn't work
try systemctl enable postgresql
I dont remember which command was it, if anything do systemctl -h
^
yup it worked
i tried that command earlier
but it didn't work
i assume because the server wasn't started
it shouldn't matter, maybe u mistyped something
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
chad free copilot alternative
neither did i
Sometimes yes sometimes not
di di
Copilot fucks intellisense
di di grainger, distant cousin of hermione granger
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...
holy shit the microphone
True
now which lib should i use to connect my postgres db with express
pg
how do i access SQLite database outside of the server
can sqlite even be used in as a remote database?
the concurrency level would kill the poor thing
Well I guess you can share the database via file sharing
Will get quite funny when more than process writes and blocks the database
skill issue
you can easily create an endpoint to access your own sqlite db
that's a big no-no
No no, let him open up a vulnerability please
instead make an api to handle all transactions exclusively
why tho?
ok
theres nothing vulnerable about it lol, as long as its done correctly
i will do it in not client side
That's still a completely different thing tho
Those last 2 words matter a lot tim :^)
that's called an api
how else do you plan on not making clientside transactions on clientside?
idk
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
yes
bruh
its very easy to do
but can't people see API requests in network tab?
if you're making a site there's 99% chance you'd have to make one sooner or later
yes they can
yeah ik i've done it once
bruh
Of course, sharing the database will work, too
But blocking will become an issue
it'd be worse if the database was being used directly
blocking is not a big deal in sqlite, as long as you use wal mode with synchronous off
since they'd have 100% control over the database
why though

if you dont protect it, yes
i mean
so
thats basically the same as any other db
mysql is just sqlite with a built in network server lol
can i just make an api endpoint where i put my sql in the body
oversimplified of course, but kinda
meanwhile the requests: https://thumbs.gfycat.com/FatLargeHapuku-max-1mb.gif
and it does the sql?
race condition go brrr
yes
ok
but

that will leave you vulnerable of course
standard practice is to hide the sql
for example
website makes request to api, ie: /createuser
the api checks for credentials, checks for data, etc, and then makes the sql query internally
cough file sharing
without exposing the sql to the user
can you go 10 minutes without sending that emoji or "bruh"?
they can insert a bunch of crap, delete crap
inject crap
then its fine
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
most people have dynamic ips at their homes tho
Maybe together with an authorization header
that only works for people who use static ips / corporate networks, etc
Also I Said Server not home and expected a static ip
And assumed the database is at home
holy that's a money sink
And requests are coming from a server ...?
yes
Well then there you go filter the static ip for the requests and done
Let the webserver listen to a specific port and filter the source IPs connecting to the port in the firewall

That's the easiest solution you can use
Instead of going through authorization checks etc
droplets are much more expensive than vpsses for less performance
that's cuz they aren't supposed to be kept online 24/7 (they are on-demand)
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
plus DO itself is expensive as-is
what am i suppose to use
bruh
idk, any vps would suffice, or dedicate providers for remote database
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
lmao
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%
Subscribe to our channel http://bit.ly/AJSubscribe
Speedy internet connections have yet to take off in many parts of South Africa because of a shortage in bandwidth.
One leading internet provider says it is not to blame for the slow connection, but frustrations have led one IT group to adopt an unusual method of delivery.
Al Jazeera's Har...
xD
guys is this okay
have you run it yet
yes
Did it work
yes
Ok so its ok, why are you asking?
well
not OR not OR not oh god
it could be bad
probably because it's like all his code, AI generated
what am i suppose to do

chatgpt ftw 
bruh
what
very sad );
D.js v14 is throwing me 'AbortError: Request aborted' when logging in
does anyone know this
app.get("/*")?
can be behind other stuff as well
app.get("/users/*/test")
Check out `<App>.use' on the docs
looks difficult
Not really
i am beginner it is



