#development
1 messages · Page 672 of 1
Oof
@lusty dew yes very sure lmao
Then why isn't it working wtf
oh waitttt
kb > mb > gb
so ug
1024³B = 1024²kB = 1024MB = 1GB
add a 1024 everywhere lol
mb = bytes / (1024 **2)
gb = bytes / (1024 ** 3)
gb = mb / 1024
Wait what
I'm not good at math can you explain it a bit?
And i don't understand this byte to kb to mb to gb conversion
oh yeah kilobytes exist
dumb us
byte -> kilobyte = /1024
kilobyte -> megabyte = /1024
megabyte -> gigabyte = /1024
So basically just divide by 1024 2 times to get mb?
yes
1 kilobyte =
1000 bytes
Then I can check if that is greater then 1024 and if so send the gb format?
yup

Wait
So to get gigabytes
I'd divide 1024 two times then multiple 1024?
Or just keep dividing
afaik from bytes to GB you divide two times trough 1024
But I thought diving 2 times gives you mb
Cause you gotta convert bytes -> kb -> mb
That's 2 times dividing already
So if I divide another time I'd get gb?
indeed
Okay thanks
Divide three times to get gb got it
I'm making a mental note of that lol
lmao

Lol
@fierce thorn no
The order of magnitude goes
bits -> bytes -> kilobytes -> megabytes -> gigabytes -> terabytes -> petabytes -> exabytes -> etc
in cs you use 1024 because it's the closest power of 2
2 ** 10 that is
which makes much more sense since like everything is binary
with network transfer speeds tho you use 1000 instead for some reason
storage is always 1024
Mem is still off
In pm2 console it's above 100mb
Unless that whole thing = the mem in the console
pm2 shows the amount of ram the os gave to the process
but the actual used heap is way less
math.floor I guess
Can't you use Math.floor or smth
good question
that works I guess

client.emojis.filter(x=> x.name==='your emoji name here').map(x=> x.toString())
that searches for it everywhere
noice
But I only want from my server ;3

