#development
1 messages · Page 1831 of 1
the issue is not learning by doing, is learning by leeching
Well…I know a lot more now then I did before
and goddamn code leechers are fcking stupid
why my bottum no work
basically a person that comes here, refuses to elaborate and wants nasa-grade code for yesterday
^
if i paste code can you fix it and send it back?
yo Tim here's my 5000 line code with no description no comments no readme
It's not working
help me
https://github.com/moyshik7/dashboard-api
Well…nvm
goan fuk yourself :^)
People who DM BRs because their bot was declined for being a clone and get angry when they don't understand because "they followed the steps in the YouTube video"
xD
I had my bot get declined right before summer started a was was pissed bc they declined it bc I made user require manage_message if they wanted to use !embed and I just didn’t know what to do
They discord.js v13 guide is so ugly 😭
Umm how do I go to the v12 guide. I meant to press browse v12 but I hit the x
you have quite a fat thumb
Nah man I hit the x not realizing what I was doing lmao
I was looking at the page thinking about how ugly
Nvm
You may be interested in a site like https://exercism.io/ for learning.
exorcising the youtube from you
if (!message.member.permissions.has(command.UserPerms || [])) return message.channel.send(` You need ${command.UserPerms}`)
implanting the mentorships in one
module.exports = {
name: '8ball',
description: '8ball\'s your question',
usage: 'f!8ball <your question>',
UserPerms: ['ADMINISTRATOR'],
run: async (client, message, args) => {```
anyone can help me with this pls
figure out what command is and if it should have UserPerms
i did
the weird casing tells me it doesn't
i did not send full code
I meant the UserPerms
instead of userperms
it's sticking like a sore thumb there
bruh
don't forget js is case-sensitive
ah nvm, that's a thing you added yourself
if (!message.member.permissions.has(command.UserPerms || [])) is invalid
you're checking if UserPerms is inside permissions, which it'll never be
and ye, what is command?
let command = client.commands.get(cmd);
It would be an array of permissions, so it's correct.
why is your fetch named featch lmao
anyone know of a way to make statcord to work with djs-light
what is statcord
lol ,
i used to use it
till i moved to djs-light
they only support official libs
yes
o yea
i did that before
tahts what i used to do
but when i switched to djs-light
it just stopped working
show code
,,,
why is vscode telling me it cannot find a module which is 100% added
use git revert
my bots not on git
i uploaded it once to git and stopped using git
and tha twas after i stopped using statcord
because i wanted djs-light
Tf are you gonna do when you accidentally fuck the code ?
just rewrite it
lol
i barely update my bot anymore so i dont worry about it
i have like abit under 200 commands so i kinda just stopped adding things
@quartz kindle
const Statcord = require("statcord.js");
const config = require('../config.json');
const Discord = require('discord.js-light');
module.exports = async (client, message) => {
const statcord = new Statcord.Client({
client,
key: "Statcord.com-<statcordToken>",
postCpuStatistics: true,
postMemStatistics: true,
postNetworkStatistics: true,
});
//--------------------------------------------------------------------
if (message.author.bot) return;
if (message.content.indexOf(config.prefix) !== 0) return;
//--------------------------------------------------------------------
const args = message.content.slice(config.prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
//--------------------------------------------------------------------
const cmd = client.commands.get(command) || client.commands.find(a => a.aliases && a.aliases.includes(command));
statcord.postCommand(command, message.author.id);
if(cmd) cmd.execute(client, message, args, command, Discord);
statcord.post();
};
thats in my handler
since it tracks command usage aswell
well thast was in my handler
before i switched
i dont know what the statcord library is doing internally
thats why i suggested using the their api directly
just check the userid lol
so you have full control over what you send
js or?
send a command as example you want to use
and ill add it too the command so you have an idea
do you have a database?
or just use a array in config.json
if you have one
thats what i do
o
you wanna do that not manual
then store the user ids in the database
i thought you meant like an aray of ideas that you manually put
https://i.callumdev.xyz/w925a.png - vscode saying module not found when it is 100% installed.
then when a command is used, check if the author id is in the ban database
and if it is, dont run the command
??
try restarting vsc
tried that, multiple times, even file > close folder
"or its type declaration"
try installing @types/canvas-constructor
it straight up thinks the module is not there
try restarting ts server
thank you
done that, still nope
where is that from? from the feach?
yeap
yup"
I test it in my bot too , the same problem
web site dosn't working , and bot too
maybe try without content type?
since a delete request doesnt have content at all
there is also no json response, it should be an empty 204 response
how can I respond to an interaction with a file
you cant
attachments are not supported yet
you can upload the file somewhere and put the url in the reponse embed
I didn't understand you well
delete content-type: application/json
oh okay
Thank you ❤️
this is concerning golang, so i'm making a small bot however i see no way to create it without holding everything in a global state, would it still be ok to do this if every struct being used as a global variable used a mutex?
i want to try to not use global variables but it seems unavoidable in these kinds of scenarios especially when i need to create a local message cache
Hello I saw on the bot koya when you send twice in a row a command you have to wait 10 seconds nothing new it's a cooldown but when you send 5 or 4 times in a row the bot send you have to wait 10 seconds to two command but to the other three it didn't send you have to wait 10 seconds I don't know if I explained myself well and if you understood how I can do that?
errr...how can you send more than 2 times in a row if it enters cooldown after that?
maybe it's a logic fault instead of intended feature
No not the cooldown of discord but of the bot imagine that the Channel has no cooldown we can send messages every second I say in the bot koya if we send two command in a row the bot will say You must wait 10 seconds to use the command and I saw that if we send 5 command in a row the bot will answer just to two command but the other three it will not answer
yes
ah, the command doesn't execute also?
then it's just a simple if (cooldown.has(userId)) return;
or if you want to alert just once, use a map instead of an array
Yes, if you send more than 5 commands the bot doesn't answer the command and doesn't send a message saying that there is a cooldown
{"id": userId, "alerted": false}
then when it alerts once, just flip "alerted" to true
for further alerts, check if "alerted" is true, if it is just return without any alert
One message removed from a suspended account.
we code
@lyric mountain
One message removed from a suspended account.
...that's what I just said
One message removed from a suspended account.
excuse me, is "bot" a language?
As in the picture the bot tells a single command that it must wait 10 seconds to execute it and then the bot does not respond even if you send it again
yes, do as I said
One message removed from a suspended account.
^
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
yes
you say "do you know any other languages?"
"other" implies you mentioned one earlier
One message removed from a suspended account.
no
One message removed from a suspended account.
One message removed from a suspended account.
How 
that's the structure for the map, you need to create one to store the users in cooldown
that ain't python
One message removed from a suspended account.
Could you please send it to me because I don't really understand 
One message removed from a suspended account.
you never asked ¯_(ツ)_/¯
Hm no 
well, that's your starting point
make one first, then you make a one-time notification
One message removed from a suspended account.
Okey thank you
One message removed from a suspended account.
you can do that with a counter in your cooldown map
a boolean switch would be easier and faster
example ```js
if(!cooldowns[channelID])) { cooldowns[channelID] = 0; }
if(++cooldowns[channelID] === 3) { send warning }
if(cooldowns[channelID] >= 3) { return; }
++cooldowns[] wtf is that syntax
let cd = cooldowns[userId];
if (!cd?.alerted) {
//send alert message
} else {
cooldowns.put({userId: theID, alerted: cd == true});
}
incrementing an object property lol
Yeah got it lol
++1 == 2 is true
haha
**prop
people will confuse it with pointers
wait a minute
you can do prop **= prop tho
fuck pointers
no one likes them
but if it conforts you, you can code an entire application in js with 4 chars
jsfuck is 6?
ye
ah, it includes parentheses
I wonder, how compressed can a jsfuck code be?
since it only uses 6 heavily repeated chars
with gzip I mean
yeah but in so many random orders and combinations, good luck
well, true
@earnest phoenix up to you
just save the user id in a table or collection or whatever
up to you
it's you who defines what command it'll be
how can it be higher than 100% lul 
yes ig
console.log("lol") in jsfuck compressed with deflate:
eJztVFsOwCAIO4t/LB6JcP9rjExmsHPbx9Rlj5iYSEoL2EAsTIElskysl8T8CnrHUMby26cAHDDX6S0eTYyUkwUSkLR7EVWG3TL0WPYZ1BMuWtNxo917TECD0TfsksVRyXOtgb7zgFI6fHIJL0pxI2zTpdFCs85fg5queaLUeKDRx+4GsA1tP/eefQUMv7Heaayk164IXHozMCBoJA==
original jsfuck is 2.3k chars
show code
thats actually very interesting tbh
compressing "console.log("lol")" is still larger than the original one
it does make sense but its interesting
you dont need a database for short cooldowns
...how the heck do you "create a new line" on a db?
that's another dude
oh

its about banning users from the bot right?
show code
depends
which db are you using?
I have a slightly impression that you don't know how to deal with a db
I'm mistaken right?
ok so show db code
...RIGHT?
what the holy for the fuck?
what is this?
thats not code?
which database are you using
the actual database program/module/library
sql is a language
many databases use sql
that doesnt help

could be sqlite, better-sqlite3, quickdb, etc
all are sqlite 
thats not quickdb
quickdb doesnt save files as main_scheme_1.sql
and it doesnt let you chose the file name either
no idea what that is
how about you show your code?
your code
your actual code
js files
thats not code
thats data
ye
oh lord
do you have any command that uses the database?
how would i enter the image content from this message.attachment?
let imageUrl = ''
if(args[0] && args[0].toLowerCase() != '-ov'){
imageUrl = args[0]
}else if(message.attachments.first()){
imageUrl = message.attachments.first().url
}else{
message.channel.messages.fetch().then((messages) => {
const lastMessage = messages.sort((a, b) => b.createdTimestamp - a.createdTimestamp).filter((m) => m.attachments.size > 0).first();
imageUrl = lastMessage.attachments.first().url
console.log(imageUrl + " | f")
});
console.log(imageUrl + " | x")
if(!imageUrl) return message.channel.send("❎ | Please provide an (uncropped, original) picture, or an url!")
}
x is undefined and f is actual url i am not really sure how to fix this
because its inside a then
a .then() is like a callback
things inside it only exist inside it
oh so I gotta use await instead thanks
the peak of the javascript community
<MessageAttatchments>.map((attachment) => attatchment.url) i think image content is the image url?
also, its here btw https://discord.js.org/#/docs/main/stable/class/MessageAttachment
Hey Guys i need some help with my code
my code is
static void UpdatePresence()
{
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.state = "Watching the Server";
discordPresence.details = "Be careful";
discordPresence.startTimestamp = 1;
discordPresence.partySize = 1;
discordPresence.joinSecret = "= ";
Discord_UpdatePresence(&discordPresence);
}
but i get
File "main.py", line 22
UpdatePresence()
^
IndentationError: unexpected indent
Because that’s not python code
From what it looks like that’s c++
well how do i make it python code?
I’m not sure
of course it is lol
nope
you have to write actual python code if you want to run your bot with python
just get someone that knows c++ to write the same thing in python
He’s making an RPC I believe
whatever that code is doing you can also do with python or anything else
?
Rich Presence
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Actually I think RPC and rich presence are different things, my bad
er, quick question. im a bit confused
maybe im misunderstanding slash commands, im not sure. but i have this: https://pastebin.com/NcXaGAsZ
and where are the options supposed to be?
btw the test object is straight from the discord docs
Ok im dumb
I forgot the Dam Hosting code
I need someone with Replit To check my code bc its broken
no my Hosting code i made for other bots broken
options as in params?
/home/runner/DiscordBotHosting/index.js:2
import discord
^^^^^^
SyntaxError: Cannot use import statement outside a module
wym
wdym by "options"
You're using the raw api?
yes

what
const keepalive = require("./server")
import discord
from discord.ext import commands, tasks
import hostbot
from hostbot import keep_alive
bot = commands.Bot(command_prefix = "!")
@bot.event
async def on_ready():
change_status.start()
print("Your bot is ready.")
@tasks.loop(seconds=10)
async def change_status():
await bot.change_presence(activity=discord.Game(name="In" + str(len(bot.guilds))+ "servers | prefix ! "))
keep_alive()
bot.run
const keepAlive = require("./server");
keepAlive();
client.login(Taken out Token) 4oH_wlav7vo36N7Ywk.x-w_i1gdy7g_HTTza2MINgwsxoc);
whats wrong with it?
Are you...
goodness
idk my friend helped make the code
Just so you know
😂
Python and javascript don’t mix
er
Okay either use python or javascript
You can’t use two languages in one file

