#development
1 messages ยท Page 1623 of 1
quick.db is based on sqlite3
oh
so let me download better-sqlite3 first
yes
got many erros
i need to download python
oh no
D:
why you laugh?
i feel abused, i don't want python
but i have to
fml
downloaded quick db
nice
wait
i downloaded the wrong thing
idk wtf i did
whatever i did took lot of space
and i got no result
now i am finding where i installed python
to delete it
uhhhhhh
Hm
Well depends
Not that hard
Maybe soon dashboard, just small api
Yes
Yeah possible
I have make one before.
Writing a dashboard purely in java is pain, so don't
I will
I tried that lmao
now imagine how Notch must've felt when coding the GUI of Minecraft 
Notch moment
No it was easy
Do dashboard in js and api in java
Im sure
Yeah this can work
Umm, we will need some tokens and stuff
isnโt Java just JavaScript without the script
Dashboard access password
JavaScript, also known as Java
ofc
Mfw i actually made a html template and just fuckin replaced something like {USERNAME_PLACEHOLDER}
server-side rendering in a nutshell
It did work, then realized I'm stupid 
alright
why does member.user.presence display the status as "offline" even though I am on Do Not Disturb
i've been debugging this code for days now
@slender thistle i legit can't fucking figure out why my on_message stuff keeps looping

so like
i've been debugging this to the smallest shit
what i understand is that:
- the bot loops but not on its own message
- there is some weird internal loop happening within a conditional statement for
on_message - the loop does not involve checking the role or webhook incorrectly
Interesting
which means i've narrowed it down to this code segment https://i.imgur.com/c4tLkDX.png
the final block of code that basically sets everything in motion
what I think might be causing it
is i'm checking if there is an autoDE role on the member's message, right?
i wonder if it's still being cached and the bot is convinced to keep doing it
because when the bot sends the webhook response
it has to somehow be reading my information still when it shouldn't
i'll try removing the role as soon as it's ran to see if it repeats still
lol nope that didn't do shit
this is driving me fucking crazy
what langiage?
what computering language?
python geh
the only way that this code could be looping is with the role variable
but i have a break statement for it which won't allow it to loop
that's what bothers me the most
Why getting the member object using name?
The break shouldn't be necessary there even
i can't accurately grab the ID if it's used in multiple servers as a role name
yeah
i added it just now
And afaik, if it's in a guild, author is already a Member object?
the return should work as well
it's a user object
the on_message listener event passes a discord.User object instead
message.guild existing, message.author used in the same context
so you have to convert it over

