#development
1 messages · Page 1536 of 1
you exclude the folder name, not the path
prob a really bad idea
ooh it only accepts folder names
run it twice
one without the dashbaord
and then one inside of it
but excluding blockly
without blockly
idk if its additive, but it should be
is it a multipurpose bot?
nope
looks liek a dashboard
deshbord
deshberd
dishbeard
It was for mafia games
dishbard
disbord
discord

lol
how much does a hello world cost? let me check
what about we compare our pp size with commits(excluding shit people who commit every2 mintues)
I'm blind
20 bucks for a hello world? broken
wait nm
this costs 19 bucks
snek_case_lmao
start scc
PS C:\Users\shahn\Downloads\scc-2.13.0-i386-pc-windows> scc
scc : The term 'scc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ scc
+ ~~~
+ CategoryInfo : ObjectNotFound: (scc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command scc was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\scc". See "get-help about_Command_Precedence" for more details.
``` giving me a error
lmao
How much does a program crasher even cost
for (;;) {}```
erwins idea xD
Ah yes
lol
Silly erwin made a mistake
dream job, ngl
Comments™️
ascii art inside the code
copy paste third party modules and pretend you wrote them
lol
that'd give me a reason to come to this chat, i'd blately do what newbies do```ts
client.on('message' , async (message) => {
if(message.content === 'a') {}
});
client.on('message' , async (message) => {
if(message.content === 'b') {}
});
client.on('message' , async (message) => {
if(message.content === 'c') {}
});
client.on('message' , async (message) => {
if(message.content === 'd') {}
});
xDDDDDDDDD
🗿 Write a fizz buzz program but manually with console.log(), every line 20 bucks
#winning
actually, i forgot to add the super necessary async there in the function to increase the length[
lol, imagine a for loop in the event xD
maybe use syntax older than es5 lol \🤣
lol
ts legit gonna implement async by itself
Bro TS is ballin
client
.on
(
'message',
(
message
)
=>
{
if
(
message
.content
===
'a'
)
{
message
.reply
(
"b"
)
}
}
);
Wtf
client
.on(
'message' ,
(message) =>
{
if(message.content === 'a')
{
message
.reply("b")
}
}
);
``` i fixed it
I swear some people's code actually looks like that in d.js support channels
it's either a giant sausage or it's travelling around the world
but that extra line is 19$ 
fixed and improved times 30
i just edited it
see mine
:^)
i just tested it
better than having to scroll horizontally 
wait let me make that worse
oh i know what to do :^)
People wanted comments. Here you go :)
JSON.parse(`
c
l
i
e
n
t
.
o
n
(
'
m
e
s
s
a
g
e
'
,
(
m
e
s
s
a
g
e
)
=>
{
i
f
(
m
e
s
s
a
g
e
.
c
o
n
t
e
n
t
=
=
=
'
a
'
)
{
m
e
s
s
a
g
e
.
r
e
p
l
y
(
"
b
"
)
}
}
)
`);
@quartz kindle beat that
lol
LOL
does that run tho?
it has to run
let me try eval()
[
"message"
]
.toString
();
extra lines just for "message" 
Instead of that just do this
http://jsfuck.com
Easy bucks
jsfuck ez
client
.on
(
"m"
+
"e"
+
"s"
+
"s"
+
"a"
+
"g"
+
"e",
(
m
)
=>
{
if
(
m
.content
===
"a"
)
{
message
.reply
(
"b"
)
}
}
);
What the fuck
mesage
lol
mesage
we need more +
ok so how bad can this get without making it jsfuck, although i feel like we will eventually reinvent jsfuck if we continue like this
JS2Fuck

