#development
1 messages ยท Page 1593 of 1
Just require("fs").writeFileSync("./backup.json", JSON.stringify(db.all()));
Just db.set() everything back
yeeeee
Loop through your data
that doesnt mean it didnt work
tiiiiim โค๏ธ
check if there is a backup.json file
thanks for helpp UwU
Why the image wont show
<style>
.entity-header__image {
border-radius: 50% !important;
border: 3px solid gold;
animation: float 5s ease-in-out infinite;
}
@keyframes float {
0% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
-webkit-transform: translatey(-30px);
transform: translatey(-30px);
}
100% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
}
.entity-wrapper {
width: 100%;
height: 100vh;
overflow: scroll;
overflow-x: hidden;
background: url('https://i.imgur.com/ZDLjyv1.jpg
');
background-repeat: no-repeat;
background-size: cover;
scrollbar-width: none;
}
.entity-wrapper::-webkit-scrollbar {
display: none;
}
body{
scrollbar-width: none;
}
body::-webkit-scrollbar {
display: none;
}
#menu {
background: transparent;
}
.entity-content__description {
background: transparent !important;
border: none;
}
.entity-content__divider {
display: none;
}
.entity-hint {
display: none;
}
blockquote {
background: linear-gradient(90deg, #363636 30%, #fff0 100%) !important;
}
</style>```
๐
So?
Pls pls help me ;c
That's weird, what code did you try?
@opaque fern I swear your presence gets worse every time I see it
do console.log(JSON.stringify(db.all()))
also, where is your bot hosted? heroku/glitch?
what is "slowmode" code
you know, discord chats has a slowmode
what library, what programming language
Context.GetMessage().GetChannel().SetRateLimitPerUser(5000);
i want this code for my dc bot
have you tried searching the documentation for your library
have you tried searching google first
read
the
docs
.PrettyPlease()
);
its not bad codes lol
its just code that you didnt understand how to use
which library are you using?
solved
thanks UwU
its here @quartz kindle
is it quick db
yes
okay thanks
are you ok dude
UwU
or use fs writefile
const hastebin = require("hastebin-gen");
// You can change the extension by setting the extension option
hastebin(db.all(), { extension: "sqlite" }).then(haste => {
// Logs the created hastebin url to the console
message.reply(haste) // https://hastebin.com/someid.txt
}).catch(error => {
// Handle error
message.reply('upps. error : ' + error)
});```
or use this code
apparently they tried that and got an empty json file
Hopefully the string isn't purged by the console
YES YES YES
oh ... its not eval
hastebin.com is broken anyway
Why hastebin?
hmm
const fetch = require("node-fetch");
module.exports = async (input, options = {}) => {
if (!input) throw new Error("Input is a required argument");
if (typeof options === "string") options = { url: "https://hastebin.com", extension: options };
const url = "url" in options ? options.url : "https://hastebin.com";
const extension = "extension" in options ? options.extension : "js";
const res = await fetch(`${url}/documents`, {
method: "POST",
body: input,
headers: { "Content-Type": "text/plain" }
});
if (!res.ok) throw new Error(res.statusText);
const { key } = await res.json();
return `${url}/${key}.${extension}`;
};
hmmm
fs is not working
You shouldn't be exporting user data to public bins
I'm having trouble implementing a ReactionListener with the JDA API for Discord. I want to use reactions as confirmation to a question and then set a listener to this message, which then receives the confirmation via Reaction.
how
Try evaling js require("fs/promises").writeFile("./backup.json", JSON.stringify(db.all())).then(() => console.log("Done"));
=?
You don't need to, try checking the file again
okay
done
but i dont see
any backup.json
running bot on windows vps be like

Try looking in your eval command folder
Actually, your bot main folder
Look in both
its not here
eval command folder
main bot folder
Try searching for "backup.json"
thonk
omg its so hard
I guess your only option is to bin it...
Eval js require("node-fetch")("https://paste.mod.gg/documents", { method: "POST", body: JSON.stringify(db.all()) }).then(x => x.json()).then(({ key }) => console.log(`https://paste.mod.gg/${key}`));
omg thanks
oh nooooo
no its here but
why
const Discord = require('discord.js');
const client = new Discord.Client();
const bot = new Discord.Client();
const {RichEmbed} = require('discord.js');
const { promisify } = require("util");
const readdir = promisify(require("fs").readdir);
const chalk = require('chalk');
const fs = require('fs');
const { stripIndents } = require('common-tags');
const moment = require('moment');
const { Client, Util } = require('discord.js');
const db = require('quick.db');
const Jimp = require('jimp')```
omg only this modules
its so hard
OMG I HOW TO SEND TXT
@pale vessel send txt
hmm
yes ๐
const fs = require('fs');
case 'changelog':
const path = "./Storage/fileName.txt";
const content = fs.readFileSync(path, 'utf-8');
message.channel.send(content);
break;```
i find this code
What library are you using?
@bot.command(pass_context = True)
async def missing(ctx, channel : str = None, useDiscordID : bool = False):
memberlist = []
for member in message.server.members:
toAppend = ''
if "barcode" in [y.name.lower() for y in member.roles]:
if member.nick is None:
toAppend = member.name
else:
toAppend = member.nick
if useDiscordID:
toAppend = f'{str(member)} : {toAppend}'
memberlist.append(toAppend)
is this the code
For?
okay
can u reqrite the code?
No
Yes
omg i dead .... tim help help pleaseeee :C
OH NO
ECONNRESET IS COMING TIMMM
PLEASE HELP
WHAT!!!!
ITS HERE TIMMMM
TIMMMMMMMM
lmao
kekw
yes
done!!!!!!!1
@pale vessel and @quartz kindle thanks so much
i love you guys
thanks for helping me
UwU
All good 
Date is what type?
depends, either Object or Number
Type 'Date' is not assignable to type 'number'.
needs more context
it's object
date is date
this gives no errors
Right, because everything is an object technically
But TS is extremely anal
What's asking you for a number? You can probably just get the number (timestamp) from the date to satisfy it
just do currentdate.getTime() to get that sweet numeric timestamp
const currentdate : object = new Date(),
relationship : object = new Date(2019, 11, 28);
const mili = currentdate - relationship;
used to work without the type
now it says it has to be number xDD
or any
Right, because TS. You wanna use TS, you're going to have to learn to suffer through this sort of absolutely anal retentive typing, that's literally what TypeScript is - it's in the name!
So actually currentDate can be Date.now() and then relationship.getTime(), both of those give you numbers.
const currentDate = Date.now();
const relationship = new Date(2019, 11, 28);
const mili - currentDate - relationship.getTime();
add your type thingies and you should be good
hmm
Date is a built in type in ts isnt it?
getTime() doesn't work on objs
currentdate: Date = new Date()
TRUE
But it works on Dates
you are a date
const currentdate : Date = new Date(),
relationship : Date = new Date(2019, 11, 28);
const mili = currentdate.getTime() - relationship.getTime();
it's good this way
now, wtf
this always worked like this, but rewriting to TS, it now gives me a problem
maybe it's the name?
requires should always be at the very top of the file
hmm
wait, if I delete the line
it doesn't get any error
like eventsource was built in or something
in JS it's not
it's a built-in in browser JS https://developer.mozilla.org/en-US/docs/Web/API/EventSource
The EventSource interface is web content's interface to server-sent events. An EventSource instance opens a persistent connection to an HTTP server, which sends events in text/event-stream format.
so idk why I declared it
But not in node.js - you probably haven't configured ts properly
hope you finish that Geometry Dash SDK
I'd really like people to know I'm playing Deadlocked or something
ty
hey guys
let msg = await message.channel.send(exampleEmbed);
const reactionEmoji1 = "x";
const reactionEmoji2 = "white_check_mark";
await msg.react(reactionEmoji1);
await msg.react(reactionEmoji2);
``` why is this returning invalid discord emoji error?
So uh I just got the ability to get my bot verified on discord and it requires an id/passport and I'm under 18 so is that a problem?
You need to provide the unicode strings, not the names of the emojis
\โ
\โ
I have what Not Erwin has
{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "out",
"sourceMap": true,
"strict": true,
"allowJs": true,
"esModuleInterop": true,
"importHelpers": true,
"strictNullChecks": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"lib": ["ES2020", "DOM"],
"declaration": true,
"watch": true,
"baseUrl": ".",
},
"include": ["src/**/*.ts", "commands", "globals"],
"exclude": ["node_modules", ".vscode", ".env", ".eslintrc.json"]
}
I just changed include and exclude a bit
Try removing "DOM" from lib
nothing changed
Remove the whole lib property
i have this too: ```js
trainers[targetMember.id].mons = [given1]
trainers[targetMember.id].spawnId = [given1.spawnId]
trainers[firstmember].mons = [given]
trainers[firstmember].spawnId = [given.spawnId]
fs.writeFileSync("./trainers.json", JSON.stringify(trainers), "utf8");
nothing
anyone know why? And how to fixt aht?
Try restarting vs code
done ๐
I have almost the exact same setup and it doesn't error
so the problem was from the lib property?
it points me there, cuz it's declared there already
so I shouldn't declare in my file
hi i make my bot in glitch my bot dont do nothing it errors only but idk how to stop that
don't use glitch, if you NEED to use it then use repl.it
const Console = require("./console.js");
const fs = require("fs");
module.exports.load = async function(app, docker) {
app.post("/execute/:id", async (req, res) => {
// Set the id variable.
let id = req.params.id;
let command = req.body.command;
if (!command) return res.send({
error: "Missing command."
});
if (typeof command !== "string") return res.send({
error: "The command must be a string."
});
if (command.length == 0) return res.send({
error: "The command must be greater than 0 characters."
});
// Gets the container and executes a command.
let container = docker.getContainer(id);
Console.addContainerMessage(id, "> " + command);
container.exec({
AttachStdin: true,
AttachStdout: true,
AttachStderr: false,
Cmd: ["-it", "echo", command]
}).then(exec => {
exec.start( { hijack: true, stdin: true } );
});
res.send({
error: "none"
});
});
};
well
im trying to make a execute command using dockerode
but it isn't working
specific part not working:
container.exec({
AttachStdin: true,
AttachStdout: true,
AttachStderr: false,
Cmd: ["-it", "echo", command]
}).then(exec => {
exec.start( { hijack: true, stdin: true } );
});
i am trying to put a hexcode-emoji in winscp
but it gives me fucking ? signs
i tried inputting \โ
Try using the unicode, so something like \u274C
how would i get that unicode
Just google "Unicode for (the emoji you want to use)"
โ
It will give you something like U+274C, so just replace the U+ part with \u
ah so \u2705
Yeah, not sure if it will work. But you can try :)
it will
my question is why are you using winscp to write files to your vps
client.users.fetch("userID") throws this error, if I use JS encodeUri() it throws error "is not a snowflake," how do I solve the first error while still having the right path for the user object?
write them on your own PC and then just transfer em
or git lmao
even better
use IDs
not usernames
if you want to search, use the chunk guild members ws operation
a user id looks like this: 441691703821467669
I'm inserting ID in the fetch request, but it throws error (when recieving back the username with weird characters I guess?)
show your code
Make sure it's a valid ID and catch your requests
solved, thank you
I'm replacing the user ID I'm searching for with the username after it fetches, the problem was I was increasing a count variable before rewriting the user ID so it was fetching twice (the second one with username already)
๐
hey
why am i not able to collect with this: js const filter3 = z => z.content.startsWith('+') && message.authour.id == targetMember.id
@client.command()
async def userinfo(ctx , member:discord.Member):
roles = [role for role in member.roles]
embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)
embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)
embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)
embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))
embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)
await ctx.send(embed=embed)
is this correct for userinfo?
I don't get why you copy the role list
member.roles is already a list, no need to create a new list out of that doe
ohk
can u just copy the code and do the editings?
Thelegendarymonster suddenly became thelegendaryspoonfeed
No, basically just remove the list comprehension, the roles = ... line, instead, access the member's roles attribute directly. What's the issue though?
ohk
@client.command()
async def userinfo(ctx , member:discord.Member):
embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)
embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)
embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)
embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))
embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)
await ctx.send(embed=embed)
like this?
Great, now roles is not defined.
still there's a prob
!
What's the issue though?
...he did think you meant "yes, that's correct"