Uh I doubt
that's how it is lmao
But wouldn't message.guild in that case be None if it was a User?
i know that because it gave me an error trying it the easy route
Interesting
Does it have something to do with intent?
But I'm fairly sure they send member object in message create event
nope
that's just how Danny wrote it
probably due to fetching reasons
that's not the point anyhow
my point is that this loop shouldn't happen
regardless of how i'm getting the role data
the loop is being ended with the return call
it quite literally should not be looping if it's looping from where i think it is
Your break isn't even reachable because you already return it, kinda redundant. Also why are you getting the role again when you already get the role object
you're not really helping
Well
i've already told you why
it's pretty dumb to repeat it
i'll figure this out myself
Not sure what the cause is tbh
like i can show you the whole script
and you still prob wouldn't understand why because it shouldn't be happening at all
it's driven me crazy for the past few days
Well I know this isn't related to your issue, but why are you returning get(... instead of the role itself?
i don't care about it being clean right now
i can't
i literally
cannot
the object wont let me
If that's really the case, I'd use find instead, something like discord.utils.find(lambda r: "auto" in r.name, member.roles)
I've mentioned it may not be related to your issue, but you're basically just doing 2 times loop
it doesn't make a difference
Putting unnecessary weird fuckery with loops aside
well
the find didn't work so
that means the role variable isn't the issue
now i'm flabbergasted because the only way it can be getting triggered now is a direct message
Can you just start printing every role object in the loop?
yeah, hold on.
@@everyone (799685484313968670)
@autoDE (815111340719865877)
[DEEPLAPI] Translation request is being attempted now...
here is what i'm getting
So retrieve isn't the issue by itself
no
there are two self-functions
retrieve and check. retrieve is to get the role object, and check is to check if the webhook already exists
if it does, it deletes it and re-creates it to be used for that channel you just spoke in
neither of them are problems from all of the testing i've done on them strenuously
Let me break this code down:
https://i.imgur.com/PzLJiQK.png
target - just a variable i'm doing to get the last 2 letters of the language i translated, i'm plugging it into an embed field title, nothing else.
hook - this is how i'm creating that new hook. this could be a potential issue but i see nothing triggering it.
translation - this is my DeepL API request to send the contents for translation.
msg - this is me grabbing the author's message to delete it so the bot can "replace" you by imitating your chat appearance.
now
i mentioned the only other way the bug can be caused is by a direct message event
the only variable i can think of being a potential bug is msg but mentally speaking, it looks like it's proper and wouldn't be affected by webhooks.
check creates a webhook if one isn't already created, right?
correct
all the await check() function does is just deletes the webhook if it existed
a new one will be created regardless, all the time
although i plan to change this in the future, this is just for testing for now
h
Oh, just deletes
correct
now
what i fear the most
is that the msg variable is copying the webhook message ID
and this is why my fear is really into belief of this
Why are you re-fetching the message btw?
that was in the span of 5 seconds
oh
i forgot
you can just do message.delete()
that's a stupidly old coding habit back during async days
let's see what happens if i remove it
okay the bug still exists
now i'm scared
I forgot why you can't just re-use one webhook for each channel instead of re-creating them
Can you show what check does?
yeah
i remember talking about my anger about how discord handles webhooks and how d.py does it even worse
Can just do self.bot.get_guild(message.guild.id) btw for better performance
i guess if it saves me a few ms
It doesn't return anything from what I see
it's just a call
i'm not looking for a response from it, just having it do a job in the background
But still faster because it's O(1)
mfw
It's just an improvement, not really a solve
Yeah
i tried seeing if the bot was calling upon the webhook message itself
so thankfully that's not a problem
yeah i'll consider improvements
Do you think you could slap prints everywhere in your code and see where it starts looping?
P.S. literally what I do always when I have issues with stuff like this
that's what i tried yesterday
putting them everywhere and seeing where
@@everyone (799685484313968670)
m@autoDE (815111340719865877)
mligma role found
found my hook <3
now in the role condition
made the webhook
ok we ain't da bot for sure.
[DEEPLAPI] Translation request is being attempted now...
message length is in limit for translating
baby got sent off and deleted.
so this is what the structure would appear as
the loop seems to be basically when a message is seen
ignore the formatting stuff btw, my code is supposed to run in a terminal and i'm using IDLE for now for other reasons https://i.imgur.com/4DUNiUd.png
Maybe try to check if the author discrim is 0000
fair point
if message.author.discriminator: 
but '0000' isn't falsy, is it?
Oh yeah right, it's string
yeah 
if int(message.author.discriminator): gang
that's pog
and just to be extra, message.author.discriminator.count("0") == 4
But because of the zen of python, I'd rather return if it's 0000 for less nesting 
is there any way i can keep my heroku app from ideling
?

Idling?
yes my bot gose offline when i close chrome.
Well I suppose because it's processing the webhook message
Also if you use this as shiv has suggested, it'd reduce the requests ig
True 
XD
Sa
@slender thistle you dont by any chance remember how to link an attachment as a image url?
im
close
I think there was some tag in d.py server for it
local image embed or something along those lines
thats what im trying to find 
sec
@slender thistle got it
Oh it's in the FAQ
well i was close

