#development
1 messages ยท Page 1438 of 1
users.get(id) = User
members.get(id) = Member
members.get(id).user = User
you cant get everything spoonfed
does it not auto convert the user to an id?
?
Hello ! I'm trying to insert new request in sequelize dynamically but I don't find a way to do ... Here my basic request
// ...
where: {
[Op.or]: {
field1: {[Op.like]: `%${value}%`},
field2 : {[Op.between]: [...]}
}
// ...
The fact is that I want to add a new value to search into field1 and being able to find rows that can contain one of both value but I don't know how to add this new value and I don't know how many new value have to be queried ... A loop is required ... but how to create this request, i don't know
PS : just doing this bellow isn't enough sadly
//...
field1: {[Op.like]: `%${value}% %${value2}%`}
//...
Is someone better than me please ;-; ?
Where do you see this? What are you doing? What is your code?
we need a lot more information
a lot more.
looks like dblapi.js
401 is very general lol
bot.js
dblapi.js error
dblapi.js has Oops! ${err} in their example pages
probably not providing a token, or its invalid
so i recognize the error structure
you need an key right?
you used the wrong token
token is probably not being provided or it is invalid
You cannot use the API until your bot has been approved, by the way. So... that's probably it?
i have an array as my cmd handler but not a collection, so how would i work with cooldowns
i looked at djs docs
but thats for cmd handlers as a disc collection
you could do something like a Set or whatever with timestamps and the command name
set a cooldown after its ran
yea but i dont wanna do that for all the cmds
i just want it
in index.js
i have a module.exports config
so how are you storing the commands
so i can just do
is there like a command.name
coooldown: 5,
like that
yes
const commandName = args[0].toLowerCase();
args.shift();
const command = commandList.find((cmd) => cmd.name === commandName || cmd.config.aliases.includes(commandName));
if(!command) return;```
you could do something like const cooldown = {commandName:[ {user id: timestamp} ]};
then if it doesnt exist or is past 5 seconds
set the value to Date.now()
const cooldown = new Discord.Collection();
if (!command.config.cooldown) {
cooldown.set(commandName, new Discord.Collection());
}
const now = Date.now();
const timestamps = cooldown.get(commandName);
const cooldownAmount = (command.config.cooldown || 3) * 1000;
if (timestamps.has(message.author.id)) {
const expirationTime = timestamps.get(message.author.id) + cooldownAmount;
if (now < expirationTime) {
const timeLeft = (expirationTime - now) / 1000;
return message.reply(`please wait ${timeLeft.toFixed(1)} more second(s) before reusing the \`${command.name}\` command.`);
}
}
timestamps.set(message.author.id, now);
setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);```
what about it doesnt work
the cooldown
doesnt work
it lets me repeat the commands twice
in 5 secs
the cooldown is 5 sec
const canva = require('canvacord');
const Discord = require('discord.js')
module.exports = {
name: "trigger",
description: "Triggers somebody",
async run (client, message, args) {
const member = message.mentions.members.first().user() || message.guild.members.cache.get(args[0]).user() ||message.author;
let avatar = member.displayAvatarURL({dynamic: false, format: "png"});
let image = await canva.Canvas.trigger(avatar);
let triggered = new Discord.MessageAttachment(image, "triggered.gif")
message.channel.send(triggered);
}
} ``` Why if i use this it says "cannot read property of user of undefined"?
user isnt defined
no
the property where he is getting user on is undefined
o
what
like there is no mention it goes to control if there is a Id or if there is no ID it just returns the message.author
what
like
what exactly would i need to change here
im thinking maybe const cooldown = new Discord.Collection
ok ill take a look at your cooldown stuff
because my commands are in an array
i made this so first it tries to see if the author mentioned somebody and if thats not true it see if the author sent someaones ID and then if there is no ID too it will returns the message.author
no but you could do
msg.mentions.members.size ? message.mentions.members.first().user() : msg.author
i tried doing client.cooldown = cooldown
thats not the problem
but that obvs doesnt work since cooldown is just being defined
I do
log the collection
wym
if (!command.config.cooldown) {
cooldown.set(commandName, new Discord.Collection());
}
shouldnt this be
if (command.config.cooldown) {
cooldown.set(commandName, new Discord.Collection());
}
i mean i did that
but
it still doesnt trigger
the cooldown
const config = {
description: 'Shows a list of commands.',
aliases: [],
usage: '',
cooldown: 5,
rolesRequired: []
}```
its in the config
i think theres something wrong with the timestamp stuff
const now = Date.now();
const timestamps = cooldown.get(commandName);
const cooldownAmount = (command.config.cooldown || 3) * 1000;
if (timestamps.has(message.author.id)) {
const expirationTime = timestamps.get(message.author.id) + cooldownAmount;```
command.config.cooldown
that should work
const cooldown = new Discord.Collection();
if (!command.config.cooldown) {
command.config.cooldown = 3
}
if (!cooldown.has(commandName)) cooldown.set(commandName, new Discord.Collection());
const now = Date.now();
const timestamps = cooldown.get(commandName);
const cooldownAmount = (command.config.cooldown || 3) * 1000;
if (timestamps.has(message.author.id)) {
const expirationTime = timestamps.get(message.author.id) + cooldownAmount;
if (now < expirationTime) {
const timeLeft = (expirationTime - now) / 1000;
return message.reply(`please wait ${timeLeft.toFixed(1)} more second(s) before reusing the \`${command.name}\` command.`);
}
}
timestamps.set(message.author.id, now);
setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);
try that
you were resetting the commands cooldown every run
doesnt work
it jsut
just*
lets me use help twice
without restricting me
this is in seconds right
if its in millseconds then its obvs not working for a reason
milliseconds*
*1000 gets you ms from s
one sec ill try running it
i think its bc my cmd file isnt requiring it?
not sure
yea bc
const config = {
when i type aliases it automatically pops up
doesnt happen for cooldown
wait do you have const cooldown = new Discord.collection in on message
yes
how would i set custom
if(!reason) reason = 'Unspecified';
^
TypeError: Assignment to constant variable.
``` what have i done wrong
like You cannot rob <user> for another <>!
ohh right thanks
you can use ${commandName}
you could make like a property on the command called cooldownMsg
and make it you cannot do whatever for <S> seconds
and then replace <S> with the seconds
Sigh.... anyone know how I can connect my coding to my discord bot?
yeah i want to make it so u cant rob for 2 hours
but it will show in seconds
so i want that to convert to hours
@earnest phoenix where is the coding?
yeah you could just / 60 / 60
its one way of doing it
then in index.js
yeah
you could then do command.cooldownMsg.replace('<H>', hours)
return message.reply(cooldownMsg);
but how would i define cooldownMsg in
index.js
return message.reply(command.cooldownMsg.replace('<H>', hours))
or whatever
its one way of doing it
ohhh
ok
command.cooldownMsg
would work
for
just having it in the cmd
ok that made no sense
// in index.js:
return msg.reply(command.cooldownMsg)```
example of a non-hour cooldown
how do you set a bots status? i cant seem to find anything
its dsharpPlus
C#
oh shit tysm
hi
@sterile lantern just use fs to write to every single file
huh
what is the best libraries and database with a bot?
depends on how complex you code
not really but
if ur a beginner in js
quick.db is a great db 2 use
do you have any with python?
Hey, I'm new to discord bots, but does anyone know a bot that can do a reaction role that triggers a "@mention"?
how can i make a uban command
when i made it and used it, it throws an index out of bounds exeption
idk why
do i need to fetch the bans and remove the selected ban?
about all roles bots and many giveaway bots
yes
kinda
how can i do that
i am
and catch error
if they aren't banned then it sends "user is not banned!'
example
the error is out of bounds
I was trying to use Carl bot, but I don't seem to find a command specifically for that
congrats, before verification, i could get the users' presence, now I can't ๐ฆ
You need to enable the intent in the dashboard @outer perch
I haven't reached 100 members yet
You just said you got verified?
Hi I can't get to put the bot I created in my server
Why don't you just try enabling it
You can generate a link in the dashboard
Okay
Well I cant think of any other reason for why it would stop
how would i make the bot say:
Please wait **1 hour 5 minutes 3 seconds** before using this command!
at the moment its using
const timeLeft = (expirationTime - now) / 1000;
should I ask support from Discord?
or just wait until 100?
You might as well ask them
Hello
It's not, they just explained that
How do you make the up and down moving animation for your bots logo
Bruh
How specific of you
I verified before adding to a team, since I couldn't transfer it, I asked Discord, and got it into the team now
Like Carl bot has I think
You just leaked your token
fuck
Lmfao
well then
already did
you never know ๐โ๐จ
Can't you just inspect to see how it was done
Hmm
It seems you want to make the date shown relatively. You could use the ms package to show the time in a human friendly form ("X hours", "Y minutes", "Z seconds", etc.). If you want to be more specific ("X hours, Y minutes and Z seconds"), you could use the modulo operator with the ms package to get the total for each time frame.
Of course, you could implement it yourself. Get the time in ms, divide enough to get it in hours, and say how much time from there. ```js
// now is Date.now() + 10000 (10 seconds in the future)
${(now - Date.now()) / 1000} seconds
Maybe the `moment` package has something in store for you.
so i did a false affirmation, the app wasn't trasnferred to the team
uh
`Please wait ${timeLeft.hours}h ${timeLeft.minutes}m ${timeLeft.seconds}s before reusing the \`${command.name}\` command,` + `${message.author}` + '!'``,```
i have this
in
my cmd
but
timeLeft is index.js
so how do i define that
because if i define timeLeft
i would have to define commandList
then commandName
then command
in the command file
should i just do const timeLeft = require('../index.js')
check moment.js documentation
Wait whst
the cooldown is set in index.js
How is timeLeft index.js
i just want a custom cooldown msg
because
its in there
but im saying that wont work
Oh
so i dont know how else
to define timeLeft
without adding the cooldown function into my cmd file
this is what it shows to me when I click inspect on the pfp, what am I supposed to do here lol
wait so if a file is in a command folder
how would i require index.js
..index.js wont work
./index.js doesnt work either
I don't see any animation on this bot's page
oh god im dum
yea i dont know how this is going to work ;-;
I'm not able to find a bot where it is animated wtf
well i did this
and i got this
Please wait undefinedh undefinedm undefineds before reusing the rob command
it comes out as undefined
cooldownMsg: `Please wait ${timeLeft.hours}h ${timeLeft.minutes}m ${timeLeft.seconds}s before reusing the rob command, `,```
timeLeft doesn't hve a hours and munites and seconds property
instead, use
${timeLeft.toFixed(1)}```
it would show only seconds, i don't know how to show hours etc.
oooof
it shows the seconds remaining
like 10.0s
ik
i want 2 hours 0 minutes 0 seconds
like that
๐
let time = ms(timeout - (Date.now() -cooldown));
this will work
buttt
the only problem is that time wont be defined in the command
since its in index.js
ugh
wait
maybe i should do
if ${command.name} === rob
then
message.channel.send(this msg)
would that work
@hollow sedge how to add bg like this bot https://top.gg/bot/623545336484462593
css
hmm
oh wait
no
that's an iframe
and if you're talking about the background image then yes
it's css
AYYY OMG I DID IT
if (`${command.name}` === 'add-xp') return message.reply("this will work")```
@copper cradle do you know how to do it in css
Hey! I literally have no idea what I'm doing, and now I own a Moderation bot, and a Music bot, if someone could help me please do, because I spent 11 hours yesterday making them, and I probably messed up so hard, because now they are offline :D
check ur logs
also, my cooldowns reset if my bot restarts
anyone know how 2 change that
or maybe i should save it with a db
idk
if (ReplacePrefix.startsWith("unban")) {
if (event.getMember().hasPermission(Permission.BAN_MEMBERS)) {
event.getGuild().unban(event.getMessage().getMentionedUsers().get(0)).queue();
event.getChannel().sendMessage("Successfully unbanned " + event.getMessage().getMentionedUsers().get(0).getName()).queue();
} else {
event.getChannel().sendMessage("You must have the `Ban Members` permission to use this command!").queue();
}
}
When I do S!unban <@{userid}> it sends a index out of bounds exception, how can i fix this?
what are you coding in??
java
oh makes sense
uh
try doing S!unban
if it sends "Sucessfully unbanned" something wrong wth ur error msgs
with*
also send index out of bounds
so currently my db
has money stored as
money_${message.author.id}
so i want to make a leaderboard
how would i fetch ALL the values of money
i dont think this would work
let money = db.fetch(`money_`, { sort: '.data'})```
@sterile lantern make an index
@earnest phoenix ffmpeg
what's that
also why is it saying it cant read property of length for this
for (let i = 0; i < money.length; i++) {```
@earnest phoenix yes dont ask i odnt know anything abtnit
@sterile lantern just keep an index of people's money with their ids there and then just sort it
the stuff you already store in database should be fine
in my db
its just
money_userid
so how would i sort the top money
like that
let money = db.fetch(`money_`, { sort: '.data'})```
this doesnt work unfortunately
what lib is this?
for your database
So this is where you pay for advertising
@sterile lantern try adding a money_index property to every Guild object in your code which is a Discord.Collection
then just set stuff in that when people run economy commands
This is a development channel, got nothing to do with advertising.
Ah so sorry
and when somebody requests the leaderboard, sort the Map and send it in the channel
uh
well
its just one server
so i dont wanna add a guild object
is it not possible
to sort
from the users
its just
money_id
so i just sort the integer
from money_id
see if i were to fetch a users bal
it would be money_${member.id}
so how would i just fetch everyones bal?
can you stop typing like that
db.all()
well that would fetch everything in the db
i just want all money
not the cooldown stuff
One of the major issues with quickdb is it has hardly any features.
@solemn latch oh wow you're a bot reviewer now
yeah 
Why is this code not working on the site?
border-radius: 50% !important;
border: 3px solid purple;
animation: float 5s ease-in-out infinite;
}```
let user = bot.users.cache.get(money[i].ID.split('_')[1]).username```
username is undefined
well it says it cant read the property rather
Does anyone know how to add dropshadow to the comment text on your bot page?
well i guess this is good news, kinda?
except for the fact it doesnt have the user which ill fix in a sec
how would i make it so it only prints the numbers 660, 597, 3, 0
aka the four balances
and this doesnt work for some odd reason
let user = bot.users.cache.get(money[i].ID.split('_')[1]).username```
anyone know how to make a uban command
that
IndexOutOfBoundsException is coming from event.getMessage().getMentionedUsers().get(0), so for some reason, no users were mentioned in the message.
or no users are being recorded as mentioned when it should
Can someone tell me how to add text shadow to a text on the bot's page?
How can I define the private library in my robot
its text-shadow
robot
What do you mean?
to the class where you want it to be?
uh
How can I add the library in my bot
I tried it in ".comment-content mb-3", but didn't work
than its the wrong class, because mb-3 is the Box if im not wrong
Do you mean to ask how you can show what library you're using on top.gg, or something else? Please rephrase the question.
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>')
@bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token')
https://discordpy.readthedocs.io/en/latest/index.html and this link
can you tell me which class is for comments
I can't find anything
thx
no problem
Is there any way to make a global variable through files? I'm learning about using a command handler and I understand now but other than module.exports is there any way to make a global variable that can be acessed through all my files
Hello, how are you? I need to know how to do a say command that the bot can say anything with more than 1 arg, how is it done? in discord.py
If you're using the command framework, discord.py explains this: https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#variable
working on .comment-content for me
hmm
if you mean the comments
you need to export it and import in another files
alr
You could set a global variable under the global scope, but people tend not to do that since it stems from memory leaks: js global.x = "y"
You could also do what Alina said and export and import from another file. I'd only use the global approach if you want something to live through the entire lifespan of the program and don't want to go through the hassel of exporting and importing
ok thank you
how would you make it so a user can specify a user ID and it returns that user id's profile
i forgot
discord.js?
yes
const user = message.mentions.users.first() || message.author
thats what i have rn
but thats checking for mentions
i want user ids to be a valid 'user' too
let the line check if args has an ID
if that id is cached yes
oof it doesnt work
where did you put it?
after const user
const user = message.mentions (that function) || msg.author || then that
@molten yarrow Ok, it worked, thanks a lot
you should check before message.author
message.author is always true
nice :3
and still deosnt work
doesnt*
i dont think message.guild.members.cache.get(args[0])
Thank you, a global variable is what I'm looking for. But how do do I access a global variable?
looks for ID
you're passing a raw mention string into it
Nobody pings users like this: hey 503948134439976972 how's your day going?
mhm i dont want them to ping
one sec
client.guilds.cache.get(message.guild.id).members.cache.get(message.author.id)
``` @sterile lantern
I designed a single line of code a few months ago that had every single way to find a user from the message so you can ping them or send the id or even just send the username
ONE SINGLE LINE
ยฐayuda
lol, 
want to take a look xD
i thought it's in my backup repl somewhere in my profile command too
what a coincidence
why would you want a line of code so long
how would i make it so
the nickname of the user
is a valid option
so ;profile samm
that will work,
give ur parameters @sterile lantern , which u overgive the command
the ones that i use
like message.author
?
const user = message.mentions.users.first() || client.guilds.cache.get(message.guild.id).members.cache.get(message.author.id) || message.author ```
thats terribly formatted but ignore
thats redundant
all i want is
;profile samm
to display my profile
say my nickname is
james
;profile james

would display my profile
user = first mention || cache.get guild .get author || author
o
hm
actually doing ;profile james would result in conflict
so uh
just user ID
ig
what
look it works
@modern sable #development message
Bismillah
bruh
@pale vessel for what lol?
But i remember it thoroughly tho (you never know it might come handy)
marco best mod
Marco uses his macros
why u shitposting here
@earnest phoenix random images in #memes-and-media
xD
@modern sable you best mod
@modern sable itโs just a small Code itโs secret
well either of those
can result in conflict
so i think id
will be better
since if two ppl have same nickname bot chooses random one
so yea
How is it done for when a person puts an invalid or incorrect command that the bot tells him which command is not available?
yes fetch always with the id
xD. good conclusion
if (command == undefined)
What would the entire script look like as such?
here it is
spoonfeeding on the next fucking level
let mentionedMember = message.mentions.members.first() || message.guild.members.cache.get(args[1]) || message.guild.members.cache.find(x => x.user.username.startsWith(message.content.substring(`${prefix}${command.name} `))) || message.member;
Is in discord.py
Python
How is it done for when a person puts an invalid or incorrect command that the bot tells him which command is not available?
the bot literally just checks if the command exists
bro why filter when you can just use find()
i didnt know it existed
why .first when you can use [0]
also you are mixing users and members
since you don't use indexes on collections
it should be message.member
two edits later it's now perfect
also, nice, x gang
why [0] when you can use ?.[0]
redundancy 
Yes
only in node 14+
the future is now
who isnt using node 14+
probably 70% of the JS user here who have no plan on how to update
nodejs
I always just install the newest version so I don't have to ever update
Node.js has a lot of updates frequently
what about a running server? a vps usually dont does it by itself
repl won't let me change the node version
oof
then don't use repl
vps for private bot why
buy a Raspberri pi
I have a rpi2
it is currently using 100% cpu and I can't restart it because something broke
im also too lazy to unplug it
have a RPI 3 running pihole and a unify controller.
await data.save()
}``` why does this return with ```(node:15228) UnhandledPromiseRejectionWarning: TypeError: data.save is not a function```
how much is rpi3 ?
you need to save to your Schema not a random value
when ive bought it together with a SD card and Case 50โฌ
are u using mongoose or sql?
mongoose
thats mongodb syntax
I use it to
i might know the reason
try await warns.save()
one sec , have a code
static async fetchGuild(gldid) {
if (!gldid) throw new TypeError("A guild id was not provided.");
const isguild = await set.findOne({gldid: gldid });
if (isguild) return false;
const newguild = new set({
gldid: gldid,
});
await newguild.save().catch(e => console.log(`Failed to create guild: ${e}`));
console.log("Guild fetched");
return newguild;
}
here
@astral yoke
NOw he is afk 
My 8ball command
is that dbd or somthing
anyone using gcloud to hosting bots?
gcloud firewall probably blocking requests from top.gg apis and i cant use that..
just unblock it
how can i do that?
in your google cloud admin panel thingy
no you dont
you need to unblock your own port
for example if you host the webhook server in port 5000, you unblock port 5000 in the firewall for all IPs
i cant select all IPs
you can
did you create a static address
you want to use webhooks?
yeah
what port did you put your webhooks on?
80
really?
yeah
then yes
i need to reboot vps or something ?
now on req bin
{
"error": "Unauthorized"
}
but when i put header with authorizaton
it showing timeout
it works but
when i try to autorize
the site times out
what does your webserver run on?
Potatoes
but, without authorization header it works fine
debian 10
It something wrong with my vps im sure, on other hosting it works fine
yeah
i trying to get vote updates on channel with webhooks
whole day
on mine main hosting it didint works properly
i think its something blocking requests from top.gg apis
actually im hosting bot on gcloud, i tried unblock it but it didint works, i still have error : unauthorized
im checking that on req bin

which webserver are you using?
express
are you running node.js as root?
yeah
ports 1-1024 are privileged ports, only the root user can use them, and therefore they are not recommended
show your express code
yeah
anyone know how to host a discord.py bot?
When I try to send a request without authorizing i get a response all good but when i try to authorize it times out
If I need to use a db for storing data, how should I reduce the amount of requests I make to it, if I need to save data every few messages or inputs
caching
@autumn vapor https://contabo.com
German server provider | #VPS from โฌ3.99 / mo | EU and US Locations available | 15+ years of experience | 70k+ happy customers | #hosting #cloud #infrastructure
cheapest is like $5 for 4gb ram
An interval, maybe
maybe
Thanks
np
so ive tried many endings for this.... and it doesnt loop its starting to frustrate me all i need is, it to loop but every way ive tried returns no error ~ no attempt to loop it or repeat it ive been ffrom docs to doc sbut nothing shows ive tried yt nothing returns what im after anyone able to help
const opus = require('opusscript');
exports.run = async (client, message, args) => {
const connection = await message.member.voice.channel.join();
message.member.voice.channel.join()
const dispatcher = connection.play('Aronchupa-Little-Sis-Nora-The-Woodchuck-Song-[Bass Boosted].mp3', { volume: 0.7 });
dispatcher.on('start', () => {
message.channel.send('Radio is Now Playing!');
console.log('playing audio!');
});
dispatcher.on('finish', () => {
play(connection);
});
}```
hm
How can I make it so that when someone sends an image/file and they delete it, it returns nothing?
@fair pasture Check is the message is deleted.
yes but basically
Im doing a logger
and When someone sends a image/file and they delete it
it sends a no value error
Use try catch
To catch the error before it get's logged and choose what to do maybe send back a response that The image could not be found.
Etc
Wait can you give me a exemple of try
try{
//Your code
}catch(err){
//Send back a message to them
}
@fair pasture