it's not showing the userinfo when I type the command for it!
can u check if that's completely correct?
this is why ^
roles not defined = error
That's pain reading it and finding what's wrong.
You probably want to check if z's author ID is the same as targetMember's, not the message author
please!
Send the traceback if there's any
can u atleast check the time format?
...what does timeformat has to do with this?
there's no error showing
because u didn't define roles
but the command is not showing!
you can't access a variable that doesn't exist
then should i paste the code that i removed from?
no
can u write the code here?
Nothing is wrong with the time formatting, except the lack of space is killing me
@client.command()
async def userinfo(ctx , member:discord.Member):
member.roles = [role for role in member.roles]
embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)
embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)
embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)
embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))
embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)
await ctx.send(embed=embed)
is this correct?
๐ฉ
No
Why would you ask in the first place if you're not gonna listen to what people tell you?
roles does not exist without that first line
oh yes
also, u sure you're not getting ANY error?
why I didn't thnk it
...because u wanted a ready solution
You may suppress the error or something
[x for x in some_list] is possibly the most basic and redundant code you could've ever written
Well, in this case*
isThirteen(13)
kinda yes
still not working!
no error?
no error
yep!
what to do then?
I hope the indentation is just because of discord mobile formatting
put print("Hello World") in the first line inside command block
see if it prints to the console
no
@earnest phoenix any idea?
is my code correct?
@lyric mountain can u please check if my code is completely right?
just send your goddamn code
Yes
somebody will check it eventually
he did, about 3 times
You want to actually instantiate an Embed object instead
Also fix the roles issue.
ye I just saw it, old messages weren't loading for me lmao
@client.command()
async def userinfo(ctx , member:discord.Member):
roles = [role for role in member.roles]
embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)
embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)
embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)
embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name=f"Roles ({len(member.roles)})" , value=" ".join([role.mention for role in roles]))
embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)
await ctx.send(embed=embed)
this is it!
discord.Embed
what to change?
discord.embed is file
discord.Embed is a class
you want the class
not the file
yep!
should i change the embed into Embed?
just?
Tias
What do you mean?
Try it and see.
ohk
if I tell you to change embed to Embed, what do you think you should do
should you:
a) start a new project
b) change embed to Embed
you can't make up this crap
wait, is that command in a class?
I don't think so
if that's the case then you forgot to pass in self but that's prolly not the case
then what to do?
You've been told doe
norizon, who u talkin' to