JSFuckU would be more appropriate imo
@quartz kindle it does ```ts
eval(
`
const Discord = require('discord.js');
const client = new Discord.Client('lul');
c
l
i
e
n
t
.
o
n
(
'
m
e
s
s
a
g
e
'
,
(
m
e
s
s
a
g
e
)
=>
{
i
f
(
m
e
s
s
a
g
e
.
c
o
n
t
e
n
t
===
'
a
'
)
{
m
e
s
s
a
g
e
.
r
e
p
l
y
(
"
b
"
)
}
}
)
`
.split('\n')
.join('')
);
THIS runs
Instead of m.content:
m
[
"c"
+
"o"
+
"n"
+
"t"
+
"e"
+
"n"
+
"t"
]
What the fuck
istg
check how much money thats worth tim
client
.
on
(
[
'm',
'e',
's',
's',
'a',
'g',
'e'
]
.
join
(
''
)
),
async (
message
) => {
if
(
message
.
content === 'a')
{
return message
.
reply
(
'b'
);
}
}
);```
client
.on
(
(
"m"
+
"e"
+
"s"
+
"s"
+
"a"
+
"g"
+
"e"
)
,
(
mmessage
)
=>
{
if
(
message
.content
.toString()
===
"a"
)
{
Message
.prototype
.reply
.call
(
message,
"b"
)
}
}
);
🗿
client
[
"o"
+
"n"
+
""
]
(
"m"
+
"e"
+
"s"
+
"s"
+
"a"
+
"g"
+
"e",
(
m
)
=>
{
if
(
m
[
"c"
+
"o"
+
"n"
+
"t"
+
"e"
+
"n"
+
"t"
]
===
"a"
)
{
m
[
"r"
+
"e"
+
"p"
+
"l"
+
"y"
]
(
"b"
)
}
}
);
mine is bigger than all urs combined lmao
use [] to access properties
wtf is this
there we go
so, according to scc, we get paid by line, so we figured, okay, why not abuse it?
and i took a couple steps too far

but new lines won't work will they
hence why i joined them
Bruh lol
oh nvm
We're speedrunning yandere simulator's code in a more pog fashion
but that only increases the amount of lines
which is good
let me check how much i'd get paid for that piece of garbage
@quartz kindle
Complexity 0
for whats basically ts client.on('message' , async (message) => { if(message.content === 'a') {} }); this
this code but you get payed for words and not lines
code but you're payed by spaces
client[ 'on' ]( 'message' , async message => {
if ( message[ 'content' ] === 'a' ) {
message[ 'reply' ]( 'b' );
}
} ) ;
xD
this is your contestor @quartz kindle #development message
thats cheating
no it isnt
at this rate vscode is gonna become the next paint
no evaluation
i proved it does
Dx
i actually ran that on vm
wtf
imagine evaling your discord bot in your test bot
What the fuck are you all on
development channel is a nightmare now

i used to eval js files before i knew how to use require
I can't stop laughing
lol
const fs = require('fs');
const utils = fs.readFileSync('./utils.js').toString();
eval(utils);
@slender thistle it all started here #development message
indeed
);
tim was testing how much each line of code is worth
and then shit spiraled from there

LMFAO
and this is the base #development message
how much can you make, in terms of money, with just this?
i wonder if tim will be mad if i convert each char to binary and then split them by new lines
@quartz kindle is THAT cheating?

I think using .split and .join to change the code is cheating
its technically the same code, no?
LMFAO Tim can I gently murder you
this is legit my code from 2018
this shit has everything i love about js
LMAO
looking at old, shit code is always nostalgic isn't it
funnily enough though, tim didnt use embed builder back then