xdd
HOILY FUCK
I DID IT
@slender thistle 
fuck my life in so many ways
i am never touching webhooks again
LMFAO
lol
Pretty cool
oh wow ๐ฎ
how do i log a commands output to a txt file? i know there's a way i think?
probably just fs.appendFile ?
in a specific command or all commands?
HOW DID YOU DO THISSSSSSSSSSSSSSSSSSSS?
slash commands
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
then?
also, do you have the docs open everytime?
it takes less than 5 seconds to open it
but yes, i had the api docs open
oh
not this one specifically tho
how to open the dosc quickly?
v12 is the version of node.js
only v8
what do you program in?
doesnt matter with node version
python or something?
v12 is a pseudonym of the dev branch for d.js
v8 is the official latest Discord API version
yes, it's in python
i code in typescript
I will be migrating my bot into DiscordPHP soon
i do js
so that my brain can function properly
explain a bit nicelier ples
anway, like flow mentioned, theres no v12
d.js latest version(and mostly used here) is v12
api only goes to v8
slash commands kinda smelly doe ๐ณ
C'mon Erwin you've been here long enough to know they either mean d.js 12.x or nodejs 12.x ๐
well they were mentioning slash commands
and probably d.js because who would care about the node version
and then mentioned v12
i know for a fact node version doesnt matter
nor does v12 d.js
cuz they dont support it
is this your bot?
so i have no heads for tails what he was on about hind
no i found it on the side of the road
bruh
-.-
Telling your bot that it's adopted...
heart brok
wait until you see the betrayal arc
He did specifically say i mean, they aren't working well in v12 so I thought that was pretty clearly d.js v12. Maybe I'm just a better noob interpreter.
My bots are my test subjects. I don't care about their feelings and I use them whenever and however I want to
my bot is the same as an emo teenager girl going through puberty and throwing tantrums everytime i even look at her in a weird manner
that just sounds like basically every teen girl who went through a rebellious phase
thats the thing, he wasnt even referring to d.js lmao
It's a phase..?
you said node afterwards
,
lol, people confusing themselves ๐
ikr!
emo gf cringe ๐คข
big titty goth gif amazing ๐
i just went past the point of no return btw
my gf is unironically big tiddy goth so it works out for me
reassuring bf and needy emo gf
no
cant undo sharding anymore
Where do I put the SQLite binary files after I downloaded them onto my Raspberry Pi?
is this a mood?
You tell me ๐
the most common duo i've seen is the introverted, nerdy guy with the passionate, outgoing girl
it's really something to see
it's like gender swapping their relationship roles
This is the kind of development we need here
lmao
Hey, if it helps people be happier... why not?
mood

You don't
Girlfriends aren't coded. They create themselves without any knowledge on how to code, which evolves into constant bugs like mood swings and unstable behavior.
teach me too
bruhh, EXDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDIDI
Anyone able to help me?
What do you plan on doing with it?
step one: choose a famous character
step 2: create a bot named after that
step 3: add the pfp of that character
step 4: copy some random ass repo to make it a bot
step 5: ...
step 6: profit, you now have a waifu gf
Iโm supposed to be creating a db file in Terminal, according to their guide
hmmmmmmmmmmmmmmmmm, then i have 22 male gfs 0.0
well, my main and test bot, i haven't kept a gender for them
i need to check some repos speaking of which
can we at least attempt to keep this channel on-topic 
aren't you the guy who made genshin utils bot? ๐
we are talking about development of girlfriends bruh
click meh status ๐
thats the joke
i prefer this one cause its easier to do:
step 1) make a bot with an anime pfp
step 2) direct profit
Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
h
yes, well im sure that is well beyond the scope of this channel, and not on-topic
oh, ok ok
Iโll DM the link, since itโs currently near impossible to chat here
I mean, you just create a file and then... connect to it and create your tables?
he hasn't coded a gf bot
wait, who delete my message?
is talking about 'horniinstagramgirls' relevant to development?
umm, ok, let me reply to it in general
dont ping me
salutations and goodbye
exdi
what was this about o.o
your mom
just encodeURIComponent() the text @stark abyss
what does that mean
so this could probably be where I query the database right?
Query the db? what db do you use
postgres
I don't think that's got to do anything with your error
oh
wot are you even doing
Does anyone know a bot that can make a message deleted log channel and include images?
Well I got an error, and i had no clue what exactly caused it. I posted it for one sec, and deleted it because I thought I could figure it out. He managed to see it in one sec 
my question is: why you dealing with http queries?
I am not dealing with it, I have no clue what the error is I just thought it was with database because there was a command which wasn't working
you're asking about a query and URLcomponent,. my first assumption is that you're doing http calls yourself
I don't think so 
Just ignore me man ๐
Thank you but I can't get back to coding right now. It would be better if I could go read the error again, and then ask for help so I am not giving half ass information
fair
ok
& btw how do I put a custom status to my bot?
language?
what language
yes but what language? py, js?
yes what language?
English

