#development
1 messages · Page 1931 of 1
How can he get locked out if we don't touch the input policy? Wtf
Hi
I'd have to destroy everything i own and forget my name and ssn to get locked out of my hosting
Im devlopere bot give mi role
fake is selling his account

... was close to say something, Sir!
my uppercasing skills are lacking
look at how small my lambdas are now
can someone else finish refactoring my code
each slash command has it's own github repo and ci/cd pipeline
instead of one big project with all the commands. so much better
Feels like 0G
How can I calculate the permissions from the channel objects' array of overwrite objects returned from GET /channels/{channelId} from discord api?
yeah it is quite slow
I've had to use it as a main driver one day
the good old days
aren't some states in the US dropping support for 2G now?
Mobile carriers have managed to fuck up the internet here the last 5 years.
3G has been shut down, more and more areas basically have no connection at all etc.
It’s just a joke
Am I’m the retard paying for that shit
2G is still a thing?
oh right 3gs been shutting down not 2
yeah in most areas
Pain
I don't get why they're shutting down 3g
Of course it is
You have to support all possible devices
I have a phone that emits radiation
a couple of years ago my daily phone was one without 4g support haha
Yeah mine too
I have 5G
Don’t need to upgrade if the phone still works
Cause I'm kool
I'm on a really weird network where 3g is faster and more reliable than 4g
only reason I'm on it is because has the cheapest non contract unlimited data
It was here as well but got shut down to deal as antennas for 5G
At an area 4G already has a really bad coverage
What
WOOOPS
mobile networks are so inconsistent
Yeah
If you don’t live in a big city you’re fucked
I also do wonder if some day access to Internet will become completely free
it's practically a necessity nowadays
if you want the same opportunities
Well maybe at the time anything has been censored due discrimination because any word is offending nowadays