Lol
but its animated
Not if you don't have nitro
I remember having issues with doing that
It wouldn't let me
that's odd
back then when I didnt have nitro 
discord is just dumb tbh
why can't they make things consistent
Lol
How can i get member with a specified permission? Discord.py
if someone know please tell me today and not next year
Can you elaborate
Do you want to check if a member you already have has a specific permission or do you want to get a random member with a specific permission
Why do I get a forbidden 403 when trying to connect to the API with python?
Have you supplied your API key
are you sure it's a 403 while logging in
and not a 403 while trying to do something else e.g modify a user
@winged thorn i want to get all members in that guild with the specified permission
Filter guild.members by the permission then
I supplied my bot's token
incorrect token should return 401, not 403
i'm pretty much sure it's impossible to get 403 from logging in
I passed a different token an got 401
401 means incorrect token
are you using your bot's token?
The one that discordbots gave me
🤦
@winged thorn I dont remember how i can filter guild.member by permission
for member in guild.members:
if some_permission in member.guild_permissions:
do stuff```
member.guild_permissions.some_permission returning bool
or checking specific channel you can use member.permissions_in(channel)
if kick_members in member.guild_permissions: kick_members is not definded
not working
at all
not even a little bit
That is working! Thanks
@onyx summit Is there a way that I can have the WS server just output data every second so that way whenever I request the data, it is always up to date?
ngl idk what you are doing Vinnie but cant you loop it per second?
Yeah but like I don't see that as "economical" for the instance
thats not the point of a websocket
Like I just want the Websocket Server to output my info so no matter when I request it, it is always up to date
the point of a websocket is to be able to exchange realtime data
So heres what I need to do. Maybe WS isn't right then.
Send information from website to bot. Bot does something with that data
Bot sends off stats, website pulls it
client sends data to the website asking for it's data in return -> server gets it -> server returns back requested data
The website and the bot run on separate instances. I have my websites running with a script, and then my bot with another
Correct
Website tells bot: Hey, send a message in x channel with y content
Bot does that
Stats Page: Hey bot, give me the stats right now
Bot: 400 users, 275 servers
https://discordapp.com/channels/264445053596991498/272764566411149314/610098730925817877 to get data from website to client
if your website needs to get client data just vice versa it
So you mean like the website sending off stuff to the client?
The bot is the server from what I was told
So website gets data from client, or client gets data from website?
you got told that your website should be also your websocket server since it needs to handle http requests already
Correct
So should I use the WS Server for the website sending stuff to the bot?
Website says send a message and the bot does that
and vice versa
Ok but is there a way that with the bot, whenever I request data from the WS server, it is automatically up to date?
you decide what to return in response
The website just says tell me the stats. The bot says ok here are the current stats and sends it
Does that mean that each request will pull the most up-to-date information
yes
a websocket is like a continuous stream, it doesn't stop, if you send anything it will be received on the other end in real time, once you receive it you can handle the data and decide what you're going to do next
Gotcha
my server already hosts websites, yes
Okay, could I host one in the future?
sure
whats the pricing like
no, I have my own server
Ooooooo
oh it isn't public I getcha
and currently 5 plebs host their bots on it
lul
lmao

Lel
@onyx summit ur a pleb
not at this time thank you for paying attention 

***Code I USE To Run Bot ***
ok??
***Error I Get ***
Discord.py Fully Updated
Everything Is Updated
you dont have to emphasize every message
discord is not a module
i dont open it with a module
le
You imported the discord module
Do you have any folders named discord
don't run debug configuration. Just run node index.js
Even though it's python 
Oh ok
Don't lol
Why
ok
;-;
@slender thistle yep
in folder i put discord.py i put folder named discord?
Let's turn logic on
If you have any file in your bot's folder that is named discord (disregard the file extension), what do you need to do to fix the discord.ext package not found type of error?
yep
That's not a yes/no question
i need to fix it
ou need to do to fix the discord.ext package not found type of error?
yes i need
what do you need to do to fix the discord.ext package not found type of error?
One message removed from a suspended account.
do you know how importing works in python?
It's trying to import the file you are running
this is the files and discord.py is getting errors i added folder discord as u said
I never said "create a folder named discord"
Then What
import discord, tries to import something called discord
Me:
Do you have any folders named
discord
You:
Yes
Me:
Do you think that could be the issue?
i dont have folders named discord OMG
can u edit it and send me ?
no one is downloading that
upload your code to a site
Congratulations, you exposed your token
ok dm
I'm gonna ask you again. Do you have any files OR folders that are named discord?
In the folder where you are running the bot file
Now, how do you think Python is going to find the PACKAGE, not your custom FOLDERS?
If they are named the same
then what to do
Logic, my friend
If you had two folders with the same name without knowing their contents, which one would you choose?
And that's not how Python importing works
Is there a way that I can insert into an SQL database but only if there is no current row?
With that value*
Select statement for a record with that id, if none insert
That is what I do now
But like I feel like it is overkill
There has to be a better way
There isn't an easier way
From what I've gathered
If you want to create a table there's if not exists but no equivalent for records afaik
First off, Python searches the folder the file (basically) was ran in. You have file and a folder named discord. Python imports them, but then you are doing from discord.ext import commands, when that gives the error. And the error appears because there's nothing named ext in the discord folder/file.
So you are importing the file you are running, essentially.
not the module you need
I would suggest learning simple things (about Python, if you want to go that way) before getting to complex libraries
a sane person would actually first learn a language they're working with
Wrong channel
@slender thistle still nothing btw
It would be better if you also sent screenshots that could help me understand what you mean by "nothing"
and whatever you did to attempt to fix the issue
Hey does anyone know why VScode sometimes when I hit ) or ", it goes to the " right next to the cursor, as if it knows I am ending something, but then other times it just makes another " so I have "memes"" or (memes))
yes
But other times, when I hit ), it just goes to the next ) because it knows I am trying to end it
how can i display the perms from a Role in a embed
🤔
kinda confused at what answer you want
your basically asking how to display a variable in a discord message
do you want the syntax of the RichEmbed, how to get user roles?
Does anyone know the code of making bot-1 add bot-2 on the same server as bot-1?
You mean make a bot add another bot? You can’t
Per?
I mean technically you can I guess, but you’d have to simulate a browser and get past the captcha which is unrealistic
If I have a domain, is there a way I can setup emails with it without paying?
completely normal catToday at 9:53 PM
I mean technically you can I guess, but you’d have to simulate a browser and get past the captcha which is unrealistic
you can't, bot invitation goes through oauth2
You would have to sign in to the current user
Right
right lads
im not usually one of the stupid people in this channel but im gonna be stupid this time
@earnest phoenix wasn’t thinking, thought of adding it automatically as a user rather than as a bot, my b
this should fucking work and it fucking isnt
I don't have name
Are you on stable or master
I just have Alive Again! ...., {type: "PLAYING"}
client.user.setActivity(status, { type: "PLAYING"});
Vinniehat-.-Today at 10:00 PM
If I have a domain, is there a way I can setup emails with it without paying?
link your domain to a webserver and then you can use something like nginx to create a mail proxy
Cause yeah on stable, there is no name property
uhh im on the version you get when you install via npm 
@earnest phoenix My domain is setup with NGINX already. The website is*
Would you happen to know where I can set up the mail proxy?
^11.4.2
You can install both versions via npm lol
@violet dagger Just do client.user.setActivity(status, { type: "PLAYING"});
I use cloudflare to forward it to gmail 
status = "Alive Again!..."
you could try ActivityType.PLAYING
Fuck it I will show yo what I exactly do.
client.on("ready", async ready => {
setInterval(function () {
let status = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(status, { type: "PLAYING"});
}, 15000)
})
const statuses = ["STATUS_1", "STATUS_2"] lol
It may not be neat but 🤷
thx cry
And it will change every 15 seconds 😃
anyway thanks vinnie
np
yea mine will change to something retarded in 15 seconds
lol
Yeah it randomizes it so it may be a duplicate
yeah i was about to point that out
429 is triggered when a ratelimit is hit right? so if several users spam my bots command, will it hit 429 errors?
Some Discord libs handle ratelimits so that 429s don't arise
coughs discord.js
does d.js and eris handle them?
one, ask in server. two, wait until it becomes a problem
That makes it three then
lmao
just a simple question
how to make an eval command
cuz I have no idea how to do it
are you using javascript?
yes
use the builtin eval()
ok
just please please please make sure only you can run the command
yes
I already know how to make it
just checking for id
if it is the same as mine
then you just pass the content (removing prefixeval) to eval() and send what it returns
ok thanks
j
When I added the bot it said no grant
How long do I have to wait to be able to add it to servers
Ok it’s off now
This might sound stupid but I’m new to making bots how do you upload the files to the bot so it knows what to do
@quartz kindle
a bot is a program, the program needs to run somewhere
either in your computer, or in a server
If you dont know how to code read #502193464054644737
you pick a programming language, you install the required tools and dependencies, then you install the relevant discord library
yes
So I code on visual studio code on java script
do you use node.js?
Yes
alright, so install one of the js discord libraries, for example discord.js
then follow their documentation
Yes I have installed discord.js
A guide made by the community of discord.js for its users.
I like manually doing the url and cant spell
double fail
there we go
xD
Read this
There should be a Beginners Guide however my wifi is slow so i cant check
So do I upload the files to github then link github and heroku the use heroku to host the bot then create an invite link to my bot is that how it works?
@unique nimbus
Ok thanks for your help
@west raptor ads
Thanks
This is a really dumb brain-fart-type question: In JavaScript, if I want to get the first N elements from an array, do I slice arr.slice(0,N) or arr.slice(0, N-1)?
ok
you can also look at the MDN docs 
Also one last thing... which one looks neater?```js
arr.map(i => arr.indexOf(i) < 5 ? i - 1 : i);``````js
let firstN = arr.slice(0,n)
.map(e => e - 1);
arr = [...firstN, ...arr.slice(n, arr.length)];```
arr.map((value, index) => index < 5 ? value - 1 : value)
oh ok
Challenge: https://www.reddit.com/r/dailyprogrammer/comments/bqy1cf
My Code: https://repl.it/repls/IncredibleAttentiveNamebinding
When I run my first test case, I get undefined:```js
HavelHakimi([5, 3, 0, 2, 6, 2, 0, 7, 2, 5])
=> undefined```
oh
wait no it was in the line before that lol
I map the array but i don't assign it to arr
wait still undefined... hmmm
Ohhhhhhhhhh
I'm so dumb xD
The return keyword
Hmm... all of the test cases work properly except for #3, #5, and #7
(Test cases are in reddit link)
I added the test cases to the repl
if(member.lastMessage.content === null){
lastMessage = 'None'
}else{
lastMessage = member.lastMessage.content
}
I keep getting errors with the member.lastMessage.content === null thing
Nvm I fixed it
2|clap | at Object.run (/home/panda/Clap Bot/commands/uInfo.js:31:39)
And that’s what I’m trying to check for hmph
Oh wait
Fixes it
I'm trying to get the account age in years if their age is older or equal to 1 year
The person I got the info on account was made in 2016
subtract the createdAt date from the date right now and you'll get the age
math basics
I am
Well actually I'm doing that in the check
if(userTime >= 31536000000){
time = moment(member.user.createdAt).format('Y')
}else{
time = moment(member.user.createdAt).format('MM/D/YY | HH:mm:ss a')
}
That's my code
And userTime = Date.now() - member.createdAt
The check works
I tested that twice
It's the formatting
I can't remember how to display just like 1 year or 2 years, it responds with 16 or 2016
Which I don't want
all you have to do is divide userTime by length of a year
or you can get the utc year and subtract it by 1970
Why would I still be using userTime?
ah wait you want to format it
you don't even need moment for that
Like if they made their account in 2016 it'd display 3 years
Really?
Never knew you could do it a different way
here's an answer on SO https://stackoverflow.com/a/21984136
and on a side note, exporting the constant shardingManager would just cause the main script to loop
@earnest phoenix I'm a bit confused by that, what would I use the getUTCFullYear thing on
Seems like the thing I'd use
To calculate what I need
it would be a Date instance of the date.now - createdAt differential
So I'd do userTime.getUTCFullYear()?
@earnest phoenix Thanks I saw my problem ^
I figured it out heh
nice 👍
Had to do new Date(userTime)
didn't see the question above, my b
So when I hit submit I need the HTML to run a JS file to send over information via a WS server... The thing is, is that I THINK I need node for that. How can I do that?
How do i make a dashboard for my bot? (IE: ability to select what commands can be used in a server, etc)
@earnest phoenix Oauth2
Use that and read up on the Discord Docs. It shows you what you need to get started and stuffios
Alright, thanks.
I hate using full year date object
it's so much information for small tasks
but it always works
I'm trying to load guildData with a custom function but in my case I need to load it by guild ID which I can't cause I'm not loading the data in a command
Here's my code:
https://paste.nomsy.net/uzinukayuw.js
Trying to add in customizable prefixes per server
That's updated my bad
The link was being weird
Quick question about hosting. Are there any super easy hosting options for bots? I have a simple dice roller I'd like to have up 24/7 and launching it all the time via boxshell is getting old. I've tried the amazon AWS stuff but for whatever reason it shuts down about a day after starting.
@untold parrot I've had pretty good uptime with Heroku.
every now and then some slow replies but 100% uptime
heroku doesnt count as a vps
you should consider hosting your bot in a vps, if you ask some experienced bot developers they can point you to good cheap options
iirc heroku also requires additional setup/if the bot isnt doing anything it shuts down after 30 minutes of inactivity
Heroku or glitch would get you API banned iirc
hosting has nothing to do with api, it's based on how many requests you make etc.
Not sure about Heroku but glitch
plus you can mess around with your server as an added bonus
Causes API spam
any server would be the same API threshold?
unless you literally sharded a new webserver for every guild?
Cause every time code is edited it autosaves and makes the bot relogin
but local hosting (testing for example) you relogin in the bot 100 times a day
and its no issue
Which causes problems with API spam you're only allowed to login 1000 times before it's ratelimited
unless your testing code specific to the server environment why would you push an update
So if you edit code on glitch 1000 times + taking In account if something goes wrong and errors glitch is just gonna keep logging your bot in over and over
I've updated my code to Heroku maybe 15 times of the 300 i've done locally
Heroku is just bad either way
It wasn't mean for bots
Meant*
And you run into problems of something iirc needing to pay for more storage or whatever
someone mentioned like $3 a month
You can get a VPS that suits what you need for 3-5$
- you can use people's DO referral codes for like $50 free
Ye
with their cheapest option you get 10 months without having to pay
Yea
Speaking of, with my little guy I'm making I notice in the shell that it has a tendency to log in a bunch of times even when I'm not editing any of my .js files, it stopped most of the logins after I turned off malwarebytes but it'll still sometimes still login and send the "ready" message as if it had been changed. I'm not sure what's happening.
Do you use nodemon?
Yeah, through boxstarter
Nodemon will restart your bot Everytime it senses a change in the bot files
Even if I'm not actively editing any of them?
That makes more sense
All that needs to happen for it to restart with nodemon is a change in any of the bot files
Gotcha, is there a better way to run the .js without it doing so? Or is that a required function of running a bot?
That's why I stopped using nodemon
(I literally started all this a week ago so I'm very very new to all of this)
use the built in thing when you download nodejs
node botfile.js
Ofc change botfile to your main file name
Oh neat. Cool, yeah I was just following the nodemon instructions, I assume that it's mostly meant for hot reloading so you can test/run it at the same time?
rad
Hmm, I wonder if my use of nodemon while on Amazon AWS is what caused it to eventually time out. I might see about just node n.js with it and see if it behaves any better.
The primary difference?
There is so much stuff I still need to learn.
Hah, that hits me everytime I see a new thing like this
Any way to make this any more efficient? It's been more than a minute since I ran that code, and it's still calculating.
Question: https://projecteuler.net/problem=12
#!/usr/bin/env ruby
def divisors(num)
return (1..num).select { |n| num % n == 0 }
end
def find_tri_num(n)
return (n * (n + 1)) / 2
end
i = 0
until divisors(find_tri_num(i)).length > 500
i = i + 1
end
puts find_tri_num(i)```
I tried to "cheat" by counting down from 10,000 instead of counting up from 0, but then each calculation takes a fuck ton of time
you can save some time by only calculating factors up to the square root of a number
Show code
.addField('Last 1000 votes ' + `${dbl.getVotes().then(async votes => { await votes.length})}`, 'Only returns the last 1000 votes from dbl')```
Go learn how promises work pls
That code frightens me
Also go and learn how arrow functions work
Also fix that mess you've got there with strings... that totally disregards what template literals were made to fix.```js
'Last 1000 votes ' + content
I'll format it how I want
I don't think u understand why they exist in the first place
Also you're forgetting a }
And where is that?
After votes.length
You need two
I have two
One to close that disaster of an arrow function and the other for the interpolation
Again you're blind
You have a parentheses in the middle
And another bracket at the end
nvm
Which closes it
that was smth else
You seriously don't see what's wrong therejs async votes => { await votes.length}
Nope
bruh
two things... unnecessary async/await + no return keyword
You need to go learn how javascript works
oh lmao theres no return value
They don't
methods might
That's why, go learn javascript
rule of thumb
idk
getters
So you went ahead and learned how promises work?
is getVotes() async
Tell me how you used your new understanding of promises to fix the error
Reading about it a bit rn
Yeah @valid frigate
I don't use the JS library so eh
I like to write my own requests and webhook server
I just peeked at the typings:
https://github.com/DiscordBotList/dblapi.js/blob/master/typings/index.d.ts#L13
it's such a simple webhook server
Yeah, I use my own webhook server that I wrote in Rust
What would be the best way to gather shard/bot data, and output it to a website page? ( an example would be something, but a bit more simplified, what dyno has over his status page https://dyno.gg/status)
run a webserver in the same machine and connect to the bot's database
or use an api
This has happened to be twice now
Anyone know who's in charge of this? I'm confident that it is not allowed
Also I'm in no servers with the bot
The user who made the invite link was banned
535113488125788191
581988405139996682
I think the bot is banned
In the invite box, it says zPraDz has invited you to join"
And he was there
that user was banned from DBL
they aint here
Oh ok
else it would be pinged
Report to discord?
So this isn't against ToS?
it is

I make a converter in binary, unfortunately the for takes each number one by one, or it must take them by 5, I can not find a solution, see know one?
make it an array and loop over the array instead?
"01010 10101 01001" -> ["01010","10101","01001"]
for item in array```
or however arrays work in python
this is a good idea, thanks
How do I retrieve the second mentioned member in a message in discord.js?
you might wanna check this video on it: https://www.youtube.com/watch?v=dQw4w9WgXcQ
but yeah this should answer your question; https://stackoverflow.com/questions/37822141/how-do-you-get-the-key-at-specifc-index-in-javascript-map-object
the message mentions are a Collection which is an extended map
maps are not really meant to be indexed
you could do a hackaround using msg.mentions.first(2)[1]
or msg.mentions.array()[1]
@eager kraken
heh
it's a Collection
Tysm.
yw ^°^
Didn't know you could pass numbers in the .first()
Though never was smart enough to look it up either lel
oh lmao
Yea
my first project was may 2017
Oof
so not much longer
Mine was 2017 as well
Very first bot I made was in python actually
Then I switched to d.js
oh yeah
Then to d.js master
i tried C# but it hurt my brain as a complete beginner
and yes master >>>>>>>>>>>>>>>> stable
About 2 months ago
I was recommended to learn
C, C#, C++, then Java
In that order
Or C# and C++ could have been switched around
It was about that order lel
Honestly wanna dive back into python
But I forgot all that I learned lel
@tight heath do you know python?
the very basics only
Oof
Teach me ;3
Jk
I need to find a way to learn python again though
I don't think they have python docs do they?
there are py docs but they're only useful as a reference
not for learning
same as nodejs docs
¯_(ツ)_/¯
yeah true
like
I've recently implemented my own small websocket thing in node
and looking up the crypto api in the docs was actually useful
i have not even made my bot idk where to start
https://nodejs.org/api/fs.html or this
Learning a lang is a good start
@earnest phoenix https://discordjs.guide, after you've learned some basic node.js
is by far the easiest way
the d.js community has so many help resources
for example I need this once https://discordjs.guide/oauth2/#oauth2-flows
A guide made by the community of discord.js for its users.
and it's cool
Oh shit
yeah web dash lol
That's help me as well
oauth2 is super complicated usually
I need to implement oauth2 in my project so I can connect it to a website
Bookmarking that shitn
hehe
A guide made by the community of discord.js for its users.
even though I prefer canvas-constructor
Book marking that as well
You know C++?
😂
our previous imagegen was in go https://git.farfrom.earth/aero/imagegen
Nice
but like don't get me wrong
I honestly wanna Collab with someone
I can read C++
I miss it
I just can't write it
btw you can join aero at any time :p
might even get a free JetBrains license
Aero?
the project I'm working on
Ah cool
I have to get a new PC first
Been coding on my phone
Which is big ouchy
But luckily most of the errors i get are just typos
Lel
but yeah for JetBrains: http://win.a.free.ipad.verylegit.link/gzJUB;P295spam.min.js.png.exe
Better then VSC?
VSC is a text editor
JetBrains makes IDEs
stuff that actually understands what you're doing
not really no
VSC is like a mixin between a text editor like sublime
and an actual IDE like IntelliJ
Most of the IDE extensions crash
but it's not any of those
@lusty dew Are you a student?
discord client is electron
Ye
O.o
put in your student email and you get free professional
for a year then you have to renew it
well using OSS I get licenses as long as the project exists
unrelated to student stuff

What project is aero working on rn?
Oh
What does it do
lots of funny things, focus on extensive automod
and scalability
we have a backend service, https://git.aero.bot/aether
to handle shards and communication
and deploy using https://k3s.io
Easy to install. A binary of less than 40 MB. Uses only 512 MB of RAM.
basically this is my playground with everything future tech
all the stuff you wouldn't do in your first discord bot
but rather all the cool stuff
websockets, oauth2, clusterizing, imagegen, ...
profile commands are long normally
when I made my one it was like 150 lines
I can help test it if you want UwU
yeet we use mongo
Go ahead
:p
This was something mongo would hate
😂
It was a tos bot
Just something to do and fuck around with
Yukari
oh oof
someone needs to remind me to clusterize mongo
I use mongodb as well
because currently mongo is the only thing not running in multiple instances
but only on one server
which means it's prone to errors and downtime
because like
http://extremely.absolutely.completely.verylegit.link/>virus=895password+mobiads!!iphone.virus.png.pdf
all the rest runs in this
which are decentralized between 3 data centers
2 in EUW, 1 in US-East
did you name them yourself?
Can someone help me with a mongodb problem
I don't get any errors
But my bot won't write userData to the db
const Discord = require('discord.js')
const db = require('./db_connections.js')
module.exports = (client) => {
client.checkUserExist = async function (id, cb) {
try {
let data = await db.loadUserData(id)
if (!data) {
data = await db.writeUserData(id, {
id,
bal: client.settings.starting_balance,
xp: client.settings.startingXP,
xpMultiplier: 1,
coinMultiplier: 1
})
}
return cb ? void cb(null, data) : data
} catch (e) {
return cb ? void cb(e) : Promise.reject(e)
}
}
}
My friend helped me write this code
i need help
on databases
i am using json which is HE** i dont like it at all my files have got corrupted two times i need help on setting some else like sqlite i cant use mongodb as the serveice which i am using to host my bot doesnt really alllows mongodb
discord.js
take a look at better-sqlite3
ohkay will do 👍
that will be okay for customizable prefix and other things right? like customizable message
like welcome message
coincidence
also i dont use mongo, and i dont know what your db class is, so i cant help
but you should at least show your db_connections file
same
When I get back from holiday I was planning to switch to postgres
Isn't mongo just fancy json with good performance
@quartz kindle those are the anemoi, greek wind deities
@winged thorn and caching and stuff
cool names
@lusty dew you might wanna not put your credentials in a paste
Ah shit forgot
Yeah probably not a good idea
Oh shit fuck me
I forgot to change it again
Ugh
Changed
Maybe that was the problem all along?
also, idk if you can use {id}, i can only see {id:id} in the mongo docs
well then ok
Basically same thing with different naming
Could that callback thing have been the problem the whole time?
btw, any specific reason you are mixing promises and callbacks?
promises are kinda supposed to replace callbacks or avoid needing them
My friend helped me write the code he suggested that part
Idk why either

But I'm switching dbs rn
Soon*
So as long as it works for now
I'm fine with how it is
Nope
Didn't work @quartz kindle
Actually
Is the function even running
Wait I haven't called it yet
Is there a way I can call it when a user talks in the server?
in the message event
Would I pass it like client.checkUserExist(message)?
anyone here