I NEED HELP
First learn the basics of a language
(There’s probably some black magic to use two languages in one file but still)
I CAN'T CODE
Then don't
i want to
Learn to code before making a discord bot
Then learn
learn

then learn it
ok see you in 5 hours then
It’ll take more than 5 hours
You won't learn something in 5 hours
poggy ur kinda takin the piss out of him, theres really no need
but ok
bye
How?
I am putting it as it is
I also recommend that you don’t do bulk learning sessions when attempting to code
ok
Just take it one step at a time
mm
btw waffle u kno whats goin on with my problem?
you can probably find those 2 hour tutorials
I'm creating an API for my bot and it has a command tab and I use a function to get the command names, but I'm only getting 1 command as it has 50 commands, how can I list these commands?
javascript
Not really, I’ve only used libraries to interact with the discord API
hm
show ur code
Try change the uppercase of the choices name to lowercase? Nothing in the official doc about it, but iirc all name must be lowercase
More of a challenge
its for my library
Ah
yeah. when i am making the actual request. i am addin a .toLowerCase()
as it has to be lowercase
so that cant be the problem. the command itself is registering, but the options are the issue
const router = require('express').Router()
const handler = require('../../../src/thebrozy-bot/commands/handler')
router.get('/commands', (req, res) => {
res.json(
{
"command": handler.commandOptions(),
}
)
})
module.exports = router
req not res
no rejection from discord api?
?
?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
wait nvm lol i was thinking of something else mb
ok...
thonk
also, log commandBase.commandsOptions()
just return me a command
show the code for your handler
I meant the name here. Though this should return you back error 400, bad request
i havent used slash commands yet, so idk