Alright thank yoU!


if it times out it could be that your process is crashing, did you check your logs?
@quartz kindle i want to write a discord lib but idk where to start
start with the gateway
it fixed probably
how to gateway
Start with thinking on how your lib will be productive and in what ways that would benefit others and features you will provide that other libs do not already @trim saddle
hmm.
the gateway is a literal pain
make a request to the discord api, discord sends you ws url, make a request to ws url with ws
once connected, send an identify packet, in json format, with your token and login options
listen to responses, once you receive a ready packet, you will start receiving a shit load of event packets
this is v6 flowchart, but not a lot of difference between v6 and v8, you can probably check that in the docs; https://s.gus.host/flowchart.svg

jesus that flowchart makes me wanna puke
its much easier to understand without looking at it
xD
no gateway no lib big boi @trim saddle
well

i have a small gateway code ready if you wanna look at
on my abandoned discord lib project
please
discord wants you to move away from the gateway and go all-REST
telegram uses webhooks
discord hits up your server with data you need
but it makes everything more expensive because you cant reuse the same connection
@trim saddle I took my time to serach this for you :)
https://www.youtube.com/watch?v=B9IRkwP5lcc&ab_channel=AnsontheDeveloper
Want to support me and the channel? Donations are not required but greatly appreciated!
Become a Patreon: https://patreon.com/stuyy
Buy me a Coffee: http://ko-fi.com/anson
Streamlabs: https://streamlabs.com/ansondevacademy/tip
Want to learn Programming?
Learn JavaScript - https://www.youtube.com/playlist?list=PL_cUvD4qzbkzrpH8det0pvoT_Oxu1JV3...
in the meantime im reverse engineering voice v5
to see how video works under the hood
Lmfao