Bro do u even code?
I am a little new to it!
That makes sense
Advice tho
Try getting more experience at it before making a discord bot
^
you literally just asked this
show your entire file
don't just copy and paste the code here, go to https://pastebin.com paste it there and then send the link here
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
that site is not available!
what
The issues are just it's supposed to be discord.Embed and roles is not defined.
oh wait, wrong url lmao
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
no
Sad
is PloxHost a good hosting website?
For a discord bot?
Yes
isn't it a minecraft host?
Yeah, don't get those
They're usually bad and you have limited control
I tried DigitalOcean but I can't get my head around it
GalaxyGate, Contabo. Check pins
Alr thank you
ah, yes, unlimited storage, totally true /s
lmao
unlimited memory
time to cache the internet
the whole internet 
imagine making a RAM nuke then getting "Out of memory" then asking for refund
for Contabo
They offer different setup fees based on how long
So if I go for 12 months with โฌ0 setup fee
will I still pay โฌ4.99 a month?
rather than paying a setup fee of โฌ4.99
for just one month
probably not, but who am I to judge yk
probably not, but who am I to judge yk
finally
So yes, โฌ4.99 monthly
No setup free
alr thank you
How can I check is player kicked or left?
why even charge a setup fee if most vps's are automated
I used audit logs but I can't check the time
Gift me an VPS 
It is triggering an old kick
Use bitvise
DO is overpriced tbh
True
DO HAST
GalaxyGate>>
Isn't that just an SSH client?
Yep
what are bivise pros over putty
proprietary /s
do free hosting of ur bot
just use your builtin ssh client, unless you're on windows
Idk, I never used putty
Windows has one iirc
or use terminus if you want to be fancy
But I think it was ass
bitvise has a fancy user interface tho
hmmm
I might stream me coding boring java in that bot dev voice channel 
Yes
U can mess with the files like you would in ur file Explorer
you call this fancy?
this is fancy
this is fancy
thats just ftp
I just got that image from Google lol
Who knows
ss quality is also like win95
Ye, bitvise has it, It's better than managing files through commands
Let's give a moment of silence for the people who have an API with 403 error code in json but not as HTTP header.

