#development
1 messages · Page 1535 of 1
helo
Tbh
@quartz kindle u know?
`This server prefix is` + "`" + fetchprefix.prefix "`"
thats like logging bots that require you to have a channel named "logs", but worse
I would rather use + than escaping it
this is awful
why not properly explain to them how to do stuff?
const prefix = db.get(message.guild.id) || default_prefix
There. one line
yes
im not even going to bother looking at the code inside
What can't you return in js anyway
@opal plank that is explained here
what the fuck is this fucking shit
those variables need to be declared in a local scope, inside the same block
Help
this is ur famous ?
ikr
yes lul
macrohard onfire
a channel with that id was not found
since they are different
@opal plank and its the only working mongoose prefix module
actually, don't hardcode channel ids
but this is my index.js so where do i need to put them than? https://sourceb.in/0TEQjpXxCB
For js generators is these both the same thing?
function *generator() {
yield 5;
// OR
return { done: false, value: 5 };
}
its a 5 line code dude, why the heck would you make a package for that?
wat?
https://www.npmjs.com/search?q=discord prefix
compare here with others, are they better @opal plank ?
inside the setinterval
hardcode = write in the code
ok
like, instead of putting the id in the code, make it changeable
okay
with a command or db or whatever
thats the issue you dont get mesiter, there isnt a point in doing something that simple, its the same as is-undefined, its a package that, not only isnt good, but its too simple to be considered a avalid package
lol, bc noobs need help, When u do not provide them anything. They will come here and aske here lol
Mongodb?
you dont provide them anything?
any db u want
]
let them do the package they want lol
what do i define creatcanvas to?
const createCanvas??
but
its fine, but recommending this shit for people who dont know better? thats the issue i have
@tired panther at the very least remove the dependency on client.prefix
canvas
or cv
or anyvariablename
u mean mongoose?
no
you require the user to have client.prefix
if the user doesnt do that, your package wont work
thats not a good thing
the module saves the prefix in mongo db lol
i still couldn't figure out why sharding is executing twice
i've explained here quite a few times for new people how to set their own prefixes
but that is really dumb to load 4k prefix, when just 1000 would run the command
const killCanvas
it doesn't work like that
what?
createCanvas is a property of canvas
its { createCanvas } = require("canvas")
lol, yes true, wait editing it xD
{ createCanvas } = require("canvas") or createCanvas = require("canvas").createCanvas
@quartz kindle any idea why shards are executing twice?
when u have 4000 guilds and you load all info, that is not worth it. WHen just 1k servers would need the commands.
not without seeing code
this hurts
const { ShardingManager } = require("discord.js");
const { logger } = require("../public/static/js/logger");
process.on("unhandledRejection", (error, promise) => {
console.log(
"Oh Lord! We forgot to handle a promise rejection here: ",
promise
);
console.log("The error was: ", error);
logger.error("UnhandledRejection: " + error.stack);
});
process.on("uncaughtException", (error) => {
console.log("Oh my god, something terrible happened: ", error);
logger.error("BOT SHARD CRASHED, FATAL ERROR: " + error.stack);
// process.exit(1);
});
const manager = new ShardingManager("./server/client.js", {
totalShards: 2,
token: process.env.DISCORD_TEST_BOT
// token: process.env.DISCORD_BOT_TOKEN
});
manager.spawn();
manager.on("shardCreate", shard => console.log(`Shard #${shard.id} is Online`));```
well this is all the code
if i set totalShards to "auto"
it still executes twice
the commands and stuff
dont use client at all. store prefix data inside the package itself
double commands
do you have 2 instances running?
packages and modules should be self-contained and not interfere with other packages
what the heck are you even talking about?
thats what the shards will probably do
about your prefix loading on start
why would you fetch it every time?
what do i define it to?
its absolutely retarded to do fetch requests on every message
specially with databases that arent local
storing prefix in memory is negligible actually
not only will they increase your bot response time but it'll also spam your db with requests
they are all strings
theres NO reason NOT to store them in memory
be it 4k, or 400k
use redis
show the code for client.js
if you really fancy ram
or sqlite if you don't want to use ram
the linting is bad, the coding is bad, and the premise behind the code is bad
also doesnt help beggingers learn how to deal with a db, just creates dependency and not writing stuff for themselves
i checked a couple days ago after we talked Tim
redis has memory optimization and compression
the same map on js uses more ram than redis
storing prefix in js is better 100% of the time
the same way you dont want to spam your db with requests, you also dont want to spam redis with requests
yeah, though if memory is an issue, redis is an option, and a good one at that
when it makes you happier, okay be happy, then do not use my code. Thoose who want it can use them.
well yeah
how much memory is a map with 4 million entries?
lets see
lets check
const clientEvents = require("./app");
const express = require("express");
const Topgg = require("@top-gg/sdk");
const server = express();
const webhook = new Topgg.Webhook("izziwebhookauth");
process.on("unhandledRejection", (error, promise) => {
console.log(
"Oh Lord! We forgot to handle a promise rejection here: ",
promise
);
console.log("The error was: ", error);
logger.error("UnhandledRejection: " + error.stack);
});
process.on("uncaughtException", (error) => {
console.log("Oh my god, something terrible happened: ", error);
logger.error("BOT CRASHED, FATAL ERROR: " + error.stack);
// process.exit(1);
});
const discord = require("discord.js"),
client = new discord.Client({
partials: ["MESSAGE", "REACTION", "CHANNEL"],
});
server.post("/dblwebhook-secret", webhook.middleware(), async (req, res) => {
const voter = client.users.cache.get(req.vote.user);
const createDM = await voter.createDM();
res.status(200);
});
server.listen(5000, () => {
console.log("listening for webhook on port 5000");
});
client.on("ready", async () => {
client.user.setPresence({
activity: {
name: `iz help | alpha v2.8.0`,
type: "LISTENING",
},
});
});
// const cluster = new Cluster();
// cluster.createJob("client", clientEvents, client);
// cluster.queueJobs("client");
// cluster.initWorker();
clientEvents(client);
// client.login(process.env.DISCORD_BOT_TOKEN);
client.login(process.env.DISCORD_TEST_BOT);
most prefixes will be 2-char length, so somewhere about 8 bytes
this my client.js
depends on what type the entries are
also app.js has the commands
Map<"guildID", "prefix">
8 * 4000000 = 32000000 bytes, or 31250 kb, or 30 mb
note that I'm considering only string bytes
an array with 4 million times "a" increased rss by about 30mb
arrays do be slow
@quartz kindle
only some operations
case 'kill':
const { createCanvas, loadImage } = require("canvas")
var imageW = 600;
var imageH = 600;
const killCanvas = createCanvas(imageW, imageH);
const ctx = killCanvas.getContext("2d");
var secondMemberPP = await loadImage(message.author.displayAvatarURL({format: "png"}))
ctx.drawImage(secondMemberPP, 0,0, imageW, imageH);
var amongKill = await loadImage("https://i.imgur.com/g1cdZ9U.png")
ctx.drawImage(amongKill, 0, 100, imageW, imageH);
const attachment = new Discord.MessageAttachment(killCanvas.toBuffer(), 'kill.png');
const killf = new Discord.MessageEmbed()
.attachFiles(attachment)
.setImage("attachment://kill.png")
.setColor("RED")
message.channel.send(killf)
break;
sends
wat
that many bytes
a find() on an array is slow, no?
256 mb
how can i do that the background will be the coin?
by all means this is not a proper test, but a close and cheesy one
let mem = process.memoryUsage().rss;
let s = new Map();
for (let i = 0; i < 4000000; i++) s.set(i, i.toString());
let mem2 = process.memoryUsage().rss;
console.log(mem2 - mem);
you draw the image before everything else
do the check before putting anything in the map
that should run fast enough where it shouldnt be taking into account the other ram
yes
yea
to see map memo usage
@quartz kindle ?
so arrays kinda slow
so we can subtract it from total
lul dude's comparing an is-undefined to an api wrapper
https://github.com/top-gg/node-sdk/pull/28 @tired panther
that was a fork
if you are too dumb to check the commit changes
before topgg moved from dbl-api to node-sdk
why?
@quartz kindle ??
the stuff you eat with
correct
he's clearly mad now and just digging on my repos to find something to try to bite back at me
I want to end the Discussion here and now
Its very unfriendly from you to critize small devs and laugh about them
You broke rule 4 lol.
jesus
🍴 🤣
you didn't say what is it
you're the one recommending bad stuff to new devs my dude
up
shards are causing double commands
tim wanted to take a look at the client.js file
but he gone now
aren't u starting it twice with the same shard id?
but yes, its a good thing that you're focusing on rules and trying to dig on my repos rather than trying to defend your librabry
I wanted to see how may shards he have lol
but its spinning up twice
u begun lol
code from scratch lol
so double commands
require("dotenv").config({ path: __dirname + "/../../setup/.env" });
const clientEvents = require("./app");
const express = require("express");
const Topgg = require("@top-gg/sdk");
const server = express();
const webhook = new Topgg.Webhook("izziwebhookauth");
process.on("unhandledRejection", (error, promise) => {
console.log(
"Oh Lord! We forgot to handle a promise rejection here: ",
promise
);
console.log("The error was: ", error);
logger.error("UnhandledRejection: " + error.stack);
});
process.on("uncaughtException", (error) => {
console.log("Oh my god, something terrible happened: ", error);
logger.error("BOT CRASHED, FATAL ERROR: " + error.stack);
// process.exit(1);
});
const discord = require("discord.js"),
client = new discord.Client({
partials: ["MESSAGE", "REACTION", "CHANNEL"],
});
server.post("/dblwebhook-secret", webhook.middleware(), async (req, res) => {
const voter = client.users.cache.get(req.vote.user);
const createDM = await voter.createDM();
res.status(200);
});
server.listen(5000, () => {
console.log("listening for webhook on port 5000");
});
client.on("ready", async () => {
client.user.setPresence({
activity: {
name: iz help | alpha v2.8.0`,
type: "LISTENING",
},
});
});
// const cluster = new Cluster();
// cluster.createJob("client", clientEvents, client);
// cluster.queueJobs("client");
// cluster.initWorker();
clientEvents(client);
// client.login(process.env.DISCORD_BOT_TOKEN);
client.login(process.env.DISCORD_TEST_BOT);
just so I can read it better
so you recommended your bad lib to them when you could've told them to eval client.shard or simply console log it?
i dont understand half of your code, but for starters you're listening to port 5000 in a shard, which should immediately throw EADDR port already in use
yeah, because the shard is trying to execute everything twice
so even the commands are being doubled
it will give him the ram, the ping, the cpu in once 🤭
and if you shut it down
and run the command again
any response?
to rule out any ghost process
well nop
because the shard for some reason still running in the background
1 shard stops
but the other is still running
ghost process then
what for? that has aboslutely nothing to do what you said, nor with what they asked
shutdown all processes
the addr 5000 port stops
of course it stops
but my question is why is it even spinning twice?
you said this, how does ram and cpu have ANYTHING to do, with not only this, but with their problem?
nothing xD
executing twice?
because your code is broken
like my bot is listening twice for commands
fixing your code will eventually fix the problem
something is wrong with this code
so you're just blatently advertising your lib for shits and giggles? gotcha
dont listen to the same port
nope xD, okay sorry queen it was my fault lol
then add stuff back one by one
because something in your code is breakig everything
so remove it
and start with a barebones
to confirm its working
i removed the addr
i made that
case 'kill':
const { createCanvas, loadImage } = require("canvas")
var imageW = 600;
var imageH = 600;
const killCanvas = createCanvas(imageW, imageH);
const ctx = killCanvas.getContext("2d");
var amongKill = await loadImage("https://i.imgur.com/g1cdZ9U.png")
ctx.drawImage(amongKill, 0, 0, imageW, imageH);
var imageW2 = 250;
var imageH2 = 250;
var secondMemberPP = await loadImage(message.author.displayAvatarURL({format: "gif", dynamic: true}))
ctx.drawImage(secondMemberPP, 175,170, imageW2, imageH2);
const attachment = new Discord.MessageAttachment(killCanvas.toBuffer(), 'kill.gif');
const killf = new Discord.MessageEmbed()
.attachFiles(attachment)
.setImage("attachment://kill.gif")
.setColor("RED")
message.channel.send(killf)
break;
sends
how can i make it to move like the pfp
that's dealing with gif
ik
which might be quite hard and confuse unless you're familiar with image manipulation
@crystal wigeon I can give u the barebone code xD
i changed the all thing to gif tho
wait download it from git discordjs guide
the format
you see, you need to render each for EVERY frame of the gif, then pack everything together again
and attachment
changin only the format will not do anything
no difference
basically: unpack -> render every frame -> pack
else you'll have a single-frame gif
@quartz kindle
so how do i do that?
do you see "bot ready" twice? this is literally plain file
?
just basic client.login
gifs aren't easy nor straightforward
const discord = require("discord.js"),
client = new discord.Client({
partials: ["MESSAGE", "REACTION", "CHANNEL"],
});
client.on("ready", () => {
console.log("bot ready")
})
client.login(process.env.DISCORD_TEST_BOT)```
this it
thats normal
not in this case lol
wait really?
ok so
client.once() will still log twice for two shards
i thought it was meant to only trigger once
yeah and my commands are getting executed twice for 2 shards
PER?
per process
gotcha
or rather
so how do i add commands now then?
per instance of the client
2 shards mean the server count will be divided by 2
show your command handler
each half to a shard
no I tried today my test bot, started it on 4 shards on totaly 6 guilds. Then the command has been outputted twice
4 shards: ok
output twice: creating the client twice
tim check DM if you dont mind
first do this
if shards were the issue you'd get 4 replies instead of 2
how many guilds is your bot in?
got three replies
yes
multiple instances
thats the problem
what does handle.status do?
first do this: how many guilds is your bot on?
you can ask @Not Erwin#8753 she is a expert on my code. It gives all status of each shard, something for my npm libary
are you really mad at her pointing that your libs arent useful?
people used it, thats way the argument seems to not be correct lol
Poor Erwin turned into a girl from all the beer he stole from me
250 cap, discord still hasn't verified yet
im officially a chick now, apparently lmao
ok so in your client code, console.log(client.guilds.cache.size) in a ready event
and show the results
250
yeah but, if I make an is-true lib people will still use it
because people
show the cmd showing the results
do , yes Ik, but when the people come to you and say "That helped me to learn data storing" that is something different. As just downloading it.
how would a lib teach about data storing?
What lib is even being argued this time
What does this refers to, in a static method of an abstract class in js? The global?
map storing xD
dot dot dot
no need to no ask erwin, he will say its a shit of peace, now u no it
thats the exactl issue, its not teaching anyone how to learn anything, you just trying to spoonfeed(and a bad one at that) them so they have something ready to use
either the function itself or global/window i believe
const discord = require("discord.js"),
client = new discord.Client({
partials: ["MESSAGE", "REACTION", "CHANNEL"],
});
client.on("ready", () => {
console.log("bot ready", client.guilds.cache.size)
})
client.login(process.env.DISCORD_BOT_TOKEN)```
Nice, avoided my question
shivaco feels
xD, When you are feeling so interested just check my repos
alright see? the sharding is working correctly
roughly half the guilds on each shard
yeah so what changes do i need to do for my commands?
#development message past this point, read mine and meister msgs
do some basic command
like why are my commands being execuited by both shards
like client.on("message", message => { if(message.content === ".ping") message.reply("pong") })
better yet, make the bot send the shard id
if each shard is executing it, both commands will have a different id sent
sure
why i get this error? https://sourceb.in/kwLjVGQQSF
Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
is the value manager.spawn(value) 2?
even when both shards are online
me neither
how to ddos a bot
Glad I rolled with Python because at least people make sense in that community
ok, so we confirm that everything is working properly
now add your bot code back, by pieces
see which piece causes the mess
ok so i'll try my best to explain my handler, so first i search for commands from a diff file and then execute that function which is in another file
can you show code?
turns out js won the "we have a lib for that" contest
I just quoted they guy what he told. I do not want to defend my libary. Its not good I know. But its better than nothing. ANd everyone have to take their own decision. A Pro Dev like you would never need my libary.( @opal plank )
I want to ask why the invite in the analytic page is decreased, yesterday is 24, in the morning is 23, now is 22?
it's not constant
please, explain in a concise way, WHY would you publish something purposefully bad at npm with the idea of NOOBS using it?
like, as everything else in the market
If you're gonna babysit people on shit they don't even need help with, I suggest getting counseling
sorry i readed it but i dont get it where on my site can i fix it or do i need the mongodb compass
It is the total invite, not daily
they use it. Someone asked me if I could code something from him. It was to much work for me ==> thats way the libary is not so good
I just had a stroke trying to read that
once again, WHY PUBLISH it?
no go to mongo db atlas and log in
if you coded that for someone, why not send them?
he wanted a npm libary, when new features come 🤷♂️
People use useless shit because they are lazy and don't want to learn
why do you publish a purposefully bad package for the general people to use?
this
okay i did
addnewdatabase user
or edit the existing one
will work too
one sec
ok
but i already added my own ip
you could whitelist all ips
add 0.0.0.0/0
bad idea lol
where? bcz i cant find where toadd
its only to store prefixes so its goof idea lol
"only"
well you do you
when u have 37 character password, its safe enough for testing
depends on password entropy
1234567890.... is not the best pass
sometimes a 10-char pass can be harder to crack than a 100-char one
tested it , the site tells 2 mio years to hack it from a normal computer
@opal plank btw, 4 million Map entries with a key roughly the size of a guild id and a 1 letter value took 400mb ram
no its not its LuckieDiscord1313
wait, xkcd has a meme for that
maybe I change it to
erwindoesnotlikeme
they I will never forgot her/him
im just kidding lol
thats quite a bit ngl
here, xkcd
lol
still, if you have 4 million guilds, prefix is gonna be the least of your problems
absolutely correct
and no way in hell you're gonna have 4 million guilds in the same process
2500 maximum
imagine 4k shards
lol, rhtym has 13 000 000 glds
erwin has ptsd from twitch
note "same process"
so @quartz kindle , i have the dbl think also which needs client to get the users, so shards kinda crashes when addr is already in use
yes yes
i cant move the dbl server outside of client
never forgetti the day erwin ddos'ed twitch by mistake with 1200+ shards https://cdn.discordapp.com/attachments/655288842433200129/768138727989313596/unknown.png
thats the problem with sharding, you can start a second bot, which listens to it
limit it to shard 0
and what did they do to you? no ban
of course not, im already verified on twitch

