#development
1 messages ยท Page 1789 of 1
// Get command from the collection
const cmd = <Client>.commands.get(command);
// If the command doesn't exist in the collection, return
if (!cmd) return;
// Execute the command if available
cmd.execute(<Your parameters goes here>);
Lads, we have an error here
Can u check the decomplied zip I don't much about this decompling and java
<Client>.commands.get(...)?.execute(...)
Can u check the decomplied zip I don't much about this decompling and java
Stop spamming
no ๐ง
maybe you should learn both java and y'know... Basics of compression?
I may be stupid, but I believe he's missing the .cache
where ๐ ?
I think I'm slowly going crazy. This has me wheezing for some reason.
<Client>.commands is not a native property, so there's no cache
poor shiv
Ah yes true point
Did say I was stupid

wait....there are no errors ๐

yes
i did add instead of ping ๐

it is on detritus

didn't someone mention that already
ye
But you will run into more errors like these if you don't execute the commands dynamically
Like I mentioned here
if only there was a lib that came with a command handler for you so you dont have to code a bad one yourself
Erwin's language: detritus, detritus, detritus, detritus? Detritus!

funfact, i didnt say the word once
it was all implied and you knew about it
nvm i did say it
How much
Sir
One message removed from a suspended account.
shush
Gigachad
One message removed from a suspended account.
One message removed from a suspended account.
i did like this
const client = new Discord.Client()
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./Commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./Commands/${file}`);
client.commands.set(command.name, command);
}
const prefix = process.env.PREFIX
client.on("ready", () =>
{
console.log("Bot is Ready!")
})
client.on("message", message =>
{
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (!command)
{
return;
}
else if(command)
{
client.commands.get(command).execute(message, args);
}
})
client.login(process.env.TOKEN)```
$30/hr
That else if statement is completely unnecessary and redundant
btw, which functionalities does the Command Handler have, which is not codable in short? Could you mention some key features? 
everything
ok i removed it!
you have a free pass :<
And you're not even getting the command to see if its available in the collection
One message removed from a suspended account.
let me get u the features rq
and whats the best out of it ๐คฃ?
Oh no
Okk thanks sir
aliases, help, description, permission checking, error handling, priority, argument parsing
literally everything you'd have on a command handler, it has it already
Ah yes here we go again, today's #development sponsor: Raid Detritus Legends
look, they asked

@tired panther and those are only the options for the command itself, there are more on the handler
custom prefixes and a ton of other shit
true
and heres the best part
Could you show the Ratelimit functionality?
const client = new Discord.Client()
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./Commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./Commands/${file}`);
client.commands.set(command.name, command);
}
const prefix = process.env.PREFIX
client.on("ready", () =>
{
console.log("Bot is Ready!")
})
client.on("message", message =>
{
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (!client.commands.has(command))
{
return
}
else
{
client.commands.get(command).execute(message, args);
}
})
client.login(process.env.TOKEN)```
now it is..........
can you please surround it with three graves