no what coding language
Here
are you using js or py
I'm using glitch
ok
i wonder how many people just went in here and facepalmed really hard
owo
It says discord.js
๐๏ธ ๐ ๐๏ธ
If your on android
client.user.setActivity("text here", {
type: "PLAYING"
})```
What do you mean by access? Like, read them?
ah js
Ok tnks
100% you get mentioned because he doesn't know what to do
lmao
What language are you using? If you are using js you can read them programically via fs.readFile
im ready LMAO
....
I don't think there's a difference
Nice!
yeah
You're hosting on glitch, right?
Then you should whitelist all ips in your mognodb atlas admin panel
Glitch apis rotate very often
So it's better to just allow all IPs
But make sure set a strong username and password in that case
mongodb atlas
search it up
You have the current IP, but that IP will change very soon, and you'll have to get the new IP and then whitelist it
Hey, I have a error:
TypeError: event.bind is not a function
at /app/index.js:17:41
at Array.forEach (<anonymous>)
at /app/index.js:15:40
at Array.forEach (<anonymous>)
at Object.<anonymous> (/app/index.js:14:28)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
you're trying to bind to something that's not a function
My index:
const fs = require('fs');
const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'REACTION'] });
Discord.Constants.DefaultOptions.ws.properties.$browser = "Discord Android"
client.commands = new Discord.Collection();
fs.readdirSync('./Commands').forEach(folder => {
fs.readdirSync(`./Commands/${folder}`).forEach(file => {
const command = require(`./Commands/${folder}/${file}`);
client.commands.set(command.name, command);
});
});
fs.readdirSync('./Events').forEach(folder => {
fs.readdirSync(`./Events/${folder}`).forEach(file => {
const event = require(`./Events/${folder}/${file}`);
client.on(file.split('.')[0], event.bind(null, client));
});
});
client.login(process.env.token);
one of your event files is not like the others
"guild logs"?
It most likely doesn't export a function
what is the file name, and can you show us the contents?
when my boy join a new server, I have informations to the new server in a channel
show us the code inside the file
So you mean guildCreate
Now I can do custom status :D
const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');
const client = new Discord.Client();
const logsChannel = '815953311614107709';
client.on('guildCreate', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle(`Omg, chuis arrivรฉ sur un nouveau serveur !`)
.addField(`Serveur`, `${guild.name}`)
.addField(`C`)
)
})
client.on('guildDelete', (guild) => {
})
its my guildlogs.js
I put this in events message
with message.js
you don't export a function
This how I do my custom status
client.on("ready", () =>{
console.log(Logged in as ${client.user.tag}!);
client.user.setPresence({
status: "online", //You can show online, idle....
game: {
name: "Using !help", //The message shown
type: "STREAMING" //PLAYING: WATCHING: LISTENING: STREAMING:
}
});
});
looks like you don't understand how your own command handler works
that's not how you're supposed to write event files. Look at the other events. the structure should be the same.
This is a "one of these things is not like the others" sort of deal. you can't just invent a new bot inside a file, you need to follow the structure you yourself defined in your own command handler.
ok but oyu can't just add module.exports
the format needs to be the same
you can't create a new client in here
can you show us any of your other events ?
or just make that event like the others
I hope you know how those work
Now this is coding
That's nice, dear.
thatโs cool
nice I can already imagine your token getting leaked
storing tokens in a .json file on glitch

its prob a private thing
nah I am 95% sure its public
glitch doesn't have private code unless you pay for it
oh wait
yes
thatโs a change
and no one is stupid enough to pay for glitch
I know a few people...
That would pay for glitch instead of just buying a full VPS?
yes
sad.
weird
how much is glitch per month
Isn't it like $17USD/month
Jacob
something horribly expensive and definitely not worth it for such a crappy service.
fuckin hell
I remember
I pay less than that for a vps infinitely better than glitch
I remember paying $3.50/month on OVH and I had enough power for 4 bots and 2 websites on there 
great
it is, and it's free.
glitch is fine for small utility sites
repl is good for small bots. once they get big move to VPS
honestly, repl has some good upgrade routes for paid options
I think a pretty large bot(non music ofc) could be on repl for a ton of servers.
this is english only
or #general is english only
And bot that doesnโt do any weird processing you donโt need a lot of power
this is a channel for programming
For many servers
go somewhere else if you want to learn to speak
Still haven't read #502193464054644737 , I'm guessing?
maybe go read that for situational awareness.
Ok
I have repl.it premium cuz voucher
oh and I applied for github student so if I get accepted I will get 6 months ontop of that
lol
I don't have a vps atm
at least not any server I own
so
yeah
I use repl.it
lol
but please never pay for something like glitch its stupid and a waste of money (not directly directed to u)
I think there is a list of some good hosting providers somewhere in here
pins
Of course not I'm on the phone with Google that I've been hacked prior previously now today and due to our issues that we are currently having on the platform here recently is out of retaliation of honesty so I'm on the phone with Motorola regarding my phone because it's majorly tripping and I'm on the phone with Google as well letting them know that they need to do a major research on this situation with the cyber bullying and hacking because it has basically affected the platform on aggressive level and my devices costing me money and no one has done anything I mean I was the only one that was getting punished and it was like favoritism was given to him gratefully so I got approach this on another level excuse my pronunciation or what not but this is for the safety of staff and the well-being of others on this platform including mines so I will be online here maintaining my position and doing my best to get through with Motorola regarding my phone Samsung and Google so we can get to the other platforms communication this is a major issue
i have heard a lot about "github hosting" is it hosting your code or is it just making sure there are no errors?
ummmm.. what?
Why does that sound like crap that belongs in #memes-and-media ?
cuz it does
That's a loaded question that sounds simple but has many complex answers
ok. ill google it
ya
Github Actions: CI/CD automation for code checking and testing.
thay makes sense
long story short, github doesnt provide hosting services for running scripts?
github isn't a VPS, no.
my problem with hosting providers often is just the fact it has too little ram to run my bot
lol
most just provide too little ram for "too much"
my bot takes up a gigabyte at least even when optimized and digital ocean for example gives 1gb ram at 5$
pain
DigitalOcean is expensive
true
but like
aaa
other hosting providers don't give much ram either you know
$3 1gb, or 2gb at $5 gg ;p
lol
yeh
im happy a certain friend lets me use thier dedicated server with like more than 64gb ram for my bot available lol
ngl
just get a proper server that is not a vps. sure they are a bit more expensive, but if you get a decent host you have a way better price / performance than a VPS with the same specs
$help
leeching not pog
but yeah
ravys dedis go brr
wrong channel
lol
my bot is not gonna destroyyyyyy it
bruh
only gonna make it a stove in the data center
actually im not gonna buy a vps anytime soon
im getting a raspberry pi 4 atm
here as comparison: Digital Ocean compute optimized VPS with 2Cores and 4GB ram goes for 40โฌ/Month, for 55โฌ/Month i can get a Root Server with 6 Cores / 12 Threads and 64GB ram
๐
should be enough ig
digitalocean overcharges
you can overclock the RPI but you should use an Active cooler
i saw people running it at 1.4Ghz
I like how they have this text in thier ad "and it runs on digitial ocean, meaning we can keep the cost low and pass the savings to you." Yeah no
lol
nice
I mean if I used the raspberry pi 4 then probably not for my kind of bot
maybe just a casual bot
like idk simple moderation bot or something
to be fair they have better pricing than Google and Amazon, they have such a stupid pricing model that will cause people go bancrupt
Hi, I'm trying to get the value from a json object.
{
"id" : "b2732392fae140c3b836a066c6debd8f",
"name" : "Minecraft",
"properties" : [ {
"name" : "textures",
"value" : "ewogICJ0aW1lc3RhbXAiIDogMTYxNDYxNDkwOTEyMywKICAicHJvZmlsZUlkIiA6ICJiMjczMjM5MmZhZTE0MGMzYjgzNmEwNjZjNmRlYmQ4ZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNaW5lY3JhZnQiLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzZhYzIzNDZmMjM0YWE4MjRmMzU1NjhiYTZhN2U2NWE4ZWU0ODk4MmFmZmE2MWIwYTE2YTkyZWE0ZTA0MzRlYiIKICAgIH0sCiAgICAiQ0FQRSIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTUzY2FjOGI3NzlmZTQxMzgzZTY3NWVlMmI4NjA3MWE3MTY1OGYyMTgwZjU2ZmJjZThhYTMxNWVhNzBlMmVkNiIKICAgIH0KICB9Cn0="
} ]
}
I tried to get it using jsonfile.properties.value, but it shows up as undefined. What am I doing wrong?
like someone wrote a Webpage to calculate what a google will cost you
Hmm, so what would I have to do to get value from the properties array?
properties[0].value
I mean
or is it shared still
tell me someone who doesn't in 2021
its still against most ISP's to do server stuff from home internet 
they have business plans for that
me
when you pay for a home plan its just for home stuff ๐
it shouldn't be a problem to just run a raspberry pi 4 on ethernet the whole time
isn't it
i mean they wont do anything
still shared i guess, they dont tell you if its dedicated or not, but anyways for 15โฌ more you can get way more power
and its not shared
lol
so it's dedicated but it can be shared but its dedicated?
?
according to you
you miss some context i guess
like galaxygate, when you get a compute plan its not shared, you can max it 24/7 and they wont complain.
other plans its you can max it for a day or two before they will even consider complaining
ive talked earlyer about it and said out of my own experience that DO offers a Compute Optimized VPS for 40โฌ/Month ( 2 Cores/ 4GB Ram) and a dedicated root server goes for about 55โฌ/month (6c/12T 64GB Ram)
and the compute optimized VPS is still shared
the only difference between a normal and a Compute optimized VPS is the clockspeed i guess
I hate the way this is being compared ๐
i know that the normal VPS ive got there where running at 1.6GHz
ghz means almost nothing in server hardware imo
my root server got a 3.6Ghz base clock and 4.2GHz boost.
also it does for certain stuff, like rendering and Tensorflow
and other stuff that is Compute Intense
I have simmilar speeds on the stuff my bot runs on
lol
like there are 2 ways to solve a compute bottleneck
- Throw a shitton of cores on it
- have fewer but faster cores
Most datacenters go for more cores bcs of more efficent use of the space they have
like they can provision way more stuff running on a single machine if you have a ton of cores
@everyone
you know it doesnt tag
She post that in every channel
fun-fact: it does for some people
lol
everyone tag is disabled, only way itll tag is if you enable tag for every message right?
๐
interesting.
it's discord after all
Hey
I made a event from when my bot joins a server, I have informations to the server in channel, but not works and I have any errors in the console
My code:
const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');
const client = require('../../index')
const logsChannel = '815953311614107709';
module.exports = async (client, args, message) => {
console.log('b')
client.on('guildCreate', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle(`Omg, je suis arrivรฉ sur un nouveau serveur !`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Fondateur`, `${guild.owner}`)
.addField(`Nombre de membres`, `${guild.memberCount} membres`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor('GREEN')
)
})
client.on('guildDelete', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle(`Oh nan, je viens de quitter un serveur :/`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Fondateur`, `${guild.owner}`)
.addField(`Nombre de membres`, `${guild.memberCount} membres`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor('RED')
)
})
}
that's still not valid
I guess we were talking to a wall earlier
when we said you shouldn't create a new client
or have client.on() lines inside an event
Or that you should look at other events and see how they're built, and use the same format
okay, I will test
guildCreate.js and guildDelete.js will be the 2 files you need to create.
because they're separate events. you can't combine them

oh
client.on('guildCrate',handler).on('guildDelete',handler)```
๐ง
this is obviously a joke
guildCrate
are you sure you're not within an existing path like /api already
can you show other methods vs this one?
ok
This is my only other get route, and the difference between this one and the other one is that the path is deeper
"deeper"?
You're drop-feeding us here, we need more context
can you widen the lens on these screenshots so we see more useful context
/api/forms/me and /api/verify
yeah ok but what about /api/forms/create , does that work?
yup
Is that in the same file as /api/forms/me ?
nope
so, back to my theory: it's probably a sub-route to something else
but you're being extremely stingy with your context so I can't say for sure
const endpoint = require(filePath).default as IApiEndpoint;
console.log(`[Express] Route [${endpoint.method}] [${endpoint.path}] loaded!`);
app[endpoint.method](endpoint.path, endpoint.exec.bind(undefined, db, config));
This is how I load them
I never send a 404 status in the exec function, either
definitely
hmm.. where exactly are all routes stored in express? I could console log that
Actually I think I know what's wrong...
I have a /api/forms/me route.... and a /api/forms/:id route... ๐คฆ
Sorry for wasting your time with my stupidity lmao
hey im using discord.py and i was wondering how to add a currency system (like dank memer has dank memer coins). how would i do this?
A database + caching system attached to the bot object
can you point me towards a recource i can use for that?
maybe a link?
Give me a minute
Oh fuck it there's nothing on Google
wait someone who not instantly ask for code for such stuff. i have hope into humanity again (atleast for the next 40 Minutes)
also i have a question more specifically directed to the mods: i want to get my bot approved by top.gg, but my mom blocks my computer 2 hours after school so i cant keep it online enough to get it tested by the mods. what do i do?
I'll try to break the general idea down
get a VPS or a Raspberry Pi
@sinful belfry slurs
wtf did they say
In multiple channels also
if you need help with translations please tell me I'll be writing a paragraph in the meantime
hold on let me put that in google translate
sHIIV WHAT DID THEY SAAY
You can translate it yourself

but that takes work
and might not be accurate
I expected worse ngl
"Your chat is shit" is the implication
nah it gets worse in their previous messages
Fuke?
i wanna know now
well he is gone together with the messages
for tsconfig, I want to include src but exclude src/engine. How do I do that?
Its not working
add a wildcard?
how?
hmmm that should work though
yea
@slender thistle i looked it up on google but all i can find are people telling me to use json, but i dont know where to get json
dont use json
I did, but still, I'm getting type suggestions, auto imports from engine folder
learn how to use a database like: Mysql, SQLite, Postgres, Mongodb. there are many more but these are some of the more popular ones
Stry ./src/engine
i tried SQlite
thought I doubt that would do anything
but SQlite needed a download and i dont have the parental access code
will work for what you want to do, but i cant really help you code wise i dont know py this much
well you could use a free hosted database they usually dont need this stuff
MongoDB Atlas is offering a free Database
ok i'll look into mongodb
@olive roost
First question:
The best and probably most efficient way to create a currency system is by using some sort of a database (like PostgreSQL or MongoDB). On top of that, you'd want to keep user currency in your memory, like a dictionary attached to your bot/client object. There are two ways to go about this:
- If you want to keep currency per-guild, you need to have a dictionary that has guild ID as the key and in its value, there will be another dictionary. Now, that dictionary will be similar to a format like
user_id: currency; - If you just generally want to keep the currency global, having a dictionary that follows a format of
user_id: currencyis enough to work with.
Once that's in place, you now need to handle stuff like user not being in the dictionary, and making sure that proper calculations are done in your commands. You very possibly want to keep your database as up-to-date as possible, so on each command usage, you need to work with the cache system AND editing the user's data in your database.
try include src/*, exclude src/engine
also listen to what Shivaco say, he knows what he does
ok im looking into mongo
yes, thanks. It worked
A simple example if you want to do a global currency system:
bot.currency = {}
@bot.command()
async def some_gambling_command(ctx, ...):
user_currency = bot.currency.get(ctx.author.id) # gets the user's currency OR returns None by default
if user_currency is None:
# set user_currency to 0 and add ctx.author.id to the bot.currency dictionary
# command stuff
# after the command is done, you now basically save the user's currency in a database, or edit it if there's an existing entry for ctx.author.id already
Under what context?
a MongoDB cluster are 3 Servers that hold the data in parity
i clicked the only free option
if one server goes down you wont loose access to your database
yea thats normal
so what do i do now
by default you get a Replicaset
?
i guess read the docs
Atlas, eh
or find some good tutorial in how to use it
if you start out its quite decent, but if you grow larger its better to go to a self hosted DB
also they are quite Expensive
I mean, I started with a self-hosted database right away so I'm not familiar with Atlas 
like the Paid tier that gives you access to all MongoDB querys cost 60$/month
ive tryed them for a month, then went back to self hosted
How was it?
well ive needed access to check if entries are older than x, looked up what tier i need, and noticed after 3 weeks that they will charge me 40$ after 3 weeks
so ive rented a 5$ VPS and run my Database on there
funny is they just use Azure, AWS or Google for hosting the DBs

and since they give you a replica set of 3 Servers you have to pay for 3
i think about running a replica set in 3 docker container for having some better I/O Distibution
have fun with corrupted files
m yes competition. what bot is that?
how do i put something in this gap? i tried :
<h2 class="styles__StyledDiv-sc-1qvyf7s-0 bqAvgD vm-placement ad-placement" HELLO EVERYONE<h2>
You can't really put anything there via HTML
Ew competition, get outa here!
sent with love,
yours kindly,
the invitemanagement team
You can go the hacky wacky way probably with CSS but that's gonna be a pain to accomplish
bro ive been in and out with that, its why i moved to tiny files that litterally contain 6 lines.
CSS + negative margin
still wont replace a proper database
๐ฅฐ whelp my bot is already out there with 100+ servers. hold up and ill look at your bot brb.
Ahh nevermind then i guess. Was hoping to move the review messagebox or something up there
hmmm idk it seems really fast but idk. ill change when i have issues
Whats yours called? :p
You can do this
It's a small workaround but it might help
hold on ill dm you a link
okai
there i sent dm
this is how you pay with your mental health, you will end up with your entire system breaking down bcs some crackhead on some random server found a way to cause your bot to just write and read with insane rates from the files, causing you to stay all night up, finding a quick and easy way to migrate ASAP to a proper Database. in the End you sit at 5 in the morning infront of your pc with a Mental breakdown bcs you lost 15000 Datasets with no way of bringing them back, since your bot will become probably unresponsive many people will kick the bot, causing it to rapidly decline in the userbase, this could end up with you getting frustrated and maybe in the end giving up on it.
so DONT use Json as a Database
beware the siren
when you face issues, it's already too late
tbh i know a guy who probably would Brick the bot within a day
how do i mention the sender of the message with python?
Commands extension or on_message?
he managed to DDos my bot for fun, using a API my bot uses
it's just a single wrong character, a dangling file terminator
Oddly specific
whelp lmao i dont do that when i face issues. i just turn off my bot and figure it out in the morning

you open your json database and face [object Object]
We used to use text files, until the god himself smadger came along
database > txt files
JSON files = configuration
Databases = dynamic data
They don't exactly work well the other way around
lol whelp imma keep doing it the wrong way ๐
well, if you're fine swinging meat sticks in front of a lion...
to each one their own
ยฏ_(ใ)_/ยฏ
humans are stupid, they learn the fastest way with pain
Is the best way

whelp ive done it all "wrong" so far and have had no issues
ITS YOU AGAIN
so to each his own
doing it wrong doesnt mean it wont work, it will just bite you into your own ass one day
ever heard of a thing called "cancer"?
you can live a whole life with it
without noticing nothing wrong
then suddenly: you're ded
spend a few hours now to save thousands later
now stfu outta my development when i never asked for help
What's your bot called?
PHAHAHA
An fleshed out, fully functional invite tracking bot.
hows the page going
if he ever gets to work on a coporate system he will have fun, if he has to explain to his boss why he just lost the Data for all Customers, ongoing projects and other stuff
given up? ๐
oh...
Why is it offline
afraid of getting its data corrupted
i was having some api issue
the .me object wasnt returning from a guild and it was fcking everything up
Hey, I have a error, someone can help me? ๐
My code:
const fs = require('fs');
const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'REACTION'] });
const logsChannel = client.channels.cache.find(channel => channel.id === 815953311614107709)
Discord.Constants.DefaultOptions.ws.properties.$browser = "Discord Android"
client.commands = new Discord.Collection();
fs.readdirSync('./Commands').forEach(folder => {
fs.readdirSync(`./Commands/${folder}`).forEach(file => {
const command = require(`./Commands/${folder}/${file}`);
client.commands.set(command.name, command);
});
});
fs.readdirSync('./Events').forEach(folder => {
fs.readdirSync(`./Events/${folder}`).forEach(file => {
const event = require(`./Events/${folder}/${file}`);
client.on(file.split('.')[0], event.bind(null, client));
});
});
client.on('guildCreate', guild => {
console.log("Joined a new guild: " + guild.name);
const joinEmbed = new Discord.MessageEmbed()
.setTitle(`Omg, je suis arrivรฉ sur un nouveau serveur !`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Fondateur`, `${guild.owner}`)
.addField(`Nombre de membres`, `${guild.memberCount} membres`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor('GREEN')
logsChannel.send(joinEmbed);
})
client.on('guildDelete', guild => {
console.log("Left a guild: " + guild.name);
const leaveEmbed = new Discord.MessageEmbed()
.setTitle(`Oh nan, je viens de quitter un serveur :/`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Fondateur`, `${guild.owner}`)
.addField(`Nombre de membres`, `${guild.memberCount} membres`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor('RED')
logsChannel.send(leaveEmbed);
})
client.login(process.env.token);
(node:3601) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Client.<anonymous> (/app/index.js:32:17)
at Client.emit (events.js:315:20)
at Object.module.exports [as GUILD_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:825:20)
at Receiver.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3601) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3601) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My error
client.channels is empty if you're outside an event, because the client isn't ready yet
client.on('ready', ... tells you when the client is set up, don't read any properties from it until you get that event
its on my index.js
I feel like you're not understanding the actual problem at hand here ,which is about scopes
I'm french I don't understand english at 100% O_O
you really should have a decent understanding of javascript before trying to write bots. Youre knowledge is clearly... lacking.
:/
your written and spoken language aren't the problem here.
Thats not whats happening, the facts are you must spend time learning javascript before making a bot to do it properly.