proud of u tim
i guess that mess even outs by the fact that he didnt use builders
i dont think i ever used it
thank god
Nice
god
That \r\n 
HAHAHA
AAA
xDDD
static changelogs 
jesus christ
i still have static changelogs, but now they are in a json file
is it worth making it in json?
NO
I have it in txt
staph
works too
use githubo
txt best
it has changelogs for that reason
push commit then simply query commit history
and also bot users don't really understand what's going on in github lol
if it's a lib sure
i used to upload bot files manually to github, dark times
hmmm, true that
i have an even older version of my bot
Oh no
////////////////////////////////////
I still do this but js // // // // Text // // //
wait what
plebs
Not even /**/
did the bot actually run on a browser
base64 font src 
it ran on nwjs xD
will do on your lib
i wrap my stuff in files 
just screech at me when you finish it
tim remember that eval code from discord.is-light
INT...eresting
ye
it still exists
not built in anymore tho
very interesting
What the everlasting spirit's genuine happiness' fuck
me too tbh
Go sleep
try { let _TEST_ = eval(`(()=>{return ${f}})()`); return _TEST_ && typeof _TEST_ === "object" && typeof _TEST_.then === "function" ? {Promise:await _TEST_} : _TEST_ } catch(e) {
try { return await eval(`(async()=>{return ${f}})()`); } catch(e) {
try { let _TEST_ = eval(`(()=>{${f}})()`); return _TEST_ && typeof _TEST_ === "object" && typeof _TEST_.then === "function" ? {Promise:await _TEST_} : _TEST_ } catch(e) {
try { return await eval(`(async() => {${f}})()`); } catch(e) {
return e;
}}}}
i'm not even try guess what that does lmao
yandere code but 1 line
way more compact than the current version xD
codes not even that bad it's just that how it gets formatted on mobile is the funny part LOL
Kek
lmfao
this version didnt support evaling code with comments
precisely because of this compact version
the comment would comment part of the eval code
Anyone's can help me i am not able to import local codes from another directory like i want to import python class from a file so write first from then folder name python . File name python1 then import calss name python so its from python.python1 import python but its not working someone suggested to ise pylance in vs then also its not working and of my freind its working why so pls help and ping me when you get solution
Commas, periods. Thank you
Thank you.*
Flazepe, would you be so kind as to keeping quiet as a representative of the JujuShit gang?
N 
anyone got any ideas why my reverse proxy doesnt work
still get the default nginx site even with it disabled.
server {
listen 80;
server_name woo.pics;
location / {
proxy_pass http://localhost:3001;
}
}
What?
where did you placed the proxy?
set root
set root?
like, iirc the default root path is /var/www/html
ohhhhhhhh
so your site must be inside html folder
Woo still trying our challenge to add newlines
server {
listen 80;
server_name your.domain;
location / {
proxy_pass http://yourip:port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
``` i have this one for my /etc/nginx/sites-aviable/default
and it works for me
@quartz kindle Would this be better than that eval thing
let output;
try {
output = eval(f);
if (output instanceof Promise) output = await output;
} catch {
try {
output = await eval(`(async () => { return ${f} })()`);
} catch {
try {
output = await eval(`(async () => ${f})()`);
} catch (err) {
output = err;
}
}
}
}``` 
so http://woo.pics/ will point to /var/www/html folder
you dont have to point it to var/www/html
like, iirc the default root path is
/var/www/html
^
i dont point it to root and it works
well yea
but nginx works a bit different than apache2. nginx uses the sites-aviable folder to determine where to route stuff
sites-enabled actually
available are site configs that you can enable but aren't
normally you make a symlink on the other folder to enable it
i know
btw, is your code above about websockets?
i use it to proxy to my Express server
i have no idea why it doesnt work, no idea why the default nginx site even still comes up, i have it removed from sites-enabled.
did u do systemctl restart nginx?
doesnt support comments and doesnt support all forms of promise detection
yeah
weird
Yep
it supports some stuff, but not all of my eval
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
weird
i have nginx reverse proxying fine on my other vps
try going root then doing find -name "default" to see if there's another default page somewhere
idk actually, I'm out of ideas
did you make any changes to nginx.conf?
i havent
it does
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
show the contents of that file
root /var/www/woo.pics;
server {
listen 80;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
server_name woo.pics www.woo.pics;
location / {
proxy_pass http://127.0.0.1:3001;
}
}
root should be inside server
oop
and you restarted nginx?
make a file called default in your sites-enabled folder and redirect it somewhere with your code
cloudflare doesnt mess up reverse proxies right?
i know my other site reverse proxies fine with cloudflare on.
it shouldnt
nope
if it still doesnt work
doesnt
did you use any SSL mode on Cloudflare? had some issues until i made some changes
still have Flexible SSL enabled but it will now also redirect correctly
site_name _; means any connection right?
site_name _;
damn markdown
put it in the nginx.conf file still default, with both _ and the proper domains.
https://i.imgur.com/50Mi37G.png
it should be the sub domain you want to redirect, for wildcards i think * is correct
fails the test when using *
maybe try this code in your sites-enabled file server { listen 80; server_name your.domain; location / { proxy_pass http://yourip:port; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
worked for me
had also issues that i get the nginx default page all the time until ive made some ssl stuff since i have SSL enabled everywhere
im on flexible on cloudflare
yea i have it also set to flexible
how to using top-gg/sdk webhook with multiple shard bot
use it in your sharding manager
use where i put sharding manager ?
yeah
But how can I send message to user when they vote
Since in sharding manager there is not client for me to get user and DMs them
Hey
Arnold
Nostalgic
require('./config/alias');
const { ShardingManager } = require('kurasuta');
const { join } = require('path');
const { token } = require('cat-env');
const PhoenixClient = require('cat-akairo/PhoenixClient');
const { isMaster } = require('cluster');
try {
const shard = new ShardingManager(join(__dirname, 'bot.js'), {
token: token,
client: PhoenixClient,
respawn: true,
retry: true,
clientOptions: {
retryLimit: 3,
},
});
shard.on('shardReady', (shard) => {
console.log(`Created shard ${shard}`);
});
shard.spawn();
} catch (e) {
console.log(e);
}
Like this how can I get specific user info @lyric mountain
nvm
wut
I never used kurasuta, can't help sorry
it just like normal discord.js shard
Just tell me what you have do in discord.js
How does the channeltype work? I'm trying to make a channelinfo command and for some reason when i mention a channel in the command it says it cant change it into ChannelType
I have already read it
But like I said how can we get user at ShardingManager file?
That link not give the solution
I am asking what you are doing with you or exact way doing it not a random document
@lusty quest @quartz kindle so uh, i found the issue... i uh, used the wrong ip in cloudflare.
dns settings 
how in the world
well this is the classic i guess
you just get the client from the one you've set in the shardingmanager
i spent all night
PhoenixClient in this case
literally all night up till 2am
Sorry I don't understand your point
can you give some code out
console.log(shard.client.user.tag);
like this ?
shard.client.users.fetch(id)?
Which one is better? using json (as variable) or collections?
[Function: PhoenixClient] is shard.client
@fair axle I think discord.js collections built-in is better
that give you more method
thanks
kurasuta is copy paste of eris-sharder btw
just instead of making eris client, they just did change it to creating djs client
How Do You Add a Gif To an Embed?
I just figure out how can send message at where I put ShardingManager
ah ok
Can we do it ?
Cause I can only using client in shards not at shardManager
If I create webhook in bot.js that will create multiple webhook endpoint and block port
just create a master client in the master process and use client.api/built-in djs fns OR make request into create webhook msg endpoint
If I Put The Gif In There, It Wont Work
It Says Image
it does
Look Ill Try, Gimme a Sec
No, it's not
Apparently not
I've checked, and it's completely rewritten
in TS
It's only inspired
ah ok
I doubt Yukine would copy paste
but why does these even exists:
internal sharding > shardingmanager imo
To each their own I guess
also, isn't it a bit inefficient to just spawn 1 shard per child/worker?
the format is gifv?
Where do i put gifv
gif works fine for me
regular messages will do
Get the actual GIF
Those only work if you send it
0-0
Since discord embeds it for you
so what do i do
This
So can anyone help me with my situation
How can I get user Information at where I put ShardingManager code
ok ill try
follow the guide , lol
there is no guide to do that
u have shard.js file , there should be the sharding manager
I'm sure there's one in the docs
and discordjs.guide
@zealous dew
:( I can't go into the shard file to put that code
cause it will create multiple webhook endpoint
I am try to get client work at where Manager is
u can do if(client.shard.ids.includes(0)) then execute
but don't know if can I do it
you mean you want to use broadcast and broadcasteval?
this is not food
because, https://discord.js.org/#/docs/main/stable/class/ShardingManager has them
no he wants everything in a file
sharding manager in client.js file
from the sounds of it, he wants to send a user a dm
using broadcast eval you can send a user a dm.
or create a gateway and fetch it lol
how many glds do u have?
lol, than its required
That got me wondering! 😂
u can do internal sharding @zealous dew
Yes that is a thing lulw
in client options shards: "auto"
const PhoenixClient = require('cat-akairo/PhoenixClient');
const { isMaster } = require('cluster');
const express = require('express');
const Topgg = require('@top-gg/sdk');
try {
const shard = new ShardingManager(join(__dirname, 'bot.js'), {
token: token,
client: PhoenixClient,
respawn: true,
retry: true,
clientOptions: {
retryLimit: 3,
},
});
shard.on('shardReady', (shard) => {
console.log(`Created shard ${shard}`);
});
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// this is not working
shard.client.users.fetch(req.body.user.id)
});
app.listen(3000);
shard.spawn();
} catch (e) {
console.log(e);
}
look at this // this is not working
I can like return example message channel send twice?
no not in the same file , lol
yes u can
So how can I do that ?
but why?
to send a message in the channel and in direct same time.
Did you try to tell me I check the id of shard if it is first shard init webhook at there ?
they will be handled one to next
and you need to return them both, or just send them? 🤔
@zealous dew
const user = await (new Discord.Guild(client,{id: "the guild"})).members.fetch(message.author.id).catch(() => null);
What are you doing with the messages
just have to change this for client, lol
// I do blacklist command, it blacklists the user Send a message in the channel for success and dms the users that he gt blacklisted.
But I want to return them
Yo
I'm currently makin' a music bot and I'm trying to make a *time left* timer for the song that's playing rn
Any help would be great thx 👍
the message.channel.send()
user.send()
como gano creditos
I want to return
reverse it lol
where I put this code
?
and where is the guild come from
this will not work, bc of the gld
I am trying to send user DMs everytime user vote
hmm so why you send me not working code
So weird
use a second bot lol
go into more details what you have done
wdym
client.shard.broadcastEval( await client.users.fetch(${user.id}).send("balabak"))
what is second bot mean
ah their is a problem lol, forget it
Ok
this may work
u have to await it
Ah thanks you
But isn't that going to send the message in every shard?
and you can't use fetch like that
Oh wait
wait u cound use fetchclientValues
Will you even be able to use await
yes it works in broadcast
I tried it xD, It works in eval, lol
client.shard.broadcastEval( await client.users.fetch(${user.id}).send("balabak")) @@? this is in where we have client
But at where I am init webhook
there is no client
Yo
I'm currently makin' a music bot and I'm trying to make a time left timer for the song that's playing rn
Any help would be great thx 👍
(using discord.js)
You have to use (await client.users.fetch(id)).send()
what is a torn write
yes, forgot the ()
But still, do you want to send the same message on every shard?
but the problem is when the users is in many shard it will send it in many servs
I have idea
oh i see
what you guild talking about
this, not client
Just fetch the user in broadcast
then return the promise and reduce it and then send it @pale vessel
this.users.fetch
lol my fault
did not slept for 38 hours lol xD
require('./config/alias');
const { ShardingManager } = require('kurasuta');
const { join } = require('path');
const { token } = require('cat-env');
const PhoenixClient = require('cat-akairo/PhoenixClient');
const { isMaster } = require('cluster');
const express = require('express');
const Topgg = require('@top-gg/sdk');
try {
const shard = new ShardingManager(join(__dirname, 'bot.js'), {
token: token,
client: PhoenixClient,
respawn: true,
retry: true,
clientOptions: {
retryLimit: 3,
},
});
shard.on('shardReady', (shard) => {
console.log(`Created shard ${shard}`);
});
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// this is not working
shard.client.users.fetch(req.body.user.id);
});
app.listen(3000);
shard.spawn();
} catch (e) {
console.log(e);
}
no wrong xD
wait sending u a code
const promises = [client.shard.fetchClientValues(`users.fetch("${the user id as variable}")`),
];
await Promise.all(promises)
.then(results => {
let user = results[0][0] ||results[0][1] || results[0][2]
user.send("balsa")})
``` @zealous dew u have to change it a little bit
wait forgot du reduce
No
Let me describle again
I am trying to init webhook and send DMs to user when they vote my bot
u want to send a message when the user votes
@zealous dew there is much easier solution use discord.js-light
it has easy functions
where I need to put that code
what good names, irony off
don't understand what you mean
forget it
@zealous dew meant irony
auto spell checker uff

he uses a non standard Sharding Manager, i dont know if he will even work with d.js-light
not from discord,js?
nope
kurasta lol
it builds on it
uff
Wait
then ask them for support lol
and debloat your code from other libaries, they are not better xD
okay some are good but the most are just copies
with a feature extra
if i understand it correctly each shard runs its own client, and with isMaster you can have stuff run of the master node, so the only issue you have is getting the client right?
kurasata makes managing sharding easyer
each client ===> a own process ==> shard
lets rephrase it, the shard file is run on each shard itself
this is not the case with the normal shardmanager iirc
no he made it wrong
u need a shard.js file where u start your index.js file
i know
yes that what I am stuck now
but karasuta runs the sharding file on each client
if i get it right you can reference it with this.client
inside a cluster
but if we create webhook in cluster
that looks like this start shard.js ==> will start bot.js\
karasuta works a bid different than normal sharding
trash lol, for beginners its easier to use bigger libaries
yep, I meant the manager of discordjs
is this sublime? or the monokai theme?
it makes sense at some point. you can define finer if you want to run stuff from the master
looks like VSC with Material icons
Yes monokai theme
can we get client in master ?
sublime has this default theme xD, thatsway it came up to my mind
Why do u not ask in their support server? They have higher expertise then us .
i never used it since i have for now no reason to shard. so idk
ask on the karasuta discord for some help, there are probably people who can help you out.
for your to
told that xD . lol
karasuta have no support server lol
bruh
@zealous dew how much of your code base on kara....... ?
wait you can get the client in your file
the ready event returns the cluster
and if i see it correctly inside the cluster you can reference client with this.client
yeah, basically
gg discord is 4 seconds delayed for me
me too
me too lol
I'll need to use a integer-based flags, so I was wondering how to do it
not much I am switching now
i check them this way on my dashboard```js
(guild) => (guild.permissions & 0x20) === 0x20
0x20 is manage guild permission
yes it will be the best, superbrain8, is having the saeme opinion
that info actually helped me understand how it works lul
all I need to do is flip certain bits
lol
nice, my flags will fit in a byte
ahh i hate the npm page. got today an HDR capable Monitor and now im partially blind
@tired panther @lusty quest here we are using discord.js now
require('./config/alias');
const { ShardingManager } = require('discord.js');
const { token } = require('cat-env');
const express = require('express');
const Topgg = require('@top-gg/sdk');
const manager = new ShardingManager('./bot.js', {
token: token,
});
manager.on('shardCreate', (shard) => {
console.log(`Creating shard ${shard.id}`);
shard.on('message', (msg) => {
return shard.manager.createShard(msg);
});
});
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// Handle send DMs to user
});
app.listen(3000);
manager.spawn();
:D is it more ok now ?
HDR monitor?
like, high dynamic range?
HDR? High Dynamic Range?
how does it work?
the monitor reaches a Peak Brightness of 600 nits
like, isn't it about exposure?
discord.js-light x<d
holyfuck
the bigger model reaches 1000 Nits
why did u buy a flashlight tho?
:v Sorry please there is not much different in discord.js-light
but if you sit in a Dark Room and open a White page you get blind for a sec
yes they are it uses 90 % less ram lol
why I need it
its easier for you to send messages accross shards
d.js-light gives you way more control about the Ram usage, also adds some nice function for Sharding
(ram usage with what discord.js caches)
yes xD i just love it
got from 500mb Ram down to 94
@lusty quest I know it
with the same amount of Guilds
6gb ram on 4 shards now just 700 mb ram