Meanwhile I inspect discord and think of how facinating it is
It's a web app but an APP
there's new encryption in voice v5 that's completely undocumented
aead_aes256_gcm

it's electron
#1 reason why it eats so much memory lol
Electron elections my brain still crazy
it's not even funny anymore like over half of apps i use run on chromium and hog my memory
32gigs really is going to become a minimum
nvm about the code, its half broken and very confusing xD
@quartz kindle lol
i'll learn some how
@trim saddle I sent you a video
use at your own risk
ooo rar file
watching it
I think you should use Deno SInce the brainstormer who made Node.js Made Deno @trim saddle
He is a big brainer so Deno is stable
ok thank god ietf has an rfc for aead_aes256_gcm
this is going to be my life saviour
video streaming genuinely isn't that different from normal voice connections
there's a few extra payloads that need to be sent to webRTC
you're going to manually decrypt/encrypt video packets?
without a cryptography lib?
im going to try to
thank you im going to need it
if it doesnt work im falling back on this repo https://github.com/bawejakunal/AES-GCM-256
might need a bit more then luck
Why though ๐
Unless it's to learn ๐คทโโ๏ธ
you could also just use libsodium
Just seems like you're making more work for yourself, unless you're doing it purposefully to learn ๐คทโโ๏ธ
And/or have better control
unless you're doing it purposefully to learn
just this, taking a crack at it
i mean, exploring these things yourself can be really fun
I mean either way they still learn
Ah, gotcha. Carry on, then!
my main goal is to make an easy tool that you can chuck a user token in and provide experience similar to rabb.it
awesome
Unfortunately, I don't find fulfilment with learning the in's and out's of a particular service's API / methodology. More on that, if there's a library that handles encryption for me ... they'll 100% do it more sufficiently than I will ever need. More on that, I'll probably never ever use those tools I learned inside of a production sense.
But at the ending of the day, if you enjoy it ... you enjoy it!
so basically a full streaming platform backed by discord xD
โข๏ธ
Good luck, cry!
thank youu
Maybe more of a support question, but is top.gg affiliated with discordbotlist?
Perhaps the same company?
Gotcha. What's the purpose for keeping the dbl around?
no idea ๐คทโโ๏ธ
lazyness
Possibly still making income
this server was still named "Discord Bot List" for many months after the website was moved to top.gg
only recently it was changed to match the website
I just submitted my bot on there; however, the general tone is completely different. I came here to ask if their node.js dbl sdk/api thing actually worked for both websites.
Tim
what should I do to efficiently and easily not spam my db but still keep all changes
like if I were to cache and the vps crashes I would lose data
the original author of dblapi left the company, so the lib was moved to a different repo and re-launched on npm recently under top-gg/node-sdk
ye
yes
Is the old one technically deprecated?
its marked as deprecated yes, but the code is pretty much unchanged
Right
except that the new one was made into a ts lib
That is pretty nice
๐
i dont like ts
I enjoy TS - it matches my background of Java / C++ better ๐
so do you know how I should retain information without losing any data on crashes?
ah nice
depends on how you designed your storage code
What kind of data are you referring too?
if you want to cache data in memory to take load off your database in the safest way possible, the easiest way is probably redis
Or memcache
ok ill look into redis
Unless your Redis is hosted somewhere else ๐
mostly the bot crashing
ye lul
which is the issue
memory caching would be good for things that just need to be read but I would rather not cache writes in memory
Personally, I have a docker image that containerizes both my bot/redis. It works great
There's different types of caching strategies
my bots never crash, only if i restart them
Same
is there a way to 100% prevent crashes?
well I mean say there is an issue with discordjs and some obsure thing causes it to throw an error
You catch it
ok
You can catch an unhandlederror in your client.js
o
Caches are very good implementations
I use try catch blocks for when I read and write from the db but nothing else tbh
i dont have a cache for my db, but i have a cache for api responses
I'm using DynamoDB as my primary storage. It basically charges per mb returned .. unless I stay under a certain threshold.
Calling my db 8 times for every message 
So, I cache basically everything.
LOL
Woah - 8 times lmao
tbh im sure I had a time where I was doing more
The most I'll ever do is 2
i call my db only once, and only when the command needs it
Get inventory, add to inventory
at most two, if the user hasnt used a command for a long time
The project we(a team) are building is multi purpose
So its a must
8 times, though?
x doubt
8 different queries?