429 
i mean, if you want ftp just use something like filezilla
i use ftp inside visual studio so i dont even need it
yeah, sftp
Ty ill look it up
How does it work, u change the file on ur Pc and it automatically updates the file in the vps?
well for js coding VSC is probably one of the best so yea 
what is the best way to send a huge array in a get request?
I am thinking about stringifying the array then encoding it as a component
if you configure it that way yes
best way in what terms?
if you want performance/small size, zlib it
That's sweet
either most efficient or standard
idk if small size is the issue as long as I can actually send this as a get request
yea
get with body is possible but not standard
on express ima do /path/:data
yes
or /path?data=
so just stringify it
depending on which is better
https://million.is-a.computer/files/0h4FqW7Xnhxt59GP.png this is the stringified and encoded
lmao
gotta be careful of having too long of a uri
yea ik
you might get a smaller file size if you base64 it
perhaps
Honestly, I'd probably just make a post req since post has body
and it seems like a shitty idea to make a post request return with canvas
lmao
It could return a Buffer, then you could construct a canvas from that buffer. No memory overhead depending on if canvas clones the buffer or not
an image response can be downloaded as a buffer
so its fine if you respond with image/png
im just sending the canvas buffer
yea
so a post request is a good idea?
at that point, I'd probably just implement a rest lib for the image worker to make the post to Discord itself
only avatar ids
wdym
You'd also need user IDs, no?
Bot makes req to image worker to create canvas > worker sends back buffer of canvas > bot sends image to discord
instead of using JSON.stringify
build your own string
id:avatar,id:avatar,id:avatar
or similar
bandwidth could be saved if the worker sent the image directly instead of sending it to the bot then the bot sending it. Rest is stateless
How to convert this bitfield
['SEND_MESSAGES', 'SEND_TTS_MESSAGES', 'ADD_REACTIONS', 'EMBED_LINKS', 'ATTACH_FILES']
new Discord.Permissions([...])
Why would you make it in the first place if you didn't mean to keep it online
ok thx
having a separate thread for image generation is a good idea tho
oh
I could make a worker thread but im not familar with that
problem is that I think you can only have 1 canvas thread at a time
I was getting an error
const updateClanInfo = {
text: "UPDATE claninfo SET (clan, entryfee, fee, role, due)values($1, $2, $3, $4, $5);", values: [clanID, entryFee, fee, role, due]
}
pool.query(updateClanInfo, (err) => { if(err) return console.log(err + " | setup clan exist query")})
error: syntax error at or near "values" | setup clan exist query
I think it'd be better to make 1 process which acts as a web server for a image worker
yeah ill end up doing something like that
php moment
for now it should be fine tho
yeah
ye
im making virtual pos
but api is not working
here my code
console.log('Paket: ' + paket)
console.log('userid: '+ userid)```
why not working
discord bot
You don't send it like that
hey
HTTPError [FetchError]: request to https://discord.com/api/v7/channels/787168556156190731/messages failed, reason: read ECONNRESET
@lament rock should I return a json or a buffer for the post request?
Buffer I would personally use
Pudochu please learn how php works ffs
Buffer, ye
#development message I don't see what I am doing wrong 
@cinder patio the problem is it's not ignoring node_modules/
@opal plank do you know a fix?
the problem is this
Shouldn't excluding node_modules fix that?
๐๐ป
import it instead of requiring it
wait, I don't have ts@docs or whatever it is installed
and do it at the top
ah, k
i had a small suspicion you were portuguese, not gonna lie
o_O
๐ต๐น tho, not ๐ง๐ท
still same problem
import() works too but its async, so, use the normal es6 syntax
done, and fixed
@mellow kelp happened again
hmmmm
wdym all types?
npm install --save @types/npm
aight, just to know
what problem?
talking in general
oh, yeah, thats ts
what about em?
let me check my functions again
for example
I gotta convert all requires to import I see
yeah, I can't import variables made by me
are you exporting them?
oh
How do i do to make an code in HTML who says if my BOT is online or not?
its helpers isnt it?
config isn't in './config.json', so I don't import I guess
doing it
they're here already
I copied your config, remember?
oh yeah
๐ค
so you got "module": "commonjs",
"moduleResolution": "node", those too?
yeah
hmmm theres no reason it should be bitching about it then
the only thing I changed was removing DOM from "lib":
and swapping ES2019 with ES2020
hmmmmm
which line?
this one?
Yeah
Anyone know what I need to change in express for my CSS to work?
Oh another thing
To import json files you need resolveJsonModule
does't it import all of the object?
in configs
What part of it do you need
eval process.cdw()
wait, who
me?
no
me?
yes
let's all ask 'me'
run ur bot and console.log(process.cwd())
ah k
Yes
most top one

tbh if you're using express, since express 4.x the body parsing middlewares are part of express itself
No extra requires
const currentdate : Date = new Date(),
^^^^^^^^^^^
SyntaxError: Missing initializer in const declaration
โ[90m at wrapSafe (internal/modules/cjs/loader.js:1001:16)โ[39m
โ[90m at Module._compile (internal/modules/cjs/loader.js:1049:27)โ[39m
โ[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)โ[39m
โ[90m at Module.load (internal/modules/cjs/loader.js:950:32)โ[39m
โ[90m at Function.Module._load (internal/modules/cjs/loader.js:791:14)โ[39m
โ[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)โ[39m
โ[90m at internal/main/run_main_module.js:17:47โ[39m
``` @opal plank
xD
what did it log before that?
nothing
huh/
isn't that error wrong
Why you typing a date tho
as far as I can see there's nothing wrong with that code
or whatever
because TS hits me with the ImPlIcIt TyPe
im assuming you did node
yeah node index.ts
๐ฎ
what have you done 
woah
doing those
that defeats it's purpose

