#development
1 messages · Page 125 of 1
Regex
ok
i will google the regex
and see if work
why doesn't this work
ok nvm
i found new regex that works
ok
whats the point of new RegExp if you don't need to use it ?
if you have a regex string and want to parse it, or if you have template literals in the regex
if you have the literal regex in your code you don't need it
mfw the email regex
I have to fix something with my character system. When a character is deleted, the ID is deleted too, so I will find a way so that the ID will make a thing like: 1 2 3 4 5 6, not: 1 3 5 6, it cause a lot of problem with the /characters command because when we react with ▶️ it does actual ID + 1
If someone can help me when I'll be at my home
the ids are fine, you dont wanna change them to keep the order as that will cause more issues than it solves.
what you wanna do is simply change the way you list the characters, get/fetch/select them all, put them in an array, and then paginate them, dont paginate the ids themselves.
if youre using a database you can also use its own built in pagination system, most databases have that (query limit offset)
I made a database in a file system format
but thanks for the advice!
there is a db folder, then a folder with the user id and then a folder with the character ID where there are meta.json, bio.txt and stats json
My server has only 2Go storage so I may upgrade my hosting service but I'll have to pay
that's really, really bad
you did what we call a "json db"
if storage is a premium you can use sqlite, which is extremely small and simple to use
later when you upgrade you can move to more complete databases like postgres or maria with almost no changes in your code
Why?
I have to pay for the next tier
I'm only 15
If you want to see my work it's on GitHub but I'll update my repo in the evening
Well, you can leave link to github here. Maybe someone will have some advice after seeing the source code
?
all common sql databases are free
sqlite doesn't even require a host service
don't try to use their database feature, install it yourself
i followed this (https://ubiq.co/database-blog/how-to-create-read-only-user-in-postgresql/) tutorial to create a read only user on my postgres db but im getting this error on prisma when trying to connect
i assume usage allows you to view it too
hey why does this doesnt work?
.setThumbnail(client.config.embedlostIcon)
note: client.config.embedlostIcon is set to a discord image url and when i log it its all good
still doesnt work after that
the embed just doesnt show any thumbnail idk why
Is there a specific size required for embed thumbnails?
I think u still need to set read perms
what's the url?
Can i send links in here?
sim
I guess so, unless it's nsfw
It will post it as a photo but here u go
https://cdn.discordapp.com/attachments/1065615855762817074/1113095464791842907/orblose.png
there's not one for view
select means view
you dont grant select perm to schema, u grant to its tables
does the bot have images perm?
Its in my test server so yeah even admin perms😹
hm, what happens if u try to set it as the embed's image?
like, not thumbnail, the image itself
still got the same error lol
Let me try wait
what are u trying to select?
it wont be a data leak as the select query is pretty useless without access to the server
just omit the columns (or any sensitive data if any) as they're irrelevant
is the table inside public schema or on its own schema?
this was supposed to be enough
unrelated comment, but u should never use public schema
but well, try those 3 commands in the image I sent
also make sure ur connected to the correct database
you might be executing commands on the default db (postgres)
same error
^
i've got /nypsi at the end of the connection uri
after changing the perms i don't need to restart the db or anything right
hm?
db name is nypsi
If you're genuinely not familiar enough with the command line of SQL, try to use some client app allowing you to manage stuff in the UI
the command is psql -h urltothehost -p port -d nameofthedatabase -U user
did u define a database to connect to?
yes im using prisma in the code
you mean to connect to it to do the perms and stuff?
or as fake said, with a visual tool
yeah im sshed on the server and logged into psql
did u set a database to connect to?
There are some commonly known tools to manage stuff via UI
I think one is called navcat
nvm navicat
pgAdmin and phppgadmin (if storage is premium)
there are other general tools too, like datagrip, hedisql, etc
yeah im gonna try it with pgadmin
is phppgadmin the equivalent of phpmyadmin but for pg?
Ah ok, never heard of it before
it's uglier than myadmin, but gets the job done
Might be because im not using postgres
Yeah ugly or not doesn't really matter tho as it's still easier and faster than the CLI
And for most use cases, as you usually don't touch a database very often, it's totally enough i guess
(not mine)
Yikes looks like it's a few years old
mmmmm Beautiful
gifs, autoplaying music, flash everywhere
and we will still look at current design standards in 10 years time in the same way we look at that
oh and blazingly fast 3min load time per site
Aye and console errors
I like the late 90-s style with cool flame gifs and whatever
lmao
i logged into the db from pgadmin as the same user im trying to login with in code and i can access the tables
but can you select them?
ohhh nope i cant view any data
then u dont have access to them
u can see the tables because you have access to the structure information, but not to the data itself
you were correct with this
u always need to supply a database to connect to, else it'll default to PostgreSQL
Hi
which usually isn't the one you're actually trying to use
yeah i had applied the perms to the public schema in the default postgres db
but how ?
And I tried sqlite and it doesn't work
I can't use this
I don't know how
What kind of hosting are you using?
Nevermind, he will give me a SQL db I'll use the mysql2 npm lib
"He"? 
"viewing"? I use it (integrated on intellij) to straight out edit in-db scripts
how did u try it, specifically
because the steps to use sqlite are literally
1 - apt install sqlite
2 - create a file with any name at all
what OS do u use?
My computer is Windows, but I think that the host is in Linux so i'll try it
it doesn't matter what OS u use locally, only the host matters
so yeah, you are on linux
no i'm on windows, my computer is on windows
are you hosting the bot on your computer?
no
then you are on linux
doesn't matter, only the host matters
you get a library to access the file, like better-sqlite3
supposing you're using node
Oh I know why it wasn't working
I couldn't do "IF NOT EXISTS CREATE TABLE table_name (a, b, c)
It was saying that there was an error on the IF
that's an invalid sql statement yeah
the proper syntax is CREATE TABLE IF NOT EXISTS
the only thing I hate is how sometimes the columns return to initial widths if u exit a cell
that's very likely a bug, idk how to reproduce to be able to make a report ticket
where do I put the name ?
after the EXISTS ?
I recommend doing a few sqlite crashcourses to understand how it works
but yes, after exists
it's dangerous if you don't know what you're doing
you might wipe your database at a snap of the wrist
so true xd
Reminds me of https://youtu.be/tLdRBsuvVKc
If you're tasked with deleting a database, make sure you delete the right one.
Sources:
https://about.gitlab.com/blog/2017/02/10/postmortem-of-database-outage-of-january-31/
https://about.gitlab.com/blog/2017/02/01/gitlab-dot-com-database-incident/
Notes:
1:05 - The middle bullet point about the account that had 47,000 IPs was never mentioned ...
lmao
too bad I'll likely be ignored, they never want to do courses until something happens
said the guy who made sqlite slow down to a crawl and was going to create one table for each entry
say again?
fast database
SAY AGAIN
well its not my fault
its sqlite fault
but thats old too my new database is faster
you still managed to make sqlite crawl, so my statement stands up
yes yes, you're never wrong, the world is
anyway, this will end in an infinite echo chamber, I'll refrain from getting a mod's attention
json
ni
i wanna use a not file databse but i sont knownwhich one to use
so i want some advice
guyssd
whered you go
postgres
is it easy or hard to start it up
like make database
also how does that work if i make it on my pc
is it not in my projects folder ?
postgres
as I always tell you, "hard" is relative
ok
and no, it wont be in your projects folder
like 3 minutes if you have ever used a computer before
install pgadmin 4 and you can have a visual interface for it
I have an answer for you ready in 3 minutes made by chatgpt 🥶
package suould i use for it
pg
ro like insert tows and stuff
pg
ok
Yuo
sqlite is not a good comparison target because it's the basic of the basic
nothing will come close to it in terms of simplicity
it's easier to list the drawbacks instead
no, it means that the benefits are too many to be listed
not "big ones", but "only ones"
1 - it's bigger
2 - more complex as it has more features
3 - will use as much ram as you allow it to
const { Client } = require('pg')const client = new Client()client.connect()client.query('SELECT $1::text as name', ['brianc'], (err, res) => { if (err) throw err console.log(res) client.end()})
why does the sql look different
than on better sqlite
because you copypasted an answer without even reading the context
different databases, different wrappers, different usage
it's the same as asking why C++ looks different to JS
yes, but some databases have features on top of sql
sql (as in, standard sql) is valid across all databases, but it'll not be the optimal way of writing queries
it'll only be generic
courses
courses ?
you're expecting to grab a hammer for the first time and build the eiffel tower
you know sqlite (about 30%)
😑
it's not because all sql databases use sql that you know all sql databases
all programming languages use english, but you don't know all programming languages
(bar esolangs)
but why not
what more is it than sql
why is it overly complex
is there a package for that database but like better sqlite3
look, there's an entire semester in college about databases
you literally just met postgres
you won't be able to use it without putting any effort
You’re talking to a brick wall 
im not in college yet
example
stop making rude comments
do courses, you don't need college to be able to fucking google
rude comment
can you send lini
to quick but good tutorial
tutorials are either quick OR good
what about both
doesn't exist
find it yourself
if you want the good ones, https://www.codecademy.com/learn/paths/design-databases-with-postgresql
hoe did you learn it
college + documentation + practice
ok how long will this oke twke
can you even bother to open the link?
and discord doesnt use much when sending images or what?
just go on the link, it eats like max 1mb
I measured, its exactly 6.45MB
also that's one course only, which won't teach you everything
it usually takes 3-4 days until you firmly grasp the concepts
especially given that sqlite doesn't have users, triggers or specialized types
so after 4 days i can make application with it ?
most likely
ok
I have unlimited

just lost about 99% of my braincells reading that conversation
so true xD
im using
^.*http[s]?:\/\/(?!.*\.(?:png|jpe?g|gif))(?:[^\s]+).*$
but discord auto mod is saying / unrecognized
https://regex101.com/
its working here though
Just go through this support article
There’s a link included for another Regex parser and tester
As Discord writes:
We use the Rust flavor of regex and recommend writing your regex in Rust syntax to minimize errors. To edit and test your regex syntax in Rust, we recommend using Rustexp.
I’ve got no clue what the “Rust flavor” of Regex is but testing your Regex is causing indeed errors
GUUUYYSSS
wtf is this bullshit
Ok sql js libs are simpler to code, but I don't know it shows that
My bot will be broken
I just replaced all my json system
Well u just got an error in your sql statement
ok i see
near AUTO_INCREMENT
oh thank you
At least the error messages using this tester give you something to google to validate the "Rust like Regex"
oh fuck
it .all
not .get
Wtf
the ID is null
why ?
it is primary key
help please
Because character.id seems to be null/undefined
The picture you shared above still does not show the related sql statement
The error is not coming from that statements
Show line 93 of bot.js as the error states
Well where’s userID defined?
I only see name and iconURL being passed as arguments to the function not userID
Well u set null as id
First column is id and your first value is null, then userID, then name …
it was the same before
If id really is a primary key using auto increment then DO NOT set a value for it
Remove ID from your INSERT statement and don’t pass a value to it
The database does this automatically
Just read what I told you and you will understand your issue
you didn't help yourself
tip: error messages are almost always useful, read them carefully
stack traces tell you where the error happened
don't just "GUYSS IT DIDN'T WORK", actually have a grasp of what's going wrong so people can help you better
The last two screenshots (#development message) he should have posted before are showing him trying to pass null as primary key for an AUTO INCREMENT column that doesn’t allow null as value
As I explained
But yeah
Idk
The confusion was this one #development message
I didn’t notice it’s db.js not bot.js
Close to impossible to see on phone without scrolling in
mainly it was an error with sql exec
but even that i would use an ORM, instead of manually writing queries
Anyways he got his explanation and fix told
We’re not responsible for what he’s doing with it/out of it

I helped myself because I fixed it
but did you understand what you just fixed
your messages showing you are being
tho
but yeah i'd recommend using an ORM
yeah
certainly
if you plan the schema out before migration it wouldn't be this problematic

Someone recommended me sqlite on this server
I will not change sql lib for each person
this is regardless of db
Just use PostgreSQL 
Shoo go away nerd
oh stop you're so toxic
Just, it's my bot
not yours
nah
at this point use json files and pray for the best 
Too late
man you're asking for help because you didn't understand and got help
you would have a hard time with SQL queries
I replaced the json files by a sqlite db
me when MongoDB:
but again, use an ORM
better intellisense and less prone to sql injection attacks, since you don't have to manually write queries anymore
It wasn't a lib issue, just a SQL statment issue
injection attacks are blocked now
by what
id INTEGER PRIMARY KEY AUTOINCREMENT, user VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, current BOOLEAN NOT NULL, bio TEXT, avatar VARCHAR(255)
Yes as I told you many times
And again:
And a few times more after...
i asked that's the return value of .get call in this snippet, not the query
if it always return a query string like that, then || undefined would never hit
I know that a lot of things seem redundant in my code, but I may optimize my code later
it's not a string
it's an object
then what is it
that is returned
is it nullable
yes
does "null" has the same nature of "undefined" in a condition ?
yes
does "if(null)" equals to "if(undefiend" ?
null is a falsy value
Okay
Shoo get out of your car and 

null, undefined, 0, false, and an empty string ('') are all falsy values
Nooo, I live in there!
POV: FakE
https://youtube.com/shorts/1pra1cwYQLA
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
(I pet the dog after don't worry)
Socials- https://linktr.ee/izzclay

There u go
"Touch some green Sir"
Sir, that's a road, and you're not touching grass
Shhhh

poor undefined boy
lol
why are u using locks if the images are individual?
you're basically disregarding the avantage of multithreading entirely
if you're writing individual files I don't see how one generation might affect another
if you are writing all to a single file, well, then you have an issue there
that's not what corrupted means
likely because you're sharing the same plot across different threads
given python is not multithreaded, I suppose they didn't make that library thread-safe
you need to have each thread have their own plot instance
inside generate_frames yes
btw, just one note
as you have it currently, you're bound to get an ultra high cpu and memory usage
you're creating way too many threads (which aren't threads in python, but sub processes) for the task
the proper way would be to have a thread pool or make a thread process a "chunk" instead
idk how matplot works, but u probably can have more than one instance
hm, then it shouldn't be affecting other figures
I'd double check the generation logic, as it appears to be generating a 2d graph
don't think I can help with that, but u could try printing the images to screen to see it changing in realtime (debugging + hotswap)
Will some people be able to help re-writing the error and success messages ?
how exactly
Anyway, I should do that myself because it's me that coded the bot.
is there an easy way to merge two javascript objects but keep their references and not modify the original Object (so no .assign() or deepmerge)
example:
const objects = [
{ hello: true },
{ ok: 123 }
]
let result = {}
objects.forEach((obj) => {
...what I want to find out how to do
})
result // { hello: true, ok: 123 }
objects // [{ hello: true }, { ok: 123 }]
result.ok = 234
result // { hello: true, ok: 234 }
objects // [{ hello: true }, { ok: 234 }]
one thing I though about were setting getters and setters for each key but idk if thats a good idea
const result = {}
for (const o of objects) {
result = {...objects, ...o}
}
the last 3 lines wont work with that
why?
it'll keep references of the entries
u cant keep references of the original maps yet have them merged
I didn't planed for the bot to not have the needed permissions. So when someone tried it on their server, they thought that the bot wasn't working, so they banned my bot.
I tested it, no it doesnt
itll only keep the reference if the value is an object
thats the main challenge
const objects = [
{ a: {value: 123} },
{ b: {value: "hello"} }
]
let result = {}
for (const o of objects) {
Object.assign(result, o)
}
console.log(result) // { a: {value: 123}, b: {value: "hello"} }
result.a.value = "world"
console.log(result) // { a: {value: "world"}, b: {value: "hello"} }
console.log(objects) // [ {a: {value: "world"}}, {b: {value: "hello"}} ]
Thats not what im doing
ffs I forgot how to merge objs lmao
Push
I want to do that with any value and without screwing the object
I know alot of solutions to it but they are all pretty horrendeus
don't think u understand why you example can never happen
results.ok is a primitive, it'll always pass by value
the only way u can have it updated across the table is by wrapping it into a value holder (map, array, object, whatever u want)
if I made it { a: 123 }, doing result.a = 555 would only update the result entry
you can ofc do that in languages that allow pointers, but js doesn't
It doesnt need to be direct, the object will be used for like 10ms and can assign to Others Afterwards, getters/setters also Work but those are probably Not the best solution to my wanted answer
tl;dr: you can't update primitives across the board
I know
technically number is an object too, but its handled differently
same with strings
nope, it isn't
it is, its a instance of the number class
I mean, in js it kinda is, but they're immutable so effectively the same as a primitive (regarding mutability)
they will pass by reference, but u can't edit it
yeah im just gonna use getters / setters, actually looks like the best option
Hey guys, I'm using discord.py to develop a discord bot on my raspberry pi. I am able to use slash commands and have created 44 command already which work however, when I try to create or remove anymore commands now, they don't update to discord. I removed a command and ran it and my command prompt told me the command no longer existed.
Has there been an internal update within discord.py or any related libraries?
as dumb as it may sound, did u save the file?
Yes
I did
I always save the file
I edit the file, save, close down command prompt, open new command prompt and rerun the bot
did u add the commands as global or local?
I added them the exact same was as every other command, and they all work
yes, but are they local or global?
How do I know???
well, when u register a command you either register as global or u supply a server id to register as local
global commands used to take around an hour to update on the clients
if u remove the command and try to run it, does it work or shows an error (on discord)?
Discord end: the application did not respond
Raspberry pi command prompt end: Traceback (most recent call last):
File "/home/jake/.local/lib/python3.9/site-packages/discord/app_commands/tree.py", line 1089, in wrapper
await self._call(interaction)
File "/home/jake/.local/lib/python3.9/site-packages/discord/app_commands/tree.py", line 1221, in _call
command, options = self._get_app_command_options(data)
File "/home/jake/.local/lib/python3.9/site-packages/discord/app_commands/tree.py", line 1125, in _get_app_command_options
raise CommandNotFound(name, parents)
discord.app_commands.errors.CommandNotFound: Application command 'printusersdb' not found
ok, then it's indeed working on your side
try waiting 30m or so to see if it disappears from the list
So my rpi says the command cannot be found but discord still shows it as an available command
I've waited around 4-5 hours
I'll update my pi, update discord.py and see if that fixes anything
pi update is not really needed, but dpy is a must
especially if ur version is from before the dev gave up on it
ofc the dev came back after a short hiatus and continued updates
but in that time window dpy got extremely broke from constant discord updates
pip install discord.py?
ig so
Aight thx
yw
from pip site, it's 2.2.3
Ahh ok cool
idk why ur getting that issue then
you'll need someone with more experience in d.py, that's as far as I can help
gl
git stashstashes your uncommitted changes in the current branch so you can either pull from the origin or upstream or any other remote, or do other operations that can't be done while there are uncommitted changes (https://git-scm.com/docs/git-stash)- There's no
git squashcommand, though I suppose you're referring to an interactivegit rebasesession, you can squash that, squashing multiple commits together to form a single commit, it basically merges the changes and commit messages of the said commits - Do a
git rebaseinteractively (https://www.git-tower.com/learn/git/faq/git-squash)
326 error gyp ERR! stack Error: Could not find any Python installation to use
don't squash, ffs if you value your sanity don't squash
so many ways it can go wrong
squash a destructive operation, unless you're 100% sure you need to squash don't attempt it
at best you need to git clone your repo again, at worst you lose all your previous work
Kuu I think you're mistaking an actual rebase with squashing
Squashing just combines multiple commits, it's not destructive
ah, it's basically batch ammending then
I think I did confuse with the former case
that thing haunts me from past experiences
Though technically squashing is part of a rebase process but it's not a destructive one, unlike others like drop (which drops a commit from the commit history entirely)
I just know it once happened to flatten the entire history of one of our project without a chance to go back
Flatten as in?
Alr ig im installing a random python
Damn, that sure is a big fuck up
Just install the latest version from https://www.python.org/
@earnest phoenix
whats that command to set msvs version
well that wont work anyway cause msvs_version is not a valid npm option anymore apparently
hello, i want to make an api where the queries are
userId, guildId, roleId
i want to check if user is in guild or not using discord api,
and can i get thia data even if bot is not in the server ?
First, what's the error you're getting? Show the logs
this would violate a users privacy
oh
also no you cannot get that data without having a bot in that server
installing nodejs build tools did not work
It seems like you don't have Visual Studio installed, you must install it, and then also install the "Desktop development with C++" workload
ive never needed vs installed
C++ build tools my beloved
im gonna install that and see if it works
You need it to use node-gyp packages usually
323 error gyp ERR! find VS You need to install the latest version of Visual Studio
323 error gyp ERR! find VS including the "Desktop development with C++" workload.
323 error gyp ERR! find VS For more information consult the documentation at:
323 error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
yeah but ive got the same packages installed and running on my pi with zero issues
i wish node installation included these things
That's because a Raspberry Pi does not run on Windows
fair
still i used to have this error and a simple command fixed it
setting msvs version or whatever
and now the installer is confused
stuck here
oh now it goes
guess that was a big one
The Node.js installer we provide for Windows already includes build tools, but it's opt-in
It's the matter of just checking one checkbox
yeah but i doubt it will ever install vs itself
ill just install vs community with desktop development
i've never used chocolatey lol, is it actually useful?
I've found it useful
mostly for installing programs I cba to go and download from a website when typing it in console is easier
Hello
node-gyp moment
node-gay
yes, especially since it also sets up the PATH environment variables for you
im making a compile command but i dont know how to make it so that when the command is compile js or py it would find the language in supported language.
https://sourceb.in/wvk3QDwdU0
is there a way to get my bot link shorter?
A URL shortener that's fast, ethical and easy to use. Our features include custom shortened URLs and detailed statistics.
Ok
not many people have the balls to do that
That's actually true
i'm maybe naive then
I'll also convert my code into typescript
I don't have intellisense in my command files
Just say you're working with notepad++
javascript
The easiest one also because of the huge number of guides
Pfff, why sqlite3 does that
can some people tell me what are the free mysql hosting ?
is 5MB of space a lot or it's not enoguh?
It depends for what
mysql db
notepad++ my beloved
For a public bot, certainly not, such databases are probably used only for testing/learning i guess
For those of you following along at home, slash command adoption rate at an all-time high in May with 78.6% of my users preferring slash commands compared to 21.4% still using prefixes.
AHhhhhh I just converted all my code in async/await for the mysql lib and I got this error
The syntax isn't the same across all SQL databases
Hey, I recently wanted to create a gui for my javafx program, I have currently coded a bit in normal java but I found out that you can make it easier by using the fxml where you can drag and drop and directly see the changes without having to compile etc. Could I still switch over to fxml and will it eventually provide me its source code?
MySQL wants AUTO_INCREMENT not AUTOINCREMENT
There are more syntax issues in your screenshot (if you really moved to MySQL)
Yeah I also realized that there were missing a comma and a space
Okay my bot is working
Good job
Thanks!
No ads please
people slowly getting annoyed into using them lel, or maybe its just old users leaving and new users coming, whith new users not even knowing about message commands
definitely not for a big public bot
though if you're just messing around with mysql for learning purposes it's good enough
could try giving cloudflare D1 a shot
it's in alpha and free (for now) and definitely not for use in production
you will need a clouflare worker to interact with it though so there's that
yes it's in nodejs.
Actually I found a sql hoster but it's 5 MB
I need to upgrade for 100Mb
Oh you're referring to MySQL space nvm
You won't get far with free alternatives though that's the issue
i mean can't you just use a local sqlite database on the same server as your bot lol
Especially performance and space
use a lot 
just make more accounts lol

idk how you would code to use it
but its a loophole
😂
Sounds bad ngl, especially to implement it
ikr it just came up in my mind 
"yeah we've reached 500mb lemme just get the 100th MySQL server"
AGAIN? Some people trash talked here because I was using sqlite
I CONVERTED ALL MY CODE in mysql with callback so I converted all MY LIB in promise based
you dont listen to them just use what you want xd
xNick...
You didn't tell me that
Oh otherwise I know, I'll use my brother's sql server
If he accepts

whut
try mongodb 🧌
It's not a vps
But it's way different than sql
And I don't have a db on my server
yes it seems better then
You can try
pfff
It will make the third time
I convert all my code
Oh I'll ask to ChatGPT
omg MongoDB so great
you'll have to rewrite all your code again to use it since it's nosql

I don't think so, if it's not vps then it's probably some kind of cloud hosting
it's a pterodactyl clone
*file still needs to be on your bot host's directory
I already used sqlite
I know dude
I converted my code like almost 4 times
JSON, Sqlite, mysql2, mongodb
How do I get the link of my MongoDB ?
Yes I saw that, but I didn't save the password
So I re-created a user
Why is this happening ?
messed up permissions for that user
okay
Maybe yeah! I haven't checked based on account age or anything, but my MAUs have been consistently growing at a steady rate from day 1. That hasn't been affected at all by slash commands.
First I didn’t want to use slash commands but then I found out how much easier is was to code xD
Since you can require some arguments in de slash command
Uh
They also can perform some permission checks for you
I guess it's because you need to respond within 3 second after interactioncreate event
yes, any and every processing should happen after defer
especially when using a remote (free) database
so where do I defer ?
right in the first line of your handler
Also remember to change interaction.reply() to interaction.editReply()
also why did u give up on sqlite?
If you are gonna use defer
Here ?
yes
ah why ?
I think you need to await it but im not sure about it
KuuHaKu can correct me if im wrong
me neither

putting an await there wont hurt even if it's not needed
me when async but you don't use await

await when you want the execution to happen after that operation is done
otherwise just ignore it
if your ide complains just put void before the statement
It's infinite
then it's never reaching editReply
are u running the bot locally?
but it doesn't send the message
try debugging
If it timed out they would have gotten an unknown interaction error.
Actually yes, to try the bot
was going to mention that
put a breakpoint in the defer and run in debug mode
yes there was an error
before I add defer

follow the execution to see where it stops
use the step function to move forward in execution
Ah, I didn't see the error in your console
like step in and step over
doesn't discord give interaction failed error when you don't respond in 3 seconds? or am i thinking about a different timeout
no but Discord yes
Yep, that's the one
Unless you deferred it
it does nothing
first of all, why is debugger a keyword? second, no
in which case it fails after 10 minutes if i remember correctly
debugger is for web actually
how do I do ?
There isn't anything inside your deferReply() method to send
debugger calls any form of debugging functionality you have set up
So yes it does nothing
click on the line number and press "run in debug mode" or smth on your editor
it's not specifically tied to browser debugging
deferReply is for just deferring, the actual reply is after the databasse ops
Can't see
u didn't add a breakpoint
Is there a rate limit ?
click on 80
yes, but you'll never hit it
at least not while testing
ok
tbh, not even while using as it's discord sending the request to u, not the opposite
the only ratelimits would be mongo itself and IDENTIFY
both unachievable without heavy abuse
???
yes f8 is next tab
f10 then
also just a headsup, it'd be better if u used a map
that way u can skip the iteration and go right to the command
I’ve seen bots “thinking” longer than 20 minutes xD
lol I even wrote deferReply() but read editReply()
Another reason to not text and drive
let the execution continue on itself and use the command again
but this time press f10 right away to let it defer
I don't understand what ur saying
line 80 is defer, it must complete within 3 seconds
He should still await the deferring in cases his reply follows before discord acknowledged the deferring
Which will then indeed fail
Guys It was working, but I just edited one thing then restarted the bot and it doesn't work anymore
move the breakpoint to here, to prevent stopping the defer
This was the last thing that worked
what did u edit?
well it broke the bot, so it's probably relevant

maybe the promise is halting the execution thread
as yk, js is monothreaded
The db takes to long to answer ?
ur using mongo right?
mongodb yes
no
Because it logs the curre nt character
the character data is logged
when I do the /characters command
I suppose getCharas is retrieving the characters from the db?
that happens when you do something weird like returning an embed field in a message instead of embeds array (a mistake i made once lol)
I know 
don't see why you need to do manual Promise stuff when an async function will do just fine
unless you are resolving from inside a callback you should not need new Promise
The timeout for deferred responses is 15 minutes
Or if your bot crashes or something it just keeps going xD
Alright good to know
my honest guess is that the total time of execution (db + loops + building embeds) is taking longer than 3s
but well, back to the defer thing, did u find where it's stopping?
add await to the defer as fake said
My gosh just await the defer
@boreal iron
Oh
Hmm im not aware about that bug
it's that
it stopped there?
Keep in mind for each isnt async
so I add async ?
put console.log(fields.size()) before fields.push
Ah nvm I didn't see the parentheses
to see if ur exceeding the max field count
ok
no i can't see
ah
wait
There is no data
Do I add || undefined ?
no, an empty array is still a valid property
just means no fields
still, that shouldn't prevent the reply
s could be null/undefined which causes an error and isn't catched, preventing aa from logging
that'd error in the console
true
so u don't even start the loop, as there's no data to loop over
the error must be inside editReply then
exactly
It's maybe the footer
indexOf is getting stuck then
put a breakpoint inside it to see if it loops infinitely
it's getting stuck then
btw, are u trying to just log the id?
don't u have that info already?
like, chara._id
oh, u want the index
hm, I do
where does it loops indefinitly ?
it's a forEach
not a while
AH
yes
Wait I'll add a catcj
Like that ?
or without the minus 1 ?
mhhh
it is the same
same
Ok
I found it
I have another problem
Only one character can be current = 1
ok it works
fun fact, you can use shorthand assignment
let a = 1;
let b = {
a: a,
}
let c = {
a,
}
// b and c is the same structure
that's indeed a fun fact i didnt know 
String ringtonePath = "Ringtones/" + countryComboBox.getValue().trim().replaceAll(" ", "-") + ".mp3";
System.out.println(ringtonePath);
Media media = new Media(ringtonePath);
mediaplayer = new MediaPlayer(media);
builder.createAlert("Successfully started", "I have started " + countryComboBox.getValue() + " for you.", Alert.AlertType.INFORMATION);
mediaplayer.play();```
why is this returning me error
:: uri.getScheme() == null! uri == '/Ringtones/Oceanic-Movement.mp3'?
this is my file structure
@. me if you know please
The constructor for Media requires a URL, so you'd need something starting with http:// or file://
that has nothing to do with js
it's Java
whatever URL format a function/method/class requires depends entirely on the function/method/class, doesnt matter what language it is
why do you replace spaces by - ?
its good practice as some languages/systems/OSes may struggle with it
the Ringtones folder is in the resources folder
you're offline
hello, i want to send a token in fetch request to my server, how can i send it so that none can see it even by developer tools
make the request server side, not client side
but its a front-end website
you can have an API create a request server side and return the result to the user
fetch
integrated in js web
fetch(url, {body: body}).then(res => res.json).then(console.log)```
@flat copper
thats not what they were asking for but ok
👍
is there any api that gives brc 20 realtime data or data by token
Does anyone know how I can assign roles to people etc when they vote for my bot?
listen for votes -> check if theyre in the server -> give role
How do I make it listen for votes though?
That js isn't it?
yes
if youre not using js, let us know what youre using, there is usually a thing for every language out there
I'm using python
there should be a topgg python sdk
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
This?
yep
Cool thanks