But can you guild help me at discord.js now ?
meanwhile my tensorflow powered bot runs at 700mb while having one guild
Cause moving into discord.js-light will take time
My bot is not small and less function
i did it 2 days after i rewrote my bot bcs the old code got wired
install discord.js-light then I can hep u to 150%
there is not that much to change tbh
and u do not have to change much lol#
You can do what you want without discord.js-light
its nice if you use it, since the forging feature is nice if you need somewhere a quick client
but normal d.js works just as fine
So can u guy help me ?
const partialUser = new Discord.User(client, {id: "userId"});
partialUser.send("...");
If you using discord.js-light less ram it is but more bandwidth is needed cause you need to fetch discord API too much to get data
i have no plan about sharding, my largest bot never got past 300 guilds
yesnt Discord.js caches a lot of unneccesary data
that is unnecessary for some bot not all
idk what exactly if you want to know more ask Tim he made the lib
if you work with presences sure its not necesarry
you could use what GoogleFeud just send in
I don't have client
require('./config/alias');
const { ShardingManager } = require('discord.js');
const { token } = require('cat-env');
const express = require('express');
const Topgg = require('@top-gg/sdk');
const manager = new ShardingManager('./bot.js', {
token: token,
});
manager.on('shardCreate', (shard) => {
console.log(`Creating shard ${shard.id}`);
shard.on('message', (msg) => {
return shard.manager.createShard(msg);
});
});
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// Handle send DMs to user
});
app.listen(3000);
manager.spawn();
Here is what all I have
const partialUser = new Discord.User(client, {id: "userId"});
partialUser.send("...");
As this result I don't have any client here
js sucks
like i said i never worked with shards. but ShardingManager can use brodcast eval, but this will run it on each shard
or use fetchClientValues to fetch the user
what is not suck
:( So wait other to help me then
i gave you 2 suggestions, idk if they will work but they look promising atleast the last one
You can use broadcastEval only on the first shard to send a message to a user, too
but that will not balance on each shard since first shard handle too much
I don't think a single request is going to slow down your first shard
you can also balance it yourself
it will be multiple request cause when vote is reset multiple people gonna vote the bot
let lastShard = 0;
if (lastShard > shardAmount) lastShard = 0;
broadcastEval(code, lastShard++);
This way you are rotating shards @zealous dew
but I don't think it's necessary
how can you get the webhook auth
nope wrong, U can enable caching, less api fetch. And also it send less api fetches, when just not found in cache
manager.fetchClientValues(
`users.cache.get('188242504670380033')`
);
where can I put this ?
thats wrong lol
require('./config/alias');
const { ShardingManager } = require('discord.js');
const { token } = require('cat-env');
const express = require('express');
const Topgg = require('@top-gg/sdk');
const delay = require('delay');
const manager = new ShardingManager('./bot.js', {
token: token,
});
manager.on('shardCreate', (shard) => {
console.log(`Creating shard ${shard.id}`);
shard.on('message', (msg) => {
return shard.manager.createShard(msg);
});
});
manager.spawn();
in this file where can I put that
shard.js
then run node shard.js
it just a name
what you got in your shard.js @tired panther
can you should me what in your code ?
also all DMs are getting send by shard 0 anyways
I think only shard 0 receives DMs
shards don't really send DMs, they are sent via REST
or this way, but i knew there where something with shard 0 and DMs
yea only shard 0 receives DMs
So why don't we init webhook if shard.ids = 0 ?
you can also do broadcastEval(code, 0)
that we solve my question :D
so you don't compare shardids
why
that was my first id lol, but u did not want
yes cause it heavy for shard 0 :D
idea not id
I am doing it now try to make it work at manager
make a random number generator that sends the eval to a random shard so there is a lower chance that the same one gets all the load. (or make a proper load balancer)
#development message that should work
but, not every shard has the member
Wait but I can't send broadcast now
you dont need the member?
require('./config/alias');
const { ShardingManager } = require('discord.js');
const { token } = require('cat-env');
const express = require('express');
const Topgg = require('@top-gg/sdk');
const delay = require('delay');
const manager = new ShardingManager('./bot.js', {
token: token,
});
manager.on('shardCreate', (shard) => {
console.log(`Creating shard ${shard.id}`);
shard.on('message', (msg) => {
return shard.manager.createShard(msg);
});
manager.broadcastEval(`users.cache.get('188242504670380033')`, 0);
});
manager.spawn();
(node:15804) UnhandledPromiseRejectionWarning: Error [SHARDING_NO_CHILD_EXISTS]: Shard 0 has no active process or worker.
at Shard.eval (J:\JSKingdom\phoenix-akairo\node_modules\discord.js\src\sharding\Shard.js:266:62)
use fetch, incase the user is not cached
or create a fake user
there is no readyEvent
just only shardCreate
how can you make a message visible to the user only w slash commands (like clyde)
ready is for client
flags: 1 << 6 in the message object
ahh wait this where for kurasata
flags: 1 << 6
is there a list of all flags
they are not documented as of now afaik
ah oof
also
can we make it so
it deletes the
"User used the /ping command"
yes
how so?>
type: 3 in the response object
ok tysm :D
I removed kurasata
alr
(outside the data object, though)
Does anyone knows why that doesn't works when i'm trying to:
<Embed>.setThumbnail(image);
?
did some research but broadcast eval should work, maybe look first into how many shards are actve or so
@lusty quest this what error I get
Any idea how to solve it ?
do i add flags: under the type
never used Sharding ¯_(ツ)_/¯
data: {
type: 3,
flags: 1 << 6,
data: {```
what is value of image ?
nope, inside the data object
url
the second data object
do you sure that ?
how do you tag a user
interaction.member
?
i tried this before and i only was successful with the username
<@${interaction.member.user.id}>
I am asking again what is value of image
Make sure it is url not stupid object
also one last thing
like image you send
how would i make it so it logs that a user used a cmd ina channel
a channel*
So in a channel it sends as a default message:
User used the this command
do i put it outside of the response object
@cinder patio do you know how can I fix this
get a TextChannel object,
channel.send(`${interaction.member.user.username} used X command`)
do this in the INTERACTION_CREATE event
TextChannel?
Your application must also be authorized as a bot, too
you will have to fetch the channel
const channel = await client.channels.fetch("id");
alr thanks
wait
i put in the interaction_create command?
but there's multiple commands
so it will just trigger whenever it happens?
ye
would
instead of X do ${interaction.data.name}
Anyone can help me
it says missing access
but the client is in the server
except its a different slash command scope
thats probs the issue one sec
well the username
samm
it only prints this
i want the tag
${interaction.member.user.tag}
doesnt work
idk shard stuff never used it lol
````MongoError: Authentication failed.``` what does this error usually mean?
😦
I noob
that your authentication information was incorrect
Ah yes! Thank you
i do wonder sometimes
dog wtf is that pfp
its extremely common
fr?
good
had a guy in #support need me to copy paste each step of getting their server listed because linking to https://top.gg/servers/new was too much to follow each step himself.
kinda weird ngl
ah yes, when step-by-step instructions aren't enough
just handhold them through absolutely everything smh
needing someone to go through each step with you 
well i tried saying, did you do each step listed here? <https://top.gg/servers/new> a few times, but didnt work, so i started listing them out and he finally got it 
sometimes its faster to hand hold
some people 🤦
br-
Has anyone used Jest to mock discord.js?
wdym mock
It's used in testing when you have complicated objects and you want to fake their behavior
like unit testing?
Ye
No, once the role is deleted you can't
I suspect the role object must contain it somehow but even if it does, it won't have all the members who has the role
As it relies on cache
okey thanks
the roleDelete event apparently does not remove itself from cached members
so if the members are cached, they will still appear as having the role
Yo tim, remember the Symbol.iterator function you wrote for the number prototype?
Why did you call this.valueOf() tho, it would always return the number itself wouldn't it?
thank you d.js
this inside Number.prototype is an instance of the Number class
it gets coerced to number when you use it with math, but to get the value of it without coercing, you need to call valueOf
Oh, i see
whats coercing again?
implicit type casting
oh
plus, isn't it faster to skip all the coercing?
this is very beta and i was just testing but how come it keeps on sending the prompts
let sessionarray = []
msg.channel.send('What time are you hosting your training?')
const time = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 40000,
})
sessionarray.push(time)
if (!time) return msg.channel.send('Did not get a valid response within 40 seconds, cancelling.')
while(time.size > 0) {
msg.channel.send('Who is hosting the training session? Please provide a roblox username.')
const host = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 40000,
})
if (!host) return msg.channel.send('Did not get a valid response within 40 seconds, cancelling.')
msg.channel.send("Who is co-hosting this session? Say skip to skip this option.")
const cohost = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 40000,
})
if (cohost.content === "skip") thecohost = "None."
msg.channel.send("Are you sure you wish to send this training session notification? Reply with yes or no.")
const confirmation = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 40000,
})
if(confirmation.content == "no") return message.channel.send("Ok")
if (confirmation.content !== "no") {
let embed = new Discord.MessageEmbed()
.setAuthor('test', msg.guild.iconURL)
.setDescription("Host: " + sessionarray.map(host) + " Time: " + time + "Co-host" + cohost)
.setColor("RANDOM")
msg.channel.send(embed)
sessionarray.length = 0;
}
}
}
}```
also is there an easier way to prompt
cuz this is rlly annoying
ah nvm i found a discord js prompter package
time to test
<article id="SUPPORT">
<h2 class="major">SUPPORT</h2>
<span class="image main"><img src="images/spectre_4.gif" alt="" /></span>
<p><center>SERVEUR SUPORT <br> <a href="MY SERVEUR DISCORD LIN; CLICK HERE ← </a></center></p>
</article>
<article id="red">
<h2 class="major">ADD RED</h2>
<span class="image main"><img src="images/spectre_3.gif" alt="" /></span>
<p><center><a href="MY BOT LINK INVITE; RED ← </a></center></p>
</article>```
Hello





.*