literally this hard
That should work, the else statement is redundant there
you set which type it'll apply for
but it works !
Also you can just if (...) return; instead of if (...) { return; }
i know it...but i like this way ๐
so you'd do something like this for example
so you can only use 10 commands for 12 seconds in dms, after 12 seconds it resets it
just like discord
uses per amount of time
I find it easier to read with single line IFs using brackets
makes it a bit easier to see what effects what
does it have exponential ratelimits?
as if someone is trying to spam it?
nah, it'll just not run the command if they are ratelimited
they shouldnt be linear (5+5+5) => rather more (5 + 10 + 12 + 14 + 16 +20 + 40 + 100)
this is the same way discord ratelimits it
i think you can set the ratelimit for users too
let me double check
oh yeah you can
Did they made a Guide lol?
kinda
i have a basic repo for people to get the gist and @umbral zealot should have some vids coming up
yeah I'm sort of working on it ๐
she didnt link it on the server yet, so i assume its still being made
One message removed from a suspended account.
it's far from ready
One message removed from a suspended account.
like for example literally having 100% wrong information about sharding in the guide
hug
One message removed from a suspended account.
- an idiots guide to detritus(WIP) https://evie.gitbook.io/trash-guide/usage/the-simplest-of-bots
- docs http://detritusjs.com/
- cake's good bot code https://github.com/cakedan/notsobot.ts/tree/master/
- erwin's basic bot https://github.com/erwin1234777/detritus-example
ads
yes
for now i'd recommend using my repo and the docs link
Shame on you Erowoin
the docs you can pretty much use inside with typescript and intellisence
my slash command bot > Erwin's basic bot
bonk
One message removed from a suspended account.
One message removed from a suspended account.
lol, I take the credits
you should've added on both tbh
what
my main bot uses both the same thing for slash commands and normal commands
merge them into the same repo
i still need to test that extension evan told me about
to extend the message structure and add the button collector
Can someone help me with this error?
Let me try, time to test something new....
clone my repo
add token in config and add ur id in the whitelist
and then run it with f5
that simple
nah, imma add the transpiler only flag
Is there way make captcha system with python?
why what
and theres already a node . script in it
cuz debugger attached?
like an ACTUAL dev?
imagine running node without a debugger when you are in development
uhm yes, I am the debugger ๐คฃ
legit tho, if u are using console.log() to debug things, you're doing it wrong
debuggers are exactly for that
im sorry im american
whats a good dev
discord doesnt know what a good dev is
you clearly havent been using discord for longer than a couple weeks
crash gifs, exploits that take down guilds, changing ui's multiple times, adding useless shit
and the list goes on
I've been on discord since sep 1st 2020
then you're relatively new
alr
wanna see what a good dev is?
crash gifs as in those gifs that crash mobiles etc?
Sure.
fuck where is it
Where is what?
the if else thing? the one you posted on your reddit a while ago?
not if else
they legit released a build that literally crasesh when you open
me rn on replit:
@crimson vapor@sinful thistle #discord-news message
not a single person tried the app out before publishing it

which debugger is it in? theres 2 settings i added
you wanna like maybe show the error message?
bruh what
t
lol, good meme
i really need to remove the other ones
where do I do this lol?
time to pr the fix
jaex abi pls fix
SHould I do npm i ts-node?
hi
and one of the is hungry af
did u do npm i ?
added another command like this same but not working ๐ฆ
when you clone the bot, it doesnt download the dependencies
you need to either npm i, or yarn install
yeah Ik
I saved them globally
you're.. running a typescript file with node and a ts-node require? wtf
nah, thats what i set to
instead of tsc
and running just node
im very much fond of ts-node
i need to add the transpileronly flag there
yeah but why not just ts-node file.ts
so if people want to run it in prod, there wont be any diff than trasnpiling it beforehand
u need it globally to run it
otherwise it'd error with the same thing he showed
put it in an npm script
interesting
seems kind of counter intuitive to require tsnode like that
it is a bit, but its just saved as dep
line 6, 25 huh
let me check that
oh
i know why
fucking @crimson vapor
why not use tsc to find the errors?
wrong confis.json fle name
thats cuz he added a .example on it
yeah lol
because u stupid and pushed the config.json to git
remove the example. part
dumdum
wdym im stupid
its literally MEANT to be there
with placeholders
so it doesnt error like this
okay it finally started, what should I do know?
Can I make captcha system using python ?
probably
discord suddenly disconnected me
hi anything ?
I heard Python
you can make capacha even with Assembly
do you ever just randomly get logged out?
CAPTCHA WITH PYTHON? MAY I INTRODUCE YOU TO DASH
read the comments, but basically you just want to add commands onto the commands folder, or events onto the events
thats it
Dash?
yeah, i just did
Ok seriously though what are you using
dash based
Python
my 2fa is also enabled
nice
literally pain
captchas are so 2011 man
Pain though lol
I have my discord on my old phone so I keep that charged so I can log on
bakka autny ๐
yeah
I know but how can I make it work before join anyone on discord
yeah cool, I do not see any difference on the ram usage..
Server
Just use hcapacha instead
it'll feel better
It took me like a day to understand how to get my DataTable cells callback to actually fire
hcaptcha is the worst thing in the world
you SHOULD see ram difference, the reason for that is my dumbness. you should NOT use ts-node with the default configs to check that
you should use --trasnpileronly
ts-node keeps a cache of ur code in memory
better than recapacha
if you want that you have to make it so the only way to join your server is through your website
what should've been about 80-100mb, is prob using a bit more than that based on how many users ur bot has
no hcaptcha is fucking terrible user experience I'd rather do recaptcha over hcaptcha any day
Need a website?
what about it was so terrible for you?
But I saw some server ask captcha
hcaptcha has terrible images you can never know wtf you're looking at I always have to do multiple rounds
Before joining
hcaptcha doesn't let you test with localhost, you have to edit your hosts file to get it working
captcha is so annoying
so incredibly stupid
can we just remove it
well idk about implementing, i never used any
but solving them, hcaptcha never gave me issues
recaptcha often fucks me over, asks for three verifications in a row for no reason
specially if you use a privacy browser
and privacy addons
recaptcha goes crazy
yeah never first try because it gives you an image like this and asks you if there are any motorcycles in it
google chrome ยฏ_(ใ)_/ยฏ
and when you dont select it you get it wrong
i like when its a picture of something that could be the other thing.
like "click trucks"
shows a boat, and it thinks its a truck.
privacy addons tend to throw off abuse prevention yeah
yea mostly on Brave on Google search
there's quite a bit of fingerprinting involved to prevent automation/abuse so
they can have my cookies if I don't have to do any more captchas
ye i've had tons of issues with recaptcha on brave, it refuses to accept i got them right and keeps saying it failed
firefox with tracking protection probably fucks over a bunch of websites
Can anyone help me ๐
fuck me
ew no
@woeful pike do you know if i can add flags to tsnode in the args?
Erwin coming out I see