what
what?
type inference is literally everything
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'typescript'```
that does not defeat the purpose of anything
o_O
I have typescript globally
without the -g flag
npm i -D typescript
ah shit
also as a dev dependency
done
why should it infer the type?
why not?
NOW try it
node -r ts-node/register index.ts
why would it make you write ```ts
const aString: string = 'blah'
instead of ```ts
const aString = 'string'
it knows aString is a string
explicitly typing it is redudant and stupid
hmm

whoops
im going to steal this gif
sad
o_O
the TS council will decide your fate
idk, I just wanna learn something new
what is TS to a non-believer
๐คฃ
shit
xD
And then I saw TS
Now I'm a non-beliver
I saw TS and straight up converted to nihilism
woah
at first i was like
what the heck is ts
why do i have to transpile everything
why is this thing so weird
and then u thought, EVERY IDE COMPILES
now i can't not use ts for everything
can't not
yes
no
yes, I typed from memory
so I don't want to put the first 3 params in a function, (dont pass them) but I need to pass the 4th param that it requires which is options... How can I not pass the first 3 and skip the fourth
yeah, I like it
but I am now using TS
a(null,null,null,10)
index.ts:114:19 - error TS7006: Parameter 'doc' implicitly has an 'any' type.
114 refP.get().then(doc => {
```wtf
what do I do in these situations?
isn't doc a promise?
Then Promise<SomeType>
yeah it's not a promise
null would override default values so i guess undefined would be the better option
or just undefined
void 0 is shorter