that'd probably also be the case
Because humanity nowadays means stupidity
though I don't know if the government(s) would be too willing to kill the broadband market
maybe if you'd want faster speeds
Why should they… it’s the perfect mass spy fundation
and delicious tax cuts
The free internet is dying anyways since providers have began to threat packages differently looking into them where they come from to sell services whitelisting any consumer portals instead of routing any package anonymously, meaning dealing exactly the same with every package
In the future any available service can be whitelisted if you pay for it and the rest of the packages will be dropped due bandwidth limitations
That also allows to censor and filter the whole internet by just dropping packages coming from not by the government whitelisted sources for examples
I mean China is the best example
would tor be our only escape
And I mean it’s even a conspiracy theory, we can already see how it goes and Snowden has told us why, when, etc.
the future of society is looking quite grim
I don’t think so… if the whole world enforces it, Tor will be shut down fast
Tbh yeah absolutely
through entities trying to control something that doesn't realistically belong to them
Total control by your government, more and more rights and freedom is gone, anything you say can be discriminating because of any over sensible fucker out there and non-well payed jobs and increasing live costs are already the reality
very true
A really, really great future, yeah
there are too many people that are completely blindfolded to all of this happening or simply do not care
With the background, they tell us, to protect us 
thinking the government is on their side 😂
things will be better after the war
Yeah they all seem to grow up with the all this shit and don’t actually care about
It’s more important to introduce 20 different genders and remove any bad word or critism around the net to hope nobody ever feels bad reading some unrelated fucking opinion
all the shit that doesn't matter in the long run
and im sure they know all about it and try to keep them satisfied
youtube comments are the biggest censorship definition I have ever seen
So sad sometimes to look back and see how shit has lots of stuff become
Huh ?
Wdym
for example they quietly delete comments their ai thinks has the smallest tint of criticism or bad language
or shadow them
lol
Where are the good old days you could call somebody an asshole and both laughed and moved on
yeah I can imagine
Looks like anything "negative" needs to be controlled, fined and removed
luckily all of the people I know in real life are very open to dark humour and just overall banter
and don't immediately get offended
most people irl don't really care abt dark humour and laugh af
I read about people thinking of killing themselves just because there are millions of bad comments in their whatever.. Instagram account
Not that this is a joke but WTF why has the whole internet need to change or being censored because there’s somebody with mental illness?
I would better try to help that person and stop him/her from using that platform instead of censoring anything related to it
yeah
But that’s where we are
the newer generations have really weak mental health
the issue is that behind the internet noone will know who you are
Yes, 1000000% true
being anon makes some people go crazy
I'd rather have someone harass me anonymously than lose my right to privacy
Yeah that doesn’t change the fact the hate and criitsm hits people who are somehow need to present themselves on the net
But how far are you willing to go for privacy
If you do that and share you life with the whole world that CAN happen
We wanna censor the whole internet just because of a minority feels like they can’t deal with he "pressure"?
and to think this world for humans used to be about trying to survive in the wild and hunting animals for food as well as looking for shelter
I mean wtf
now there's a modern equivalent to that
see ya
tbh the root of all evil is twitter
yes
what about facebook
facebook is mild
yes too
Most social platforms tbh
twitter is what made the internet become what it is now
Facebook just wants to harvest your data
including this one?
or shall I say meta
any platform which aims to make a profit is probably like that or will eventually become that
Well discord is more localized than global tbh
at least in a few years we'll have this
https://www.youtube.com/watch?v=Ibm3WhfLk08
Mark Zuckerberg invites you to his shared Metaverse VR space.
Discord: https://discord.gg/surrealentertainment
Instagram: https://www.instagram.com/surreal.entertainment/
Twitter: https://twitter.com/s_entainment
Merch: https://crowdmade.com/collections/surrealentertainment
All my other links: https://surreal.media/
also zimo goated for helpi...
oh dear
next zuck can track and store the amount of times you take a shit every day
were the zuckertits really necessary?
like, we all know zuckerberg is a twig
It’s just hard to see what slowly happens but be the reality in a few years in terms of privacy loss, censorship and so on
I've been on some tor network forums
the people there are very different
it actually feels somewhat free in some sense
what, meta?
meta will be free afaik
and some people are already selling land there
Bruh
I been tryna do this for ages now;
How the hell do I delete guild specific commands from my bot?
if anything is free nowadays that's a red flag on its own
I think you just send an empty array when posting commands to the api
oh guild specific hm
not sure
Tried just sending a different array not including any other commands and just 1 help command, Still piles up a fuck ton of my previous commands
It is so confusing and idk how to fix it
Tryna use this;
rest
.get(Routes.applicationGuildCommands(client_id, '324195889977622530'))
.then(data => {
const promises = [];
for (const command of data) {
const deleteUrl = `${Routes.applicationGuildCommands(
client_id,
'324195889977622530'
)}/${command.id}`;
promises.push(rest.delete(deleteUrl));
console.log('Wacko ' + deleteUrl);
}
return Promise.all(promises);
});
Doesn't work sadly
Doesn't log anything either
did you try sending a post request for specific guilds with an empty commands array
if its just your test server reinvite the bot?
Tried that too
For some reason the commands persist
let me check
Have you tried reloading your discord :p
you need to kick and reinvite or wait an hour
How imma get a command id breh
Guild specific commands update immediately do they not?
They do
How would I get the id of a command?
Or /guilds/GUILD_ID/commands instead of /commands
oh yeah, that will get you the guild level commands and not the global commands
Lemme test
DiscordAPIError[0]: 404: Not Found
at SequentialHandler.runRequest (C:\Users\jaspe\Projects\Axo's BGN Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\jaspe\Projects\Axo's BGN Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:99:20) {
rawError: { message: '404: Not Found', code: 0 },
code: 0,
status: 404,
method: 'get',
url: 'https://discord.com/api/v9http://discord.com/api/v8/applications/897590420387815485/guilds/324195889977622530/commands'
}
.-.
I think I am just dumb
You sure you got the correct guild ID?
Positive
324195889977622530
Now using this;
rest
.get(
`http://discord.com/api/v8/applications/${client_id}/guilds/324195889977622530/commands`
)
.then(data => {
const promises = [];
for (const command of data) {
const deleteUrl = `${Routes.applicationGuildCommands(
client_id,
'324195889977622530'
)}/${command.id}`;
//promises.push(rest.delete(deleteUrl));
console.log('Wacko ' + deleteUrl);
}
//return Promise.all(promises);
});```

Get rid of everything before /applications I guess
You need the slash
You're right, I didn't see that it already prepended the v9 base URL 
At the beginning
Have you tried turning it off and on again?
why does the url even require a slash
when every call is going to require one anyway
yes
I mean I still gotta get the ID of a command for it to work I think
Where do I even get a command ID
Does anyone plan their discord bot, or not really?
Like I have a google drive full of documents and shit for my bot
No
I just get an idea and try get as far as I can coding it
I got weekly checklists for my bot, as well as a checklist for hiring new support team members
Nice
Even got a google group lmao
Idk if I’m going too far with it tho
But my bot be growing hella fast
yeah
So could be useful 🤷♂️
My Christmas bot was coded in a day without any real plan
What do you use to plan it?
I just said fuck it, I’m coding
I use google sheets and do a
Do a
Docs
If you go with a discord project (bot), it’s probably better to have it planned
Pain.
I feel like it's better
Better collaboration
I don't collaborate
What’s wrong with google docs lol
What do u use excel for?
Ohhh
Fair enough
I thought you said you illegally used it
I just have it and don't touch it
same with the full adobe suite(creative cloud)
Photopea Online Photo Editor lets you edit photos, apply effects, filters, add text, crop or resize pictures. Do Online Photo Editing in your browser for free!
Online photoshop clone
I use trello for tasks and project management
You could also use GitHub issues
Sometimes you wanna keep it secret from the public if your bot is open source
Depends on the feature
If I find a moderation bug I am not going to disclose it to the world before I patch it
For those issues, sure. But I guarantee 99% of bots won't need private issues. Most often it's just for privacy, but being open can't hurt that much given the bot's open source 😛
Can slash commands have more than 1 command in a command?
like /break **request** and then in another line /break **accept**
Ik how to do it in a Normal command, but do slash commands allow that?
Such as a uh, sub-command...?
Are you referring to subcommands?
Yep^
Then yes.
Sweet! Will go follow up with the docs, ty!
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
is autocomplete not released yet?
I mean in combination with nesting
ah
but you can just use a text command and have your own subcommands in it no?
parsing the autocomplete yourself
Don’t even get what you mean by auto complete. Auto compete commands or values?
the autocomplete interaction
i mean, i never tested it, but assuming it works like i think it works
Still all commands pop up even without calling the specific sub group
If you have 1000 sub commands and enter the slash, have fun finding something
thats why im saying, get rid of sub commands and parse them yourself
Ah ok I thought something else is meant by that
No if nesting comes alive you will only see config as command and if you select it or enter it, the sub groups will pop up
That’s at least what Discord explained how it should work
in the future
that'd be worse on the user imo
not if the autocomplete works the way it should
Let’s see what the future brings if Discord ever moves forward
Does it work for multiple parameters?
but what benefit would autocompletion bring over the built-in search for subcommands
I mean what I’m speaking about is exactly what auto complete is but built into the UI
for example, my bot has literally millions of possible input combinations, i cant possibly use subcommands or built in autocomplete
if i can receive autocomplete interactions and respond autocomplete suggestions to be shown to the user, then i could make my own system entirely
thats what i understand from the docs
Autocomplete interactions allow your application to dynamically return option suggestions to a user as they type.
C++ will retire in 2022. Learn more and see the countdown here.
what
would be a lot cooler if it did
why would anyone want to create a new C repo/project in this day and age
can i get some feedback on this architecture for slash command hosting.
start with a routing lambda that has an api gateway attached to it that is used as the interaction endpoint url. The routing lambda looks at the request and invokes a lambda to handle that logic asyncly. (There is a separate lambda with it's own codebase and ci/cd pipeline for each command) The routing lambda then acks the request.
wait why is every command its own codebase what
seems flawless to me
yeah, creating a lambda app creates a codebase that is ci/cd with the lambda
the lambda that is 15MB has all the logic in it currently.
if i split them up then cold starts will be faster
i mean, depending on what your commands do, thats very cool
you can independently host different commands for extra redudancy
but if your commands require looking up a centralized database, that will likely make everything slower
idk if they do database replication, i know cloudflare functions dont, they just cache locally
the lambdas are in the same datacenter as the database. us-east-2
yes but arent they replicated on their edge network?
well, not that it makes any difference
since its all coming from discord
i think you can pay more to do edge network stuff with dynamodb
but i dont really need that
im cheap
it would be completely useless in this case anyway
in general i like your idea
just worried about database latency
also are you using free lambdas or paid?
because if you're going paid, they will be more expensive than a vps, so that would be another downside
literally this #development message
they have their own input options
inside them
sorry, got pulled away for a sec. these are all free lambdas, but if i start getting millions of requests it'll start costing money
do you want the database to be on the same machine as the code?
depends on the scale
the lambda is in the same datacenter as the database so the latency is going to be smol
yeah should be good enough
i think anything below 100k guilds shouldnt warrant a dedicated server for a database
but also depends on the workload
im still using sqlite for all my projects anyway
my setup should scale from 0 to infinity. the lambdas take almost no time to spin up so they can scale up and down super quick. they can even scale down to 0 when there is no traffic
but are you really going to need it?
I think as a concept its worth looking into
the lambdas and the database both auto scale
and i have like 15 separate databases that each scale independently
you can see which commands are most popular based on how much each lambda is costing you
xD
built in analytics
if the bot grows i'll need it. i'm over 1k servers already
Does auto complete also include a match requirement?
Meaning if you enter a value you didn’t predefine in your code you can’t send interaction.
no, you receive anything the user types
but its set per option
so you only receive them for the specific options you enable it for
and only when the user is typing inside that option
But can’t I force the input to match my options?
wdym
yeah, with choices
cloudflare workers has like a 30x higher free tier cap
cloudflare workers looks super cool
the lambdas all share the same instance
isolates or something like that
but cf workers are on their edge network, which is a complete waste if you only use it for discord lul
lol
Yeah but do they support autocomplete?
Or do they pop up as option if I type?
you dont need custom autocomplete for choices
they have built in autocomplete
thats the whole point of choices
Yeah but I want to force a 100% match of my autocomplete value
if you enable choices, the user can only pick those choices, nothing else
only add autocomplete options that map to the choices options
but doesnt the interaction invalidate if the choice doesnt exist?
yeah
so yeah
i think you cant even send the request\
exactly
but it is still like a forced auto complete. you start typing and the choices are filtered down
yeah its built in
What’s autocomplete even based on? Your previous inputs?
command history is a different thing
what im talking about is when you are in the middle of typing a command
Wtf is it me or …?
and it shows you available options based on that partial you already typed
i should make a command with yes and no as the choice and then have autocomplete map yes to no and no to yes
lul
i dont think you can do that with choices, i mean, you can reverse the value, but the user doesnt see it until they submit
Available options you predefine like choices?
perfect, so they dont get a chance to fix it
if you enable custom autocomplete in a string option, you receive an autocomplete interaction event for every character the user types (while focused on that string option), and on each of those events, you can reply with a list of options for the user to see in their autocomplete UI
yes
idk if its any char or if it has a small timer on it
but i typed abc, and got 3 events
but this is nothing compared to presence updates, so...
¯_(ツ)_/¯
yes love querying
live querying
:^)
I did that after 3 chars entered live querying the database with any char entered
yes
Turns out to be a lot of traffic
When tausounds of users of my community panel entered stuff simultaneously
Ya ya I did just took a while to figure it out and notice
Learning by doing, you know
for me its not much of an issue, since im using sqlite, a LIKE query on 20k rows takes < 1ms
and my db is smol
compared to yours
Just didn’t got the difference between choices and autocomplete before you mentioned the event
Yeah the player database which was queried was huge
And indexing was complicated as I had to store lots of text and JSON
jasons
just tested again
its not every character
i think its one event when the user starts typing
and nother when it stops typing
I bet typing speed bots could use that
Live searching possible values to enter in my database or by using any API
its gonna be a huge upgrade to my bot
since the user can select from hundreds of thousands of options
I was thinking of making a new game bot with gifs, no art or anything this time just for fun
currently the user needs to use a separate command to find the id of an object by name
with autocomplete they wont need that anymore
i'll be using the autocomplete to show a list of members in the server and things like that.
Yeah compared to what I know it does, that feature seems to be perfect for you
Sometimes it fires autocompletion multiple times without additional input
Which is annoying
I still want command nesting tho! I want it! I want it! I want it!!!
could be from focusing/unfocusing on the option
i wish each command had it's own interaction endpoint
and then you could move the command to a new group or subgroup without needing to update code
it'd be so modular
but that's for the sake of convenience
you can still get modularity
with the current design
Might be a good idea then to cache your last response to not send the same response over and over again
yeah
I think most people just end up coupling the definitions and implementation (like me)
yeah I could
I've been avoiding cache but that would work
At least the last response
i do this to make it modular
i just make sure the command name is unique across all categories
then i can move it around without code changes
options.options[0]?.options
Yeah I don’t implement that in my backend, too if I can avoid it but it seems like a good solution here
Just so you save null checking up there
i dont think that's in the standard
Also, NOT || NOT?
where do you see these things?
It can be reduced to !options.options[0]?.options
?. is optional chaining, so if the former is null it'll also result in null
is there a quick way to see what the resulting js is?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.

How much data will you handle, the required performance, server capacity, knowledge, etc
any database will probably work
Ye, ternary
There's no web databases
You'll always need a backend somewhere
unless you're doing local storage on the user's device
in which you got powerful localStorage
sqlite won't work if the platform you're on wipes your filessysem after every deploy
but other than that the db doesn't matter
we don't talk about that one 🤐
Why, don't u like to kill ur data after using it? 
useful for banks and stuff
Yeah
Sites will be 80% of the time frontend + backend
Unless u want plain static pages
Frontend will be only visual stuff/user interaction
While backend will be the number crunching part
Either REST or websocket
that's not necessarily true I mean you have machine learning and stuff on the frontend
How does that even work?
assistive technology probably
Why would you need an API at all?
To establish a communication between both ends
Unless u run both front and back from the same code
Put the content you fetch from your bot into a database and query it
webassembly
Database ops on frontend 
One day the utopia of the browser talking directly to the database will come true
Oh he means an interactive dashboard?
Probably
Ah ok
you mean firebase
except that one
While you can, anything visible to the user is also accessible by the user
Keep that in mind
Thought we’re just speaking about some numbers he wanna publish he got from his bot
Either rest or websocket
you can share the database
2nd time that flash back today, you know which one 
you dont need a connection
you run a webserver, and you simply open the same database in the webserver
for example if your webserver is node.js + express.js
just open sqlite in there
and open the same file as your bot
Pay the support invoice before!

By editing your zone file or dns records
Whatever the panel offers
You buy domain, then assign AAAA or tf I forgot how it's called to the ip
A
Note, freenom is big trap
And AAA is for association of anonymous alcoholics
Wtf 20$
There're cheaper domains
Which tld?
a usual .com domain costs 11-15 per year
org domains are cheaper
xyz are super cheap
I have an embed with 2 columns, but discord has 3 columns by default. I add a blank field to make sure the fields show up in two columns, but it takes up some space still and is very noticeable on mobile. is there a better way to make 2 column embeds?
name: "\u200b",
value: "\u200b",
inline: true
},```
Yeah or less if it’s a special offer
Ye, that's the only way
is there a better way to make 2 column embeds?
No.
no other way
so you have more questions to ask us 😛
it would be cool if discord supported markdown in embeds
oh yeah
or at least tables
It'd be cool if discord supported markdown at all
Not that half baked highlighting
Imagine tables
content title and description support half baked markdown
Tables and horizontal lines
imagine the rich content you would output if discord allowed sending markdown pages
markdown tables are annoying
Ngl I use more html tables than md ones
would a built-in table editor look better
Cuz better customization
That's what scratch said
Cuz it's cheap 
the cheapest popular domain is .top
Mine was $2
at ~4.5 usd (renewal)
Godaddy also is damn good
Sus name
.top is ranked #9 in popularity
Some providers rely on external name service providers taking hours until a dns update is live even with a low TTL
Sometimes a day or longer
Hmm which tld do you want?
Good game
Yeah the registrar owning that shit wants to make moneys of that popular tld
if you want cheap, go for .top .in .eu
Capitalism, you know
.club
.net is cheap
its actually a country tld
What country is gg?
.gg is the country code top-level domain for the Bailiwick of Guernsey.
Uh yeah
There's also .wtf
quite expensive at 21 bucks
Oh heck I can buy godaddy.co for .01
Omg
What if I just
Took me 4 years to collect all of my xxdns tld
Yoink all domains
That's what google did
Lots of services buying cheap unpopular domains trying to sell them for big money if the popularity increases for similar domains
I’m planning on making my meme website redirect to my bot
Those placeholder sites with 3-4 ads right?
I waited 2 times until the one I wanted expired
Like I said just took 4 years 
But now it’s mine until I forget to pay for it
Wasn't there a dude who bough a google domain after they forgot to renew it?
Then sold to them for big money
I heard about that, too
top.top
Sounds promising
lmao
Do like elgooG
Buy gg.pot
I know but once a beautiful day my ddns service gets popular if I ever build a website for it I got lots of domains for it, all tlds
probably never
lel
i dont like buying domains too soon, because more often than not they will just sit there and be abandoned
But multiple domains from different providers are needed anyways for a redundant dns system
Even if only my infrastructure uses it
Omg I hate autocomplete
How about astroapp?
most of those combinations are already taken
i bought astro.watch though
gonna do something with it eventually
That sounds like something you can sell to the NASA
I have FINALLY finished so much stuff the last days I still had to do since I moved the dedicated server
ayy
Yeah finally some progress and some stuff being finished at all
I need help
Feel free to ask a question about it
any suggestions on how i can i add a delay on a loop?
For which programming language?
You can work with promises:
// Declare a function to return a promise which will lock the code execution until the promise is resolved when you await it, this can be used outside a function but we're doing for the sake of readability and usability in other files or areas as well.
function wait(milliseconds) {
return new Promise((resolve) => {
setTimeout(resolve, milliseconds);
});
}
// Now with the `wait()` function we declared, we can add a delay in-between iterations, remember that have to use the `await` keyword for that to work properly, which can only be used in the top level of modules and in async functions.
for (...) {
// Some code here.
// Wait 5 seconds before going into another iteration.
await wait(5000);
}
lmao
yea, you did; just explaining it 
lolz
hey guys
i am just starting out to create my own bot in python, but it seems that i have an issue with ti, can anyone help me out
kek
token leak, please reset your discord bot token
otherwise other users will have access to your bot
You should capitalize bot
So it refers to the class (https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=discord.ext.commands.bot#discord.ext.commands.Bot) rather than the module with the same name but different casing.
At the same time, are you using Discord.py, or some fork of it, like nextcord?
im using visual studio thingy and ig i am using discord.py coz i installed it in my tetminal
the files needed for discord
Although you seem to be new, you may want to use something else like Pycord or Nextcord since Discord.py has been deprecated.
Nope
ohh
Pylance (assuming you're referring to https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) helps you write Python code in your editor.
yea i am using that in my VS so got confused with em lol
help me how to use pycord bro, imma better dm u
if u have no prblm
It's more convenient to ask your questions here so others can help you.
kk
then help me out with using pycord bro
what should i do
i am using linux btw
You should follow the installation instructions on their website (https://docs.pycord.dev/en/master/). As Pycord is a fork of Discord.py, the process should be familiar.
I haven't used it myself, but I've used Discord.py.
ohh lemme check it
hey bro btw the code seems to be right now
but bot isnt online yet
If I had to assume, that's due to a bug in your code (<#development message>). client.run(...) is indented under the on_ready function, which is wrong, as it won't be called until your bot starts (which client.run(...) does, but that won't be called in its position).
The solution? De-dent it (remove the space behind it) so it sits at the top-level.
Python uses indentation to determine scope.
ohhhh
ahh man thanks a lot, it worked!!

if any doubt i will post it here then!!
this is why im never using python
I don't get why people complain about indentation
You'd still indent it regardless
it always runs in a different scope so it won't interfere with other scripts
which is why every single module bundler uses iife instead of directly outputting the code
The only thing I've seen it used for is top-level async/await
How's it any different than a named function you may only call once
var (minified variable name) = Object.someFunction
every bundle has this
which can cause interference
If you know your shit it's not a problem
I just stay in my own lane and let people suffer in their own ways. Not to say I'm not suffering from my language choices
I'm going to hate myself for trying to train a neural network for wakeword huh
getting the data is... interesting
this is the part I hate the most
you also never know if you have enough or don't have enough
you have to kind of guess
whats the error in this
Indentation, wrong init naming, wrong thing to inherit, wrong object to get the listener attribute from
are any of yall doing advent of code
wuts that
...
Some challenges I guess
Anyone know how i can fix this?
try channel.type == “nsfw”
What library
that wont work
because the type is like text,voice
nsfw is a boolean
but DM's dont hold that
oh right
Yupyup
just check if it's a DM
dms are never nsfw
Invite no work
@rustic nova
bot not approved yet
-upto
The average up-to-date approval times are stated [here](#support message).
This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.
There is no exact time for how long bot approval will take.
There is a queue and you're not first, nor are you last.
Read more about our reviewal process here.
How aplroved
read the embed above
@lyric mountain I somehow got it but im stuck here, i tried pretty much everything but cant seem to be able to fix
Not related to me, but probably message.channel
you didn't define channel
dm cant have guild
Its not a DM
it is
add if (channel.type === 'DM') return; above that line
I mean, that's how I think it is to check if it's dm
type casting
if(message.channel.isText()) {
const channel = message.channel as Discord.TextChannel
}
or const channel = <Discord.TextChannel>message.channel
its not a getter?
Should i lie to my verification assigned person and say that i made it for 30d or I actually implement it? It's too hard and there isn't a straight way to do it as you guys said to me
he can't accept it for 1y (a lie that i made it for 1y)
and has to be 30d
this is the thing to implement
i wouldn't lie
yeah i wouldn't too
but i already did it with a person's advice so i can't say him straightly that i lied
any advice?
just say that you've reconfigured how the data is stored
and it auto deletes after 30d
that's a lie (?)
true
Store the data for 30d only?
nope
store the data forever but if the user leaves the bot (entirely and doesn't have it in any mutual servers) delete data after 30d
What's the issue of adding a "last_seen" or "last_usage" timestamp to your data and add a routine removing that data after 30d?
that's not the thing
that's the thing
doesn't explain why you can't remove the data... as long as user is associated with your bot, not data deletion is required, if he's not anymore, delete the data after 30d
how to check if the user is not in any server with the bot
As I explained above add a user last seen/usage timestamp to your data storage, a routine clearing users after 30d but actually before removing the user data, fetch the user to check if he's still associated with your bot - if so don't remove it, if not remove it
he's still associated with your bot
fetch always gives you a user's basic info how do i check that? All is done like 1 week ago the thing is the mutual servers or if the user is associated with the bot check
By fetching the guild member the user is associated to to check if he's still a member of that guild(s)
Which does require to save all guild IDs of an user using your bot's commands in your database
which shouldn't be a big deal if you wanna deal correctly with the user data
Ok step by step...
When do you begin to store any user data in your database?
If an user enters a guild (member intent) or if an user uses your bot's commands the first time?
tim said that
bot's command, i don't have member intent
Alright. Just store the guild ID(s) in your database.
Just the guild IDs the user has used a command in
ok
Without fetching all guild members (without the intent) it's impossible to check if a user is still a member in a guild of your bot
and then?
But that's not important
then I ask for the intent in ticket?
If he's not a guild member of the guilds he has used your bot's commands in (for 30d) data deletion is justified
so if I use the bot in a server and then in another and leave in one and I stay in another, the bot will delete data anyways?
Nah as I said, after not using any command for 30d, you gonna check if the user is still a member of the guilds you store in your database, and if so do nothing, if not delete the user data
I don't see an easier way if you wanna deal correctly with the user data
Except just saying you do...
I made a web page for it using the media recorder api
So I'm just collecting stuff atm
example:
on member join (or on first command), add user data to database, with a list of guilds, for example { userid: id, guilds: [guildid here] }
when the member joins another guild, check if the user already exists, it it does, add the new guild to the list: { userid: id, guilds: [guild1, guild2] }
when a member leaves, remove the current guild from its list: [guild1, guild2] -> [guild1]
when you do this, check if the list becomes empty. if the list is empty, for example [guild1] -> [], then delete the user
That would require the member intent tho
no?
At least the part of knowing if a member left a guild
You explained almost the same I did
Well there actually is
After not seeing the user for 30d, fetch the guild member object of the guilds stored in your database the user is in
If he's still in a guild, no deletion is required
If he's not, delete the data
ask for the intent and explain your use case
they'll likely give it for that as it's hard to implement without especially at scale
True but the way I mentioned isn't complicated to do at all
no
but its not scalable
at all
you'd hit global ratelimit after having to check 60 users lol
unless you did like 1 user per second
which isnt really efficient
the intent would make more sense
since you get it directly from the gateway
That’s about right but I doubt the users using commands at the same time, then not for 30d for example, will all need to fetched at the same time
That may get an issue if the bot is really in 100000s or millions of guilds I assume
doesn't really matter, but after a certain scale you will hit that limitation
Yeah that’s for sure
even with 2k guilds you could hit that limitation
there's too many factors at play that would risk API Ratelimits, which means it's more of a risk to implement it like that
not saying your idea isn't right, just logically it wouldn't make sense to use it if you want to build for scale
I mean djs should do queueing the requests for him anyways
It could just end up in a short delay before the deletion happens
Yea, but still not really scalable at all
But yeah the intent is the easier solution here
especially considering you have more than just those requests happening
nearly* all api requests count towards the global rl
send messages, fetch guilds, fetch user etc
Let’s agree to the fact that is plan B if the intent gets rejected for some reason
If he wants to deal correctly with the user data
ye
Can data be saved permanently if the user has an easy way to request a deletion of it?
Seems like something discord would approve of
i
just started discord.js
its showin
this
Error: Cannot find module 'node:events'
can anyone help?
I doubt they'd care but pretty much all data protection laws request the data has some kind of expiration date
ok asked
thx this helps
[citation needed]
the fact i have this bookmarked
lmfao
time to lie about deleting the data
Although the general rule is that you cannot hold personal data indefinitely ‘just in case’ it might be useful in future, there is an inbuilt exception if you are keeping it for these archiving, research or statistical purposes.
You must have appropriate safeguards in place to protect individuals. For example, pseudonymisation may be appropriate in some cases.
This must be your only purpose. If you justify indefinite retention on this basis, you cannot later use that data for another purpose - in particular for any decisions affecting particular individuals. This does not prevent other organisations from accessing public archives, but they must ensure their own collection and use of the personal data complies with the principles.
You'd have to abide by that regardless lol, since you store data for users outside of russia
is it bad leaving billing details on an insecure database?
just address and name and that
We haven't been hacked yet so like it works
get another company to handle that so when they have a data breach you have nothing to do with it lmao
You know you can be fined hundreds of thousand for a databreach right
most companys that arent huge that get hit
go bankrupt
or just cease existing
Do they state how long at most you can keep it, as that looks quite vague
For example, I wouldn't want to delete a user's account because some guy at the GDPR thought they were inactive for too long
As per the General Data Protection Regulation (GDPR), any personal data must not be kept any longer than it is necessary for the purpose for which the personal data is processed. This further means there is a time limit on how long customers' data can be kept intact. Though there is no specified time limit.
So there's no explicit time limit
But still want you to keep it for as short as possible
ye
Seems more targeted towards analytics/short-lived data like a command usage
But long term data like accounts can exist forever
Mod logs can exist forever
But then any data a bot holds shouldn't really be deleted as I may leave a server being level 86 and come back a few years later expecting to have the same level unless the server reset it
(websites are different)
When attempting to register slash commands and running node deploy-commands.js, I get the message, “Successfully registered application commands.” But the commands don’t appear in the server.
Code: https://sourceb.in/nJ5yRstSKQ
As I already explained yesterday, get rid of that fucking code copied of the djs guide, it's trash, trash, trash
Registering commands over and over again is nonsense, not to say bullshit
Also registering global commands can take up to an hour until they're pushed to all guilds
That's the reason they don't appear in the guild
And registering them over and over again will always cause the same issue and can end up with multiple commands with the same name show up and all interactions will fail
if (data) data.delete();
Ah Mb. Ty
data.delete() isn’t a function
even i can read.. that has come even once so why did it come
how are we supposed to know? its your code
you need to figure it out, first of all console.log(data) to see what it is
Did anyone has a Slash Command Handler for me?
find one online
I don't find one online
I don't want to install packages just for Slash Commands
make your own like everyone does
I wonder what's so difficult to make your own? Nothing different to a common command handler...
Is there anything wrong with this code?
Even though the channel is NSFW, the bot says that its not
if(!message.guild) return
let { channel } = message
if (channel.type === 'DM') return;
var errMessage = "This is not an NSFW Channel";
if (channel.isText() && channel.guild.nsfwLevel !== 'AGE_RESTRICTED') {
message.react('❌')
return message.reply(errMessage).then((msg) => {
setTimeout(() => msg.delete(), 3000);
});
}
isn't it channel.nsfw? This should return a boolean
the guild.nsfwLevel checks if the guild is age restricted, not the channel
app.post("/deltodo", async function(req, res) {
console.log(req.body)
const userId = req.body.userID
const todoId = req.body.todoID
users.updateOne({
_id: userId
}, {
$pull: {
todos: {
todoId: todoId
}
}
})
res.redirect("/todo")
})```
why doesn't that save any data to the db
what mongo library are you using?
const MongoClient = require('mongodb').MongoClient;
that
I usually use MySQL but we're using Mongo for this project
what is $pull supposed to do?
im not too experienced in advanced mongo syntax but I'm sure an update query shouldn't require that?
It’s pulling the information needed to a table
would be easier to know what exactly the code is trying to achieve
its meant to delete the todo id from the database
delete the attribute or the document
that was a question
what library version are you using?
Use the api
will do
not for what i'm using it for
Ah
when you click the "Mark as complete" button it needs to remove it
users.updateOne({
_id: userId,
}, {
$pull: {
todos: {
todoId: todoId
}
}
})```
thats my current code
hi, someone know hot to get member info in JS for a dashboard ? I make it in python, but in JS I understand nothing ,-,