dpy v2 hasn't even come out
Am probably gonna switch to djs since I am learning js anyway
thank god, my internet came back
djs v13 doesnt come out either 
why? this is straight from the discord docs
eris all the way
Ya i know, but iirc I did a mistake on the name with uppercase one time and it got rejected
Other than that, I'm not sure the problem is
the name is lowercase
The option choices name
if im takin 4 years to reply, thats my internet jus randomly cuttin off i have no idea whats goin on
same thing, everything is lowercase
I will
CURSED
Finally! After you did it with a mix of C++, Java, Javascript and the un-holy language python
Be careful not calling JS unholy, too
assuming you're proficient at js what would you do if it completely disappeared overnight
my code crashed 😦
File "main.py", line 31
if "!help" in message.content:
^
IndentationError: unindent does not match any outer indentation level
python 🤢
Use ts

Hi I just want to ask that can I store giveaway data in quick.db in discord.js?
Yes
I never used quickdb (although I do know the war crimes it commit), so you'll need to figure out that yourself
But since it's a db, anything is storable
Oh lol
I did it right
Yes I guess
i watched a YT video to help me
if member vote to my bot i want bot thanks hem , command handler javascript
why... do you have a c file in your replit...
idk
it does nothing
Hi
Can someone help me setup autoroles?
I tried but cannot
You said you tried but couldn't
do i need to give dsl bot admin
No
Is it like this?
-wrongserver
@stark pendant
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(
0-0

::after and/or ::before with content property
But it renders as text and not as HTML Markup element
Can I put scripts in Long Description?
now that i think about it, why do you need to render an element with css?
No
JS
To add another owner
bruh
just add them as an actual owner in the bot page
Not possible.
f
@earnest phoenix any idea?
@lean lake you should see them in the team
like everyone in the team should be shows an owners
If you wanna use html I think you have to have all the tags
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>```
class Conf {
constructor(client, guildID) {
this.client = client;
this.guildID = guildID;
this.settings = (async () => await this.client.settings.guilds.get(this.guildID))();
}
}
``` Hey, I'm trying to resolve the promise of my `this.settings` value, but it returns `Promise<Object>` but I want to resolve the promise. I'm confused
You can't do that in the constructor method
any other way to do that in the class
beause I also tried methods it also returned Promise<Object>
Create another method that's async and do it in there and return back the instance/this
Like await new Class(opts).init()
I tried that too. but when I update anything in db, it doesn't get updated in my class it still uses the old reference
class Conf {
constructor(client, guildID) {
this.client = client;
this.guildID = guildID;
}
async settings() {
const settings = await this.client.settings.guilds.get(this.guildID);
return settings;
}
}
``` Do you think this will return my data with promise getting resolved?
FuelClient.settings
so true
you need to await the promise returnes by settings
no 😛
Glad to be of help
Why does my cooldown apply to all the same shards? Like when I send a message to a guild connected to Shard 0 and then send another command in another server with the same shard the cooldown applies.
You might be cooling down the user globally and not per-guild? Are you associating the guild id with the user id in the cooldown?
For my cooldown I just joined the user id and guild id together as a long string and checked for that in the cooldown. That way the cooldown is per-user per-guild and not global across guilds.
oh yeah correct ok thanks
nope I just tryed sharding
Hi
How can i use .toString() or .toDateString()
To local time zone which user area in (auto detect)?
Is that possible?
(Javascript)
You can't auto-detect timezone in a Discord bot if that's what you're trying to do? I assume it's for a bot.
If you have a website, I assume you can calculate the timezone from the IP and then convert the time from local timezone to user's timezone
like this
Nah in web dev it's easier to use getTimezoneOffset(). That gets the time from the browser not the IP.
You can use the time formats from discord, it changes it to the right timezones of the user if you need that
remote: hooks/pre-receive: 26: .: Can't open /data/gitrpcd/.app-config/.sh 🤔 it's not letting me push to github
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Giveaway bot, like this:
This is right to my timezone
How i can do that?
That's just a timestamp in the embed footer
Read the docs of the library you're using
Alright
Ah no wait. My bad. That's not an embed timestamp
Okay
In a Discord bot you can't auto-detect timezones
That bot probably asks for the user's timezone during setup
You have to rely on user input
Oh, but the bot doesn't ask me timezone during setup
you can set an educated default though. look at the region of the server, and set a rough default from that, then let the user pick a specific timezone per user
Yeah that's the only way. You can try and guess.
But if your user is in Europe and has their server region set to US East then there would be a big difference for example.
yeah
Alright. I will try!
Thanks.
another reason why thats ur timezone, could be because where that bot is being hosted is also in the same timezone lul
Nice bot bro!
thanks 🙂
How long you made them? 🤣
lol, really?
Woah 1999 🤣
Last modified 2006 😢
yeah its a dead project
hey guys
how would i remove all black color instances from an image using jimp?
I tried reading the docs but found nothing about color manipulation and deletion.
Nope
you would usually use some kind of build tool for this that includes the typescript compiler somewhere in the pipeline
maybe something like esbuild with a minify flag
ya that doesn't work with all options tho since it breaks the concept of modules
why do you need to minify
i tried doing the same
i installed a package i don't remember the name
i added to "scripts" in package.json
does anyone know how to remove all the black color in an image and make it transparent using jimp?
loop through all of the pixels in the bitmap and set the alpha based on if the color is black. You'd have to provide logic for fuzzy replace
Each Jimp instance should have a bitmap property iirc
If the original image is transparent then use the PNG mimetype
does anyone know why the options are not showing?
this is my code: https://pastebin.com/NcXaGAsZ
idk if im just misunderstanding slash commands or what. the test object is straight from the discord docs btw so thats why im even more confused
I am using the package replace-color to detect those pixels.
theoretically not necessary if you know that rgb values of black is 0,0,0
so, you could fuzzy replace anything within like 5 of each rgb
if (r <= 5 && g <= 5 && b <= 5)
btw any ideas on my issue?
You'd probably also have to write logic for anti-aliasing
can anyone provide discord.js code for this: "Edit Original Interaction Response"?
docs say PATCH /webhooks/{application.id}/{interaction.token}/messages/@original, but how to do that in discord.js
maybe discord.js has not yet implemented that. im not sure, but i think u can use the dev branch of discord.js which has prob has it
and what is the dev branch?
client.api.webhooks[application.id][interaction.token].messages["@original"].patch({ data: {} })
nevermind 🤷
and why are many things I log a buffer or a [Function: noop]. That makes it very hard to understand these stuff
owhyeah i got it working
thanks!
btw flazepe any ideas on my issue btw?
Haven't worked on slash commands, nope
however, how would i remove that filthy transparent grey look? I have an image composited under the original image. Why is that not showing in full contrast?:
let chosenFile = files[Math.floor(Math.random() * files.length)]
const baitimage = await Jimp.read(`./baitimages/${chosenFile}`);
console.log(baitimage)
const finallink = baitimage.resize(420, 420).opacity(1)
const image3 = await Jimp.read('./pictures/output2.png');
const finaloutput = finallink.composite(image3, 0 , 0).opacity(1).write('./pictures/sender.png');```
alr
I've not yet worked with options and stuff (only started with my ping command), but maybe this website helps you
https://autocode.com/tools/discord/command-builder/
er, na
Going ask on the developer server itself might be better for you
since I saw the structure you sent earlier is all good, so it should pass through
I'm using 3rd party library, so I'm not sure what is really wrong
instead of this grey car look, how would i merge that other baitimage under the original image?
i mean it's already there, but how would i make it stand out more
https://sourceb.in/dld2YjA2vV
it only iterates the first item(discord.gg) and doesn't continue to the next one
u sure? at the start of the loop, console.log link
yep im sure
what does it log?
it logs the code
discord.gg/[code]
trying to do with
discord.com/invite/[code] but doesn't work
it logs the invite code?
yep
idk why js is ignoring the second item in the array
for (const link of inviteLinks) {
console.log(link)
``` logs the code ?
you're still going on about that? lmao
did you find a command that uses the database?
then we cant help
we have no idea how your bot is built
Hi Tim
Hi Tim
so anything we tell you to do will likely not work
because it wont fit with your bot's current code

how many js files do you have?
Like initializing it?
for (const link of inviteLinks) {
console.log(link)
if (!msg.content.toLowerCase().includes(link)) return
const code = msg.content.split(link)[1].split(/ +/)[0]
console.log(code)
const guildInvite = msg.guild.invites.cache.has(code)
if (!guildInvite) {
try {
const vanity = await msg.guild.fetchVanityData()
if (code!==vanity?.code) {
msg.delete()
msg.channel.send(`<@${msg.author.id}>, Please do not try to advertise here!`).then(m=>{
setTimeout(()=>{
m.delete()
},1000*5)
})
}
} catch(e) {
msg.delete()
msg.channel.send(`<@${msg.author.id}>, Please do not try to advertise here!`).then(m=>{
setTimeout(()=>{
m.delete()
},1000*5)
})
}
}
}
Ignore the first log

and you have no idea which of those files have commands that use the database?
???
The fuck
show them
help?
no
what is the problem?
thats all?
i see
so you dont have any actual code anywhere
your entire bot is made with dbd
i mean dbd.js
problem starts from here #development message
and if you use dbd, you cant really use anything else, you have to do it the dbd way
what is dbd
you have to ask in the dbd server
im guessing dbd is a db 
what's dbd
dbd.js
discord bot designer?
that wasnt the server 
???
be patient
if (!msg.content.toLowerCase().includes(link)) return
return exits the entire function
why
if you want to exit the current loop only use continue
if () continue
?
yes
ugly
is your name tim
it is now
kinda
TIM HOW COULD YOU
its a short
😭
lmao
xD
lol
and now we no longer are
yo it works thx!
just learn a language or somth
Hello there i'm looking for signup bot for events
idk what im talking about 
No wonder they dont talk
Well the npm page says its deprecated
discord.js is up to date (with master atleast)
and suggests to use aoi.js
whats that
Same thing as dbdjs ig
just save a backup?
save a backup to reference to for transferring with djs
well ig you will have to wait until someone who knows how to use dbd.js comes along
and for chat about development
they use discord.js anyway lol
They use d.js for dbdjs?
yes
and for aoi.js
aoi.js looks like its the exact same thing as dbd.js
just dbd wasnt updated in 2 years
aoi.js is the exact same
oh god
even the website is pretty much the same
at least aoi is more recent
lmfao
it uses discord.js v12
technically it doesn't exist yet 
had you just use discord.js
good idea
Wdym it does
first step, stop using dbd/aoi
I'd say its pretty much out of development by now tbh
There isn't much more they can really do
They've already fucked it
there is
context menus?
True
They already have menus
tere are still many pending PRs
that introduce useless shit
context
im pretty sure some of those will be merged before its released
not select
whichever you want
but like, before chosing a database, chose a discord library
lol
wonder how context menus works
i use better-sqlite3
no u bad
postgre is bloat :^)
mongo is uber bloat :^)
Postgres works
You just gotta not be a dummy
and typically people who use mongodb
a
are hella new
atleast we have a db 
postgres is good, its just way overkill for a discord bot
Depends
unless your bot is so big you need multiple machines
How big is your bot
whats postgres anyways
yes ik that but makes it "fresh"
Omega scalable
what makes it "fresh"*
hence it being widely common on bigger projects
no point using a server-based database system for only one app. either use it for multiple apps, or for one giant app
lel
i prefer sqlite, smaller, simpler, faster
I'd use sqlite if I didn't have to make my own array system
i use mongo cuz ik how to use it
or store things as json
sqlite can't support array types
and I use array types a lot
so its easier to just use postgres
what about a cv database

just use objects isnt array just objects
{
0: "lel"
}[0]

i was joking lel
bad joke
no u bad
dbd.js -> old version
aio.js -> commuinty version with contributors
dbd.ts -> stable version made with ts using v13
It is a copy of bdfd app just for js

whats dbd stands for?
dead by daylight
Im sticking with just using discord.js
discord bot designer
yep
lel
is it good interacting with the api with urself or use a lib 
i have a lib that stores data in a delimited string
but its only in memory, not for storage
you could just import directly
could easily read/write from a file tho
using COPY command
When writing to a csv database you have to copy everything else in it no?
Ah right
append
But truthfully it was easier just converting to sqlite
then using sequelize
maybe a weird question, but imagine I have this:
// foo is an object
foo.function = Function1;
foo.function(input);
function Function1(data) {
// is there a way to access "foo" in this function?
}```
See the question inside the function
yes
Normal Users would use d.js since they don't have to maintain the lib for bugs and new feature,but custom solution is needed for big bots to save resources
pass foo as a param
you can access this
oh I forgot to tell you. Apart from that, is there a good way to do that?
or if foo is a property of the same class, you can access foo with this.foo
when I logged this, it didn't show me foo tho
declare foo as this.foo = something
I don't really understand it (or it doesn't work for me)
Idk how people type so fast on mobile
are you using arrow functions?
this.foo = new Foo()
or whatever
not in this context
then it should work
unless youre doing something weird
in which case, you can always explicitly bind the function to the object
okay I will post the real piece of code, maybe I will understand better then
obj.fn = fn.bind(obj)
btw, where did I have to place that?
where you first declared foo
thats for classes, are you working with classes?
oh no I'm not using that
ye, has to be classes for that
do you think it's useful for me to learn classes?
interaction.editFirstResponse = editFirstResponse();
function editFirstResponse(data) {
console.log(this.interaction)
client.api.webhooks[interaction.application_id][interaction.token].messages["@original"].patch({ data: {
data
}});
}```
stuff like this is what I wanted to do btw
useful yes, for your specific issue i dont know
classes are good to know
you're calling the function, not assigning it
oh that was just to try
function a() {
console.log(this.token);
}
interaction.edit = a;
interaction.token = "f";
interaction.edit(); // f
or just ```js
interaction.edit = function() { console.log(this.token) }
you dont need to declare the function separately
oh awesome it works! Thank you guys/girls
oh that's a smart one, think I only need it once to attach to received interactions
did you already convert your bot to slash commands?
no
i cant do it yet, i need attachments
slash commands dont support attachments yet
hopefully
yeah I hope for you too
oh yes that's for sure
if it not ephemeral, it can support attachment
attachment with files, not url
for anyone wondering, there was another little error in my code. It was inside the .patch() This is working:
interaction.editFirstResponse = function(data) {
client.api.webhooks[this.application_id][this.token].messages["@original"].patch({ data });
}
interaction.editFirstResponse('Edited');```
thanks to the devs here tho, without their help I failed making this function ^
For anyone using djs rather than dpy mind explaining why, like if there is a particular reason and if you've tried both.
Other than djs covering more of the API
I used it because I wanted to get a taste of Python.
There was no particular reason in features. Though, it's built-in command handler is nice as opposed to building your own or seeking out another library
js libraries do have built in command handlers too, just not discordjs