if(client.shard.ids.includes(0)) {
dbl code here
}
thanks a lot!! will try it out
my bot got verification on twitch before it did on discord
even though it started as a discord bot
twitch knows youll ddos them if they dont verify
lol
i explicitly stated i was testing my twitch library
and that was my own sharder
there isnt a twitch wrapper available with caching nor sharding
l.t learn first
this means any twitch bot you ever try to make will start to fail at around 150-200 channels
i stll need to finish this goddamned lib
finally tim is coming to the dark side of developing

Do you both do jobs as dev? or are u just hobby dev?
soon™️
i do have a job
what library?
declarations are easy, i can make it fancy too
#include <sweph.h>
static std::vector<std::pair<int, std::string>> args = {
{ 4, "Expecting 4 arguments: tjd_ut, geolat, geolon, hsys" },
{ number, "Argument 1 should be a number - julian day in universal time" },
{ number, "Argument 2 should be a number - geographic latitude in degrees" },
{ number, "Argument 3 should be a number - geographic longitude in degrees" },
{ string, "Argument 4 should be a string - house system ID" }
};
Napi::Value sweph_houses(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
if(!sweph_type_check(args, info)) {
return env.Null();
}
double cusps [37];
double points [10];
char sys = info[3].As<Napi::String>().Utf8Value()[0];
int flag = swe_houses(
info[0].As<Napi::Number>().DoubleValue(),
info[1].As<Napi::Number>().DoubleValue(),
info[2].As<Napi::Number>().DoubleValue(),
int(sys),
cusps,
points
);
Napi::Array c1 = Napi::Array::New(env);
Napi::Array p1 = Napi::Array::New(env);
for(int i = 1; i < (sys == 'G' ? 37 : 13); i++) {
c1[i] = Napi::Number::New(env, cusps[i]);
}
for(int i = 0; i < 8; i++) {
p1[i] = Napi::Number::New(env, points[i]);
}
Napi::Object data = Napi::Object::New(env);
data["houses"] = c1;
data["points"] = p1;
Napi::Object obj = Napi::Object::New(env);
obj["flag"] = flag;
obj["data"] = data;
return obj;
}
``` this is one of the 90 functions
you basically just need this
i cant assure integrity though tim, i might put one or two Raid Shadow Legend ads in the docs though 
obj["flag"] = flag;
obj["data"] = data;
return obj; ```
timotej roiko
which means, a js object with a flag field and a data field
your name is rojko tho
and the data field is another js object
https://cdn.discordapp.com/attachments/272764566411149314/787763404978258010/HM91heWRV7.gif im 100% doing this on the docs btw
thats my username since 2003
yes
raid would be one hell of a movie
i have a question
since react elements are just objects is it possible to save an element to a variable and modify it later?
i have a pen
i have an apple
applepen
I have a doctor
use ref
He is absolutely mortified of the apple
owo what's this
\👀
but yes, you can save them as objects
for example, you can set a ref to a canvas tag then draw on it directly on the code
stupid c++ doesnt have array conversions
so i have to do this everywhere
Napi::Array asc1 = Napi::Array::New(env);
Napi::Array dsc1 = Napi::Array::New(env);
Napi::Array per1 = Napi::Array::New(env);
Napi::Array aph1 = Napi::Array::New(env);
for(int i = 0; i < 6; i++) {
asc1[i] = Napi::Number::New(env, asc[i]);
}
for(int i = 0; i < 6; i++) {
dsc1[i] = Napi::Number::New(env, dsc[i]);
}
for(int i = 0; i < 6; i++) {
per1[i] = Napi::Number::New(env, per[i]);
}
for(int i = 0; i < 6; i++) {
aph1[i] = Napi::Number::New(env, aph[i]);
}
define array convertions
wait what
you can do that?
basically remapping a double array to a js array
i thought you were doing asc[i] = Napi::Number::New(env, asc[i]);
@lyric mountain ok
was about to ask how the fuck you getting element before declaration
xD
sneeeky 1
this is the full thing (well not the full thing but the gist of it)
double asc [6];
double dsc [6];
double per [6];
double aph [6];
char serr [SE_MAX_STNAME];
int flag = swe_nod_aps_ut(
info[0].As<Napi::Number>().DoubleValue(),
info[1].As<Napi::Number>().Int32Value(),
info[2].As<Napi::Number>().Int32Value(),
info[3].As<Napi::Number>().Int32Value(),
asc,
dsc,
per,
aph,
serr
);
Napi::Array asc1 = Napi::Array::New(env);
Napi::Array dsc1 = Napi::Array::New(env);
Napi::Array per1 = Napi::Array::New(env);
Napi::Array aph1 = Napi::Array::New(env);
for(int i = 0; i < 6; i++) {
asc1[i] = Napi::Number::New(env, asc[i]);
}
for(int i = 0; i < 6; i++) {
dsc1[i] = Napi::Number::New(env, dsc[i]);
}
for(int i = 0; i < 6; i++) {
per1[i] = Napi::Number::New(env, per[i]);
}
for(int i = 0; i < 6; i++) {
aph1[i] = Napi::Number::New(env, aph[i]);
}
ugly af init?
I strongly hope I'll never have to do CPP
i will have to do it
Come here, let me give you a hug
i know a bit of it, cuz i've used some hacky code in the past, but im a complete noob
variable
double the bytes of a float