there's no need, but it won't compile
TSError: โจฏ Unable to compile TypeScript:
also, eslint complains about using literal undefined
const _ = undefined;
a(_, _, _, 10);
If you want it to be short
lmao why
Loll
rip
jfc
^

{
"compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"moduleResolution": "node",
"outDir": "out",
"sourceMap": true,
"strict": true,
"allowJs": true,
"esModuleInterop": true,
"importHelpers": true,
"resolveJsonModule": true,
"strictNullChecks": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"lib": ["ES2020"],
"declaration": true,
"watch": true,
"baseUrl": ".",
},
"include": ["src/**/*.js", "commands", "globals"],
"exclude": ["node_modules", ".vscode", ".env", ".eslintrc.json"]
}
kinda hate hearing that saying but whatever lmao
no idea tbh
You're not giving us the actual error
let me show
example
TSError: โจฏ Unable to compile TypeScript:
index.ts:114:19 - error TS7006: Parameter 'doc' implicitly has an 'any' type.
114 refP.get().then(doc => {
~~~
index.ts:123:21 - error TS7006: Parameter 'docP' implicitly has an 'any' type.
123 refP.get().then(docP => {
~~~~
You have to explicitly specify the type
yeah you need to annotate the type
you could just do a(...Array(3), 10) 
like I said..
what
surround it by ()?
it's then, why doesn't it say it can't find
you need parenthesis
y not
xD
null
what's it supposed to do
fetch owner :c
hmm, wasn't message supposed to be an object?
await guild.members.fetch(guild.ownerID)
Doing variable: object is not a good practice
hmm, so it should be any
no, that's even worse
o_O
message is message 
is there a way to send message as txt if text length is greater than 1024 character?
if message is message:
message = message
This isn't #memes-and-media btw
You can also use classes and interfaces as types, not only primitive values
so message is what?
So you'd do (message: Message), where Message is the discord.js exported message class
so I can stick with something
yes, create a text file and send za bytes
๐ฎ
or you could just let ts infer that message is a Message
discord.js has typings for events
import { Message } from 'discord.js';