when ? where ? top or bottom ?
this tbh
isn't it the NODE_OPTIONS env var?
i think i might have to go with variables
no if you're using -r haha no I don't think so
fml
@pulsar spade you alright?
k bye i will help myself ๐
how the heck am i gonna do this then
TS_NODE_TRANSPILE_ONLY should be the flag
can i just run it in the tsconfigs, i wonder
or do i literally need to use env
wait, oh shit i can do that with ts-node-transpile-only?
aha
@tired panther
add /transpile-only flag
didnt need to fuck with the env's

Py vs js
why does your beta/test bot have 45k users
it worked without it
py vs js no fuck you i know both of them
this should greatly reduce it
even if its already lower than djs even with that flag off

I see
oh
One message removed from a suspended account.
ty
One message removed from a suspended account.
I spelt it wrong lol
How to call cats 101
Lmao
Jesus I keep finding errors the console says this part is an error can someone help me?
where do I put that?
wdym where u put that
i meant i cant tell you whats wrong without more context
post more code
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Oh shit
I got my two bot to work now
I fixed that part
still says theres a error
One message removed from a suspended account.
can you give context to line 36?
me?
also the keyword is "const [VAR_NAME] = [OBJECT]"
One message removed from a suspended account.
yes
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@earnest phoenix
One message removed from a suspended account.
One message removed from a suspended account.
const is only for defining a variable
One message removed from a suspended account.
...change it to const savedMsg = message.channel.send("You can't ban yourself bozo");
it wont log the message, just a promise
One message removed from a suspended account.
you need some mfing https://discord.js.org/#/
One message removed from a suspended account.
One message removed from a suspended account.
what's the error message
just send to code
One message removed from a suspended account.
i got a repl.it account, invite me to this goddamn repl
One message removed from a suspended account.
I DO that's the correct statement!!
alr
I'll have you know that [comical developer blabber]
is your user the same as your discord?
Yes
What the fuck 
I'm new to this shit
The how the christ do you have the bot developer role then
One message removed from a suspended account.
?
One message removed from a suspended account.
One message removed from a suspended account.
Alr
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
hi guys i'm new here
Hi
I have honestly lost too many brain cells from that 1 screenshot
How did you get the bot developer role do they give it to you when your bot get in or what do you have to do
One message removed from a suspended account.
One message removed from a suspended account.
Iโm not quite sure how the bot developer role works at this point...
And we thought Lan was bad
Maybe he used git clone ๐
Maybe
I think it would be pretty obvious if it were a copied bot though
what
idefk
Send the code?
...it isn't private, so...
https://replit.com/@jamessdsef/NumbAdequateJavadoc#index.js
Pretty sure to save a message like that you have to use async/await...
If you want to send text from a const, don't put "message.channel.send" there. Just do const cantBanYourself = "You can't ban yourself!", and in the message.channel.send do ${cantBanYourself}
pog finally someone who didnt leak their token on replit
Okay well thatโs why
You donโt have any curly braces
After your of statement
If*
pretty sure that's not what's happening
npm module discord-buttons wants to know your location...
[Allow] [Deny]
One message removed from a suspended account.
One message removed from a suspended account.
i will dm you the invite link
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
huh?
lol what
๐ your code structure entirely changed
One message removed from a suspended account.
One message removed from a suspended account.
i don't see it anywhere
One message removed from a suspended account.
One message removed from a suspended account.
๐
One message removed from a suspended account.
One message removed from a suspended account.
"target.role.add(const Discord = require("discord.js") [missing parenthesis]" ????????
One message removed from a suspended account.
One message removed from a suspended account.
nani
One message removed from a suspended account.
...vps?
you just create a repl and press the Run button
One message removed from a suspended account.
Ma'am I'm disappointed in you
One message removed from a suspended account.
not using repls for testing stuff smh
One message removed from a suspended account.
One message removed from a suspended account.
...create a repl, chiose the language, write the code, keep possible secrets, manage possible pr, check versioning, manage a team, write code, press run!
fucking start all over there was an error
One message removed from a suspended account.
Is anyone else having issues with editing embeds. It just says "Your message is empty"
The way I got around it was putting it in an object: {embed: embed}
Yeah the message.channel.send has the embed and then when you go to edit it, it says the message is empty when you try to put an embed
One message removed from a suspended account.
One message removed from a suspended account.
express bad
express gud
mfw muted for bad code
a lot of Maps in the code can slow the bot?
so what would you instead?
koa
raw http I guess
keep on getting this error,
Error: Could not locate the bindings file. Tried:
i only like express becuase i made a snarky name out of it for EXPRESSKCD (an express-based XKCD reader)
koa? more like... uhhh.........
uhhhhhhhhhhhh
delete node_modules , run install again.
One message removed from a suspended account.
One message removed from a suspended account.
koda or koa
One message removed from a suspended account.
One message removed from a suspended account.
Koa from what I hear is the successor to express.
Made by the same people just redesigned, so its probably a bit faster.
maybe Is the VPS
@flat copper You're trying to compare a Message with a Channel.
let channel = ... will be a channel, but .awaitMessages will be a Message.
Since you're trying to wait for user input (which will probably be the channel), it doesn't make to check the original message for a channel mention.
Instead, in the .awaitMessages filter, you should be filtering the content so it's from the user and that a channel was mentioned / found.
if(!channel.permissionsFor(client.user.id).has("EMBED_LINKS", "SEND_MESSAGES")) return message.channel.send({embed: {
title: "Invalid Permission",
description: `**I dont have permission to Send message and embed links**! ${channel}`,
color: "RANDOM"
}})
Why its not working?
Youโre trying to send an embed into a channel that you explicitly donโt have permissions to do so in...
^ ignore this Iโm stupid, didnโt see it was message.channel.send, thought it was just channel.send
Message.channel.send!
{embed: {
Wait ill show you my full cmd
no need to
as waffle said, you're basically doing this:
if (!cat.barks())
cat.bark();
you cant send an embed if you are not allowed to
you're trying to send an embed to say you cant send embeds
^^
What are you defining channel as
Does your bot give you an error?
Missing access
Make sure youโre sending the message into a channel that you have embed permissions in then.
Does mod log have the proper permissions for the bot to have embed access though-
Nope
Then thatโs your problem
Thats why I'm using this
also, can the bot see the channel?
missing access is normally thrown when the bot doesn't have read access to a channel/guild
Ooo ic
Is 80k cached users much from 500k ?
how many guilds
4k
80k is pretty excessive if cached in memory. I only have 46k cached on disk which spans over months.
i use discord.js but cache gets bigger :C
700 mb ram per day
well...it's discord.js after all
yea ik,djs-light didn't help at all since i need everything cached else the bot wouldn't work.




Lol
that's why
Why do you require cache?
I need channel,emoji,role cache for Bot Functions
how do I fix cache in discord.py
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
does someone know any great looking software documentation tool that supports MD files?
Something like vuepress or docasaurus but better looking
I don't think repl is ment as an hosting service
iterate over the guilds, get a channel and send a message?
Does top.gg follow Commonmark?
Also speak of the devil
Commonmark just released a new version after 2 years
oh cmon

@quartz kindle u awake rn?
need sum assitรฒncรช with sqlite
or reading a file, that is
actually, nvm, found this
pog /s
hmmmmm where do they store this shit

a bot that's sus
since when you get mini images for replies?
they boolin' me
if u clicked on it, you'd notice its emotes

Collection(1) [Map] {
'794885416821981206' => {
reason: 'haha lol\n',
user: User {
id: '794885416821981206',
system: null,
locale: null,
flags: [UserFlags],
username: 'EL TOะTOะ',
bot: false,
discriminator: '0006',
avatar: 'a_10de547e3c789873d3ae9eaa775fb599',
lastMessageID: null,
lastMessageChannelID: null
}
}
}
how to take the reason?
imagine you're acessing folders
. enters a folder/retrieve a value
so, you start root
root.reason
because reason is a property in the root of the object
root not defined
i know
that's why you don't simply copypaste what I write
root will be whatever you've defined as the variable
I do what so? sorry but I'm french and english I'm learning lol
oh
so
if I do root.reason?? xD
or if you're acessing the map directly, it'll be <getting the entry>.reason
root is an example
not to be taken literal
oh
for example, imagine that data is stored in a map called cheetos
cheetos["key"].reason
you don't know the key obviously
looks like the user id, so cheetos[user.id].reason
found
console.log(fetchBans.first().reason)
thx
but
the reason
is for any member?
I go test
an among us bot?
nitro giveaway bots intensifies
Use collection.get()
is there a way to monitor a folder in android for file changes?
@lyric mountain Idk how to add the rason with the content :/ :
client.on('message', async message => {
if (message.content === 'banlist') {
const fetchBans = await message.guild.fetchBans();
const bannedMembers = (await fetchBans).map((member) => member.user.tag).join("\n");
console.log(fetchBans.first().reason)
if (!bannedMembers) {
let msg = await message.channel.send("โ Aucun utilisateur n'est banni du serveur !");
}
const bin = await sourcebin.create(
[
{
content: bannedMembers,
language: 'text',
},
],
{
title: `Liste des bannissements du serveur => ${message.guild.name}`,
description: 'Synapse',
},
);
let button = new disbut.MessageButton()
.setStyle('url')
.setLabel('Cliquez ici !')
.setURL(bin.url);
let componentButton = new disbut.MessageActionRow()
.addComponent(button);
const embed = new Discord.MessageEmbed()
.setTitle(`Voici la liste des bannissements du serveur !`);
message.channel.send({component: componentButton, embed: embed})
}
});
I have several questions
I suggest you to learn a bit more about javascript itself
yes but
I found how to get the reason
but to do this,to example: name: the user | reason: the reason
just concat
how :/
Whenever I add new stuff to a data model file, how can I make it automatically add the new stuff to existing data?
you literally did what you want in the print I sent
const fetchBans = await message.guild.fetchBans();
const bannedMembers = (await fetchBans).map((member) => member.user.tag).join("\n");
console.log(fetchBans.first().reason)
the console.log is all reasons for banned users no?
please, learn js before attempting to make a bot
yeah, sure
not wanting to put you down or anything, but that's a fundamental problem you got there
"how to access an entry in a map" and "how to access a property in an object"
this shows a couple things:
You dont know how promises work
You dont how how function with promises works
You dont have a good idea of how async/await works
fetchBans never change when you do .map()
I have const fetchBans = await message.guild.fetchBans(); 2 certified (await fetchBans) bots before
its a non destructive filter
Gotta make sure you fetch it
you can never be too sure that you awaited it
await the console log too
you never know
const fetchBans = await message.guild.fetchBans();
const bannedMembers = (await fetchBans).map(async (member) => await member.user.tag).join("\n");
await console.log((await (await fetchBans).first()).reason)```
like this?

u broke the code tho ๐
Forgot await here
but i made sure to async the .map tho
but now it's an array of promises pensive
i wonder how many errors TS will screech at me for
oh, thats easy to fix
also you forgot to await "\n"
await promise.all
Promise.resolveAll(const fetchBans = await message.guild.fetchBans();
const bannedMembers = (await fetchBans).map(async (member) => await member.user.tag).join("\n");
await console.log((await (await fetchBans).first()).reason))```
done


gonna frame that work of art
You need more awaits
I still haven't made any progress with that await tool
ts-morph is shitty for doing AST modifications
i havent made any progress, with anything
procrastinationโข๏ธ
in fairness i got massive headaches
but still tho
productivity

how'd that rust thing go xet?
oh I didn't take a look at it

worked on this instead
https://dreamcatcher.xetera.dev/5EtGScU88k.mp4
thats pog
also, for the record
not nearly as many as i thought it would scream for
u using websockets for that realtime ?
ye
pretty pog ngl
ah there we go
uwu sockets pog
??
I was gonna do it in another language but typescript is just so fucking good I can't
sure did lmao
THANK YOU
im turkish
also that's just the icon for some page I have in notion
is that a chrome thing?
it's a pinned tab
oh
typescript is both the worst shit in the world and the best thing ever
worst because it doesn't provide any real safety and makes it easy af to shoot yourself in the foot but great because it works well most of the time
fighting typescript has to be some of the most infurating things to do in coding
specially when you're dealing with advanced types
I'm a seasoned typescript fighting veteran
i have my hammer right next to me in case of rages
I just wish elm had an ecosystem as good as typescript and supported server side rendering
I'd ditch TS in a heartbeat
never tried that, so i cant comment on it
it's really really good
Amateurs, fight against asm
might give it a check at the very least
When I joined NoRedInk in 2013, we had a typical Ruby on Rails web application. In 2015 we introduced Elm, a pure functional programming language for building Web UIs, and it spread like wildfire to become our primary tool for front-end programming. In 2019 we have over 300,000 lines of Elm code powering the user interface our millions of users ...
this guy is my favorite speaker
I can't help it I'm a huge simp
please just watch every talk this guy has
Among the most time-consuming bugs to track down are the ones where we look at our application state and say "this shouldnโt be possible."
We can use Elmโs compiler to rule out many of these bugs in the first placeโbut only if we design our Models using the right techniques! This talk explores how.
just use an actually typesafe language xd
at least watch this it's not as long as the first
not the monkeypatch trash that is ts
yeah elm will not let you deceive the compiler it's super solid
thats a good thing in my book tbh, being able to opt out of the typechecker
if you listen to the first presentation he talks about how their production codebase didn't encounter a single runtime error until 4 years in
me when i am unsafe { safeโข๏ธ }
in my experience if you're trying to deceive the elm compiler your approach is unsound
typescript is amazing, but if u use it correctly, you might be getting those levels of stability
specially in strict checks
ehhhh no
you can't
Hey:
When I do this:
const fetchBans = await message.guild.fetchBans();
const bannedMembers = (await fetchBans).map((member) => member.user.tag).join("\n")
const bannedMemberReason = (await fetchBans).map((member) => member.reason).join("\n")
console.log(bannedMembers + "===" + bannedMemberReason + "\n")
the console.log is:
user
user2 === reason for user
reason of user2
How to do:
user === reason for user
user2 === reason for user2
If you don't understand, rip lol
you can't get rid of any
that what meant
or unknown
yeah
export default function Page({ some, property, here }) {
return <div>...</div>
}
export function getServerSideProps(){
return {
props: {
some: 1,
property: 2,
here: 3,
}
}
}
there's simply no way to ensure type safety here
should that implcity be pulled from the function?
you can give them the same type, use a wrapper function for getServerSideProps and make it super neat, use eslint rules to make sure you check for consistency but at the end of the day typescript cannot check to make sure that those 2 types match
this would normally be implictly stated
you can give it a type, but giving it a type doesn't prevent you from passing something unrelated from getServerSideProps
because those 2 are not connected
hmmmm
and the values come from the javascript side of the world
i see what you mean
elm doesn't allow for stuff like that. It's both the language and the framework
that inconsistency is actually the reason why I broke production once lol. Working on making a generic wrapper for getServerSideProps but it's hard to cover every single case
not to mention you get completely magic props from things like [id].tsx in the filename
i see
so part of me is always worrying because typescript has so many escape hatches even though the type system is incredible
i've personally never got into a brickwall that i couldnt pass
even in cases like that, im usually stuck with using isntanceof
or something similar to properly pass the code
or merge union types
but thats about it
never actually found something i cant circumvent in ts
which is why i like it so much
I mean yeah but at that point you have to tell the compiler "dude just trust me I know what I'm doing" and you start out knowing what you're doing but that kind of turns into a lie after a while
15 commits later, you've introduced a new type to that "dude bro trust me my duder" variable and never checked because you continued to assume typescript will just let you know when something is unsound
"im pretty sure this returns this type, so just trust me"
exactly
I love the "if it compiles it works" concept but typescript is just not one of those languages
in all honesty, part of that is to blame for those who dont use mocha or jest to test stuff
its mostly in hobbists codes
though i get the point
it should have its own checks internally
well testing is mostly for behavior I think you need a type system to prevent you from allowing behavior that shouldn't be possible
"if it compiles it works"
without needing to rely on something else to check it for you
pls listen to the impossible state talk I linked pls pls pls
i will
this one right?
yes
added on the watchlist
it's elm but you're smart enough to understand what he's saying
as long as its not very specific terms specifically for that lang, i shuold be fine
is that something i have to watch
this is probably the most language specific terminology u see
or can i just listen to it like a podcast?
and that's just
function back(arg1: History): History;
function answer(arg1: string, arg2: History): History;
anyone has an idea why intellij is telling me this? all I could find on google was you can't use uppercase letters when searching for "property is not allowed" which isn't the case
is your file called package.json by any chance
no the file is called template.json
"testing is good, but impossible is better"
thats a neat approach to the problem tbh
watching it rn
that's why static typing is SO useful
he covered basically everything ive said this far with testing
and why having so many holes in the type system can ruin something that's meant to be an amazing reassurance
now i see why you so eagerly pointed to the link
@woeful pike so what he's doing is the equivalent of a private getter?
History.questions
but proposing using something similar in order not to break code
so you can have internals
yeah essentially it's private properties and public getters, nothing too revolutionary but I like this approach a lot more
hmmm i see
because there's nothing magical going on here
in OOP "private" is like a pretty magical thing
like what does it mean for a function to be private vs public
but in elm/haskell a private function is just something you don't export
i see
5 mins and its finished
lemme watch it till the end rq
that was a really good explanation
lowkey made me think about some stuff in my code i might wanna revise
cuz i do have some public libs
@woeful pikety for sharing that

what kind of bot should i make? ๐
idk
oooo nice
nah I can zoom in and read it
i'll make you take that statement back
both.
dm me it lmao
that's more if i can find the bot

but ye @slender thistle the new code rewrite looks nice
but damn whatโs the resolution on those
I do not know python but that looks cool
How my bot can announce when someone vote? JavaScript
the new code rewrite is strictly following the PEP-8 standards of Python
as well as following very closely to Discord API documentation
use a webhook
How can I do it?
Ok, I'll try
How can a colour code be an integer when hex colour codes include letters?
Then when I try and put it as a string it doesn't work
0x(hex)
It's not hexadecimal, it's decimal
Ohh thanks ๐
everything is hex if you try hard enough
did you read the setup part?
any ideas for what bot i should make? ๐ฐ
Do you have experience with any discord bot libraries already?
like, when dealing with buffetted bots there's probably only 1 person in the world that'll be able to help you debug stuff
but I'll ask once again, did you follow the setup steps EXACTLY as written?
@lyric mountain yes i did
There was typing if you using quick db copy and paste these and i did
But it saying 1 isnt positive
well, do you know at least where the error is happening?
run the bot in debug mode
and use breakpoints
all you can do is hope that the error happens very early in the code
Actually error is about winnerCount when i type there it works with no problem but it means winner count isnt replaceable
find where the error happens
in the code I mean
then show the code
without some code we're shooting in the dark
did you try with more than 1 winner?
run with debug mode
see what value is being passed
or just go the lazyman's route and add console.logs everywhere
use debug
I tried it
And there is typing on console 1 as winner count