oh i see
double precision float
specially cuz i need to make my own app soon, so i might wanna get into cpp
im making minecraft commands generator for bedrock so my nooby friends dont have to pull their hair out
like, cpp is ugly? yeah it is
but is it easy? no
as soon as im done with this genshin bot i'll hop into cpp
gotta learn cpp, rust and then frontend
this lib is so annoying because it has a bunch of functions with multiple outputs, so you have arguments for input, then reference arguments for outputs, plus the return value of the function
js is ugly? nope
js is easy? yep
imagine if you had to do this in js
API devs hate you, with this one little trick
imagine not having consistent outputs

let result;
something(input,result);
console.log(result)
would be eezi peezi
more specifically
two things I hate about cpp is how it use pointers and how arrays are read-only
this sounds like a true hell
arrays are read only? 🤮
i might need to cast it in code
let result;
let error;
let status = something(input, result, error);
if(error) throw new Error(error);
return { status, result }
``` thats basically how these cpp functions work
theres std::vector which is basically normal arrays in any other lib
but normal arrays in cpp are...weird
function test(input, result) {
result = input++
}
test(input:any, result:any) => result as [output]
That might do the trick, but holy shit thats a dumb way to do it
when tim adds a comma for no reason smth's off
case 'coin':
const { createCanvas, loadImage } = require("canvas")
var imageW = 600;
var imageH = 600;
const killCanvas = createCanvas(imageW, imageH);
const ctx = killCanvas.getContext("2d");
var amongKill = await loadImage("https://i.imgur.com/g1cdZ9U.png")
ctx.drawImage(amongKill, 0, 0, imageW, imageH);
var imageW2 = 250;
var imageH2 = 250;
var secondMemberPP = await loadImage(message.author.displayAvatarURL({format: "png", dynamic: true}))
ctx.drawImage(secondMemberPP, 175,170, imageW2, imageH2);
const attachment = new Discord.MessageAttachment(killCanvas.toBuffer(), 'kill.png');
const killf = new Discord.MessageEmbed()
.attachFiles(attachment)
.setImage("attachment://kill.png")
.setColor("RED")
if(!args[1]) return message.channel.send(killf)
const opponentcoin = message.mentions.users.first();
if ( !opponentcoin ) {
var imageW3 = 600;
var imageH3 = 600;
const killCanvas2 = createCanvas(imageW3, imageH3);
const ctx2 = killCanvas2.getContext("2d");
var amongKill2 = await loadImage("https://i.imgur.com/g1cdZ9U.png")
ctx2.drawImage(amongKill2, 0, 0, imageW3, imageH3);
var imageW4 = 250;
var imageH4 = 250;
var secondMemberPP2 = await loadImage(opponentcoin.displayAvatarURL({format: "png", dynamic: true}))
ctx2.drawImage(secondMemberPP2, 175,170, imageW4, imageH4);
const attachment2 = new Discord.MessageAttachment(killCanvas2.toBuffer(), 'kill.png');
const killf2 = new Discord.MessageEmbed()
.attachFiles(attachment2)
.setImage("attachment://kill.png")
.setColor("RED")
message.channel.send(killf2)
}
break;
works if i dont mention, if i do, it returns the error that displayAvatarURL is undefined
stop using var
E
let \👼
worry not, the js side doesnt have any of that bs
oh thank god
cpp bs stays in cpp
🙏
the js side will just output { status, error, result } as an object
and let the user handle the error
oh, then its fine
but one punch and you're dead
i have to type check every single argument
some functions have like 7 arguments
or more
my complexity is QUITE high too
cuz of shit like that
complexity up the roof
my genshin bot estimated at 400k
xD

jesus christ
im currently reworking all of the 90 functions
so i can stop doing this bs
if(info.Length() < 6) {
Napi::TypeError::New(env, "Expecting 6 arguments").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[0].IsNumber()) {
Napi::TypeError::New(env, "Argument 1 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[1].IsNumber()) {
Napi::TypeError::New(env, "Argument 2 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[2].IsNumber()) {
Napi::TypeError::New(env, "Argument 3 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[3].IsNumber()) {
Napi::TypeError::New(env, "Argument 4 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[4].IsNumber()) {
Napi::TypeError::New(env, "Argument 5 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
if(!info[5].IsNumber()) {
Napi::TypeError::New(env, "Argument 6 should be a number").ThrowAsJavaScriptException();
return env.Null();
}
wait, how do u get those info?
scc
i tweaked it a little bit, but you should be able to get similar info with it
I have no idea, what to could at next, after erwin Critics. I will not create a npm libary. Any Idea what you would suggest?
scheme2c?
learn lib-dev common rules
it's not that ur lib is bad, it's just that it's really unnecessary
what i got mad wasnt about doing bad code mesiter, @crimson vapor can tell you the same thing i told em, i dont want to disencourage you to code, but i do highly disagree with publishing bad packages. Npm is a mess polluted with bad libs, adding more is not contributing whatsoever. By all means, please, DO code, but do not publish it if you dont intent to put effort into it
the usually guides i follow are:
does it exist? no => make one
yes => is mine better or a competitor for the other ones?:
no => dont make it
yes=> make it
I agree
i disagree with the first one
that's marketing guide
mine mongo db prefix was better than the others, thats way I published it
does isFourteen exist? no? make one
lol "mesiter" , meister xD
better, maybe, but not good
and thats another key
https://github.com/erwin1234777/teyvatdev-node-sdk take a look at my readme vs the one you posted
not that the mongo db prefix
that was just for me lol
then theres no reason for it to be on npm
npm is public, and you can install directly from github, just give your friend access to your repo
theres absolutely no need whatsoever for it to be on npm
if your repo is public, you dont need any special access or permission
that too
Imagine including compiled javascript in a ts repo though
replit fucked up and i lost the entire contents of a biggo file :(
npm install meister03/discord-error-handler

i explained why
im NOT forcing my users to transpile their code
js users should NOT be required to use ts to transpile shit for themselves
holy fuck
agreed
you put the compiled js on npm, typescript on github
uwu napi
guess I have a million-dollar project on hands
it does, but then it just stays native
holy
are u working w that rust shit
i'd rather bundle
is it possible to get back
let me download that
when people see the table, they get confused. I wanted to make something all people can understand. Naturally , I can use constructurs etc., but this will not help people. This will consfuse them. The key of my Idea was not to reach people like you, they can make their own ones. Just people which have to less experience.
have /lib be send as well as /dist with the transpiled code
i would much rather incentive you to publish a guide rather than a pre-made package
like @umbral zealot with his guides
your is a patch
its just spoonfeeding a user
that teaches them nothing, other than create a dependncy on ur lib
"His"
but it just makes things messy, nobody benefits from the transpiled code being on github as well. It's not like people who don't know typescript can contribute, because then the codebases won't be in sync
howcome? dev is ONLY done in ts, not js, contributions are to be used in ts
the js is always up to the ts cuz they are transpiled before being published
wait
if i were to merge someoens commit i'd transpile it after they changed the ts files
does scc include node_modules?
the js there is only transpiled ready for usage, not to be changed in commits
okay maybe next time. I can unterstand you to 100% there are some devs, which just feeds the spoonfeeds and some which learn from code snippets. When they want to be a real dev. They will naturally check the code behind xD.
do you check the code behind Math lib?
thats the issue, any "real dev" wouldnt even go on that lib, and in the offchance they check the code, they'll likely have a reaction similar to mine
I checked some libaries like djs. but I did not check math lib
I would be happy to have something than nothing. You have to weigh up xD
then why not do something productive and teach them how to use a basic database?
your lib is quite small, tis one file, why not convert that into a guide snippet like discord js guide?
I am missing on channels to provide them help
how come?
npm was the only channel to comunicate with my end users. all starter dev will go to a big server and they will provide them nearly no help xD.
when they are able to use them
why not simply add it on the readme?
with tons of fruits being sold
lol
or link a guide right at the beggining
There's no point to include the compiled javascript in the github repo, and the typescript files in the npm package. If you want to get the compiled code and use it, use npm, if you want to contribute to the package, clone the repository and make changes to the typescript files
exchange it for a tesla
lol
77k $, how does come on so much?
imagine using light mode terminal
and how do they calculate it?
complexity
i get what you're saying, though a lot of libs do exactly that with with /lib and /dist, though in some cases they include only /lib with the -dev version. However in this case its a single index file included. The ONLY benefit i see from separating them would be to lower the package size, which would remove 1 folder and 1 file inside of it
@quartz kindle could u check https://github.com/meister03/mongodb-reaction-role
oh no whole code
maybe the output is 0,00000001 $ xD
I mean, not the source code, just the "whole code" part of readme
that's dangerous
and copy-ready
Personally I've never seen a github repo include both the compiled code and the source code (except for yours), and yeah in this particular case it's not a big deal, but imagine you had a way bigger codebase
i could take that in consideration, there hasnt been a refactor yet
this would be the refactored code
hehe, mine is still at 400K
what do u need to run scc ?
my bot
that json isnt from the package depencies btw, i do have json stored locally
how to ignore?
--exclude-dir dir1 dir2 dir3
what, that does not makes any sense djs-light just required 0,7 worker , erwin requires 2 workers lol
oh nice
i removed the api portion of the bot tho
where?
what workers?
you mean people required?
mine actually only took 2 ish months to be done
wdym typings
lol
same xD
lmao
if you run scc on a no-code folder it'll say "People required: 1 Grandparent"
LOL
lul
lel
i work the same as 4 people combined, and 4x faster
does djs have slash commands yet?
since i worked solo and used 2 months
https://cdn.discordapp.com/attachments/272764566411149314/801094221217792020/cmd_SqDwEZQrQZ.png
not yet,they will ad it on v13
lmao
I don't comment at all lul
and you somehow managed to get higher complexity than mine
game frameworks
congratulations, i was already being ostricized for having 1k
do you have third party source files?
so you wrote 471 files all by yourself?
third-party is stored at gradle file
impressive
most models, frameworks, utils, controllers, etc
and commands ofc
lul
--exclude-tim
no pls
gimme one good reason why not to
i wonder if you can do multiples
multiples?
--exclude-* --include-Tim
wanna scc your entire projects folder?
me?
my stuff is all split around and disorganized lmao
shotgun project model
yup
xDD
beat that scrubs
lul
my projects folder is 7gb
what's Handlebars?
and includes a shit ton of random non-code stuff
an html framework i think
sendGrid iirc
ah
your bot?
Yeah
nice complexity
there she goes to count it
lemme see my lib
does scc exclude node_modules by default?
dont think so, no
Wait a minute, what package does that scc command belong to?
^^
non-complex lib
@lyric mountain what happens when u try just console.log("hello") ?
hahah 12k, smol boi
it'll print hello
u need a linux server or the homebrew thing 😭
no you dont
half of that is benchmarks code
I mean scc
im running it on windows
and that pricing is unrealistic af
and u have go/homebrew
shhhh
if i were to code this lib for someone, i would be paid like 500 bucks
i do not
that's undervalued af
thats reality
lol, indian devs would create code for less money lol
how did u installed it?
lol
how much i wish i was paid 10k for a small lib like this
bot + dashboard, I don't know where the python came from
ah , I do not have to download it?
probably taking dependencies
of course you do
I did --exclude-dir node_modules
is there any other dependencies inside?
oh yeah there is one
dashboard maybe?
and then I can run scc?
blockly
you dont run it by itself, you need to run with bash
this is like a one year old project I forgot everything about it rip
yes I have powershell open
is it bad if SCC is taking long?
that explains why tis big
it means you're making millions in value
probably, i did that on sys32 folder and it took roughly aminute
thats 100% taking module folder
lol
exclude node_modules lul
with C files
did you exclude the node_modules folder
lul
nah its this high mostly bcs of the Tensorflow Module i guess
--exclude-dir node_modules
if you have a .gitignore file in the folder where you run the command, it will auto pick it up and ignore everything in it
really?
^^
oo
Can you gitignore gitignore?
nah, you can create a shortcut for trash bin and then put the original inside of it
that'd create a singularity
now the bot is worth 56$
imagine gitignoring your source code except the modules folder
56 mil or 56 dollars? 
56k likely
56$
56 dollars?
lul
I downloaded the repo, what do I do at next @opal plank ?
true devs push their node_modules to their github repo
you dont download the repo

you download frmo their release page
so
that's 56k
56k
thats 56k my dud
lmao
are you sure?
bcs for me would be 65k if it would be spaced with a . not a ,

the --exclude-dir flag doesn't work
it works for me
works for me
same for me
I'm trying to exclude blockly but it doesn't work
add to gitnore then
nah that is to much work lol
let it auto pickup
"too much work", its literally 2 clicks and one command on bash
one to download
one to open cmd
and then a command to run
i sell my really barebones website now https://i.s8s.app/9OXkvb4Y
not sure what they mean by code complexity, but it probably only takes into considerations the number of lines and tabs and nesting
whats the linkt to download lol?
this is the hardest thing i ever worked on and it has the lowest value
download the repo?
like how hard is this dude?
compile it yourself or get a release
I meant to download it , nice gif, i will request them to put it in their repo lol
what quality?
The gif
my gif is in 1366x768
if you getting lower res its on you
open the gif on the browser if your discord is compressing it
unless they're viewing it on a phone
lol, the quality was high
or that
opening images and gifs in discord mobile its horrible
i would record on my other screen, but its in 4k, i dont even wanna think about how big it is to send it
but then again
https://github.com/boyter/scc/releases releases give me this, what should I do now?
gigabit internet
lol
download windows veriosn
scc --exclude-dir website/client/public/scripts/blockly/
Either I'm going crazy or somehow it's not including blockly by default








