#development
1 messages · Page 1546 of 1
gib jsfuck
@woeful pike come here i need help with something
Give me JSFuck or give me death
lmfao
@opal plank https://www.npmjs.com/package/jscrewit
oh god
this is what i dont get
why make a troll package and bother adding ts support?
it feels too much effort for a joke
Tim test the speed of JSFuck code vs normal js code
i tried googling it i cant seem to find anything
cuz when i go to a new page on the site it doesnt technically load a new page, so like on the live location map it doesn't update where people actually are for example
man I'm not a help desk stop
it only shows where people load in
clearly worth using jsfuck
Wait what. 🤔
anyone have any idea bout my issue or?
@quartz kindle , now compile d.js into jsfuck and distribute it
without the eval wrapper:
im just skipping cuz i dont have the answer for it, but i did see it
That's 59 milliseconds right
ye
i-
what
what you said is literally the equivalemnt of saying no homo after saying something really homo
so i can't rely on you for ts help then, noted.
scratch my back
sure
gay
I don't want to get pinged for help
you too
if I'm around when you're asking I'll help, sure
i do wonder what would come out of a properly coded scratch interface
I did this for one of my bots. People could code their own stuff using a scratch-like interface
but if there's something I've learned over 300k messages of helping people with programming stuff is if you let people ping or dm you with problems you become their google until you tell them to stop. So please don't
That being said, just go ahead and ask I'm already here so whatever
i prefer the more direct method "get off my dms, keep support in the server"
i prefer the best method "get the fuck out of my dms and go to the fucking development channel you absolute stupid cunt"
unless you:
a) got something to say to me
b) need support rgarding something i made
c) found a bug using something i own/make
do not dm
9/10 times if you answer someone's questions in dms they will continue to ask you their questions with absolutely no shame like it's extremely sad to see people just abuse help like this but it happens almost every time
^^
feels sad
^^^
if (!oldMember.premiumSince && newMember.premiumSince){
return client.channels.cache.get('768887065638600705').send ({
embed :{
color: 'PINK',
description: `Thanks ${newMember} for boosting`
}
})
}```
is there any prob with this code?
apart form the terrible formatting and the fact that discord accepts hex integers for embed colour and not colour resolvables like djs does
you can send that]
oh ok
you win erwin
i use it quite often, its quite handy
gg
is the code good if yes i didnt get a message
keep that in mind
apart from 000000 and fffffff
ohk
0099ff is the only one i remember
no, i see it

Erwin can u look at my code
i did
if (!oldMember.premiumSince && newMember.premiumSince){
return client.channels.cache.get('768887065638600705').send ({
embed :{
color: 'PINK',
description: `Thanks ${newMember} for boosting`
}
})
}```
lots of pain and tears to use n-api with csharp
get() might return undefined, account for that
what is this for
do i have to change my code so server count updates for over 100 servers?
boost server event
hmmm, apart from that, it looks fine
what?
read pins of #topgg-api
do i need to change any code so server count updates after the bot reaches 100 servers
im talking about this btw
no all guilds are cached
server count WHERE? in status? in top.gg? what server count?
#topgg-api reeee
no, like feud said, all guilds are cached
ok good
ok
you will have to after you start sharding though
should i not use this?
Can you give me a direct link to the message?
NO
I did not understand that
reading the pins isn't that difficult
do NOT add a postStats attached to every message event
ok
question in discord's api is there an event for boosts now? is it on guildupdate or something
you'll spam the api good time
yeah i was asking if i should remove it
ngl i see iara in development for the first time 
lol u gonna get ratelimited from dbl like me 
i think i did XD
I am not fluent in English very well
you can use the messag event
im here sometimes but then sometimes the stupidity gets to me
i'm aware
i wanna know if i can not rely on the system message
yes and no
when its reliable, yes, absolutely, but not most of the times in my experience
check this for example
bro then tf are bots doing it without system message
are they setting an interval and checking or sumn
lmao
how can I make my bot to mute people?
not that hard though: local clustering -> open IPC and request guilds from all clusters, clusters in many servers -> make a REST api for every master cluster and request or smth
gross 😭
premiumSince flag should be attached on member
discord needs to give me my event
how can I make my bot to create a muted role and give it to people?
aka, very poorly lmao
wheeze
but yeah sometimes system message doesnt work propelry
its really inconsistent sometimes, but you could listen to events
which is why i expected them to have an event by now
its not a new feature now lmao its been like a year
if it didnt come already, i doubt it will anytime soon
disappointment is real discord
for now your best options is to listen for updates like you said
that'll the most performant
wait listen to system messages or set interval
e
or, not even
its so gross tho if you listen to system messages you have to ask for the user for a channel that has system messages in it
just add this
i got some crisps
setting an interval to do something is also notsopog with large bots
let premium = message.guild.members.cache.filter(u => u.premium !=== undefined);
though, this just runs a loop internally
pain
but not all members are cached
and that
oh right lmao
YIKES HAHAHA
yeah i guess system message it is
my bot caches less than like 10% of members in most guilds
you could fetchAll on startup
almost 200k server gang
eeeey nice
erwin ill send you my ram bill
thanks for offering to pay for my ram
you think urs is high?
im probably the youngest bot dev here lol
bro my server is at 32gb
2gb for 1k servers, fuck me
its definitevely a leak
i start at 800 and it slowly builds up
that's a memory leak if i see one
but i cant find the damn leak anywhere
back when i was at 2k servers i was at around 800mb and i was already thinking i had a memory leak LMAO
also why people prefer thing !== undefined over thing
though, mine is cachign a shitton of stuff
so its really heavy
thats likely d.js doing some fuckery
fuckers cache every single message edit
like, literally, fuckoff
discord.js-light moment
^
theres an option to remove edits
because of the intensive fetching?
nod
even rn im geting banned from cloudflare just from using djs lmao
botum growum bigum
Hello I am currently seeing a new arrangement. It's difficult because it's an array statement that I've never tried so far. The array statement is as follows.
ulList[i] = {
name: ${message.channel.send},
}
This is just an example. Value is not a problem. The question is how to get the value
damn
yea
have each shard use a proxy
still imagine rewriting to djs light then getting banned
ur using šhârding manager?
ion wanna test that theory thanks
thats abig ragequit right there
Umm..
no preblomo
Another thing you can do is horizontal scaling, have some shards on one server, some others in another
sorry i suck at python @earnest phoenix
im assuming thats python but i honestly have no idea what that is
I heard Python
i suck at everything, except maybe drinking
that doesnt loook like python cuz you have a random template literal in it
You're an expert in that field dw
but if its js you would have ` around it no

Das nae Py'thoon ye babeh cheks
im doing that with a bot in 25 guilds 
thats like using a chainsaw to open a yougurt lid
because PEOPLE
completely uncessaery
@opal plank bro typescript Is interesting
well what else i should do with my 3 other servers?
did that for twitch, though, i may have dossed them a couple times

uh oh
55k twitch streams
had to take it from the logs
cuz that shit turned off rn for maintenence
I don't use twitch so I don't know if that's a lot or not
i think Zoro remembers me literally logging with sharding and IPv6 rotation to twitch and literally connecting to 110k servers within 34 seconds
fyi, my bot wasnt verified
so i had a ratelimit of 10 JOINS in 20 seconds
110k in 34 seconds

fuckers probably saw a huge ass spike in websocket connections
but the idea was to prepare all guilds and shards before connecting them, and doing them as quick as ratelimit would allow
since they have their internal ratelimiters
so the controller just dispatches requests to the shards, and they each handle it, and passes back to the controller
it shoulodnt be too difficult, its just the ipv6 rotation thats a bitch
cuz you need a proxy for it
so you can rotate them, which is kind of annoying since it breaks quite often
i think i'm going to get ipv6 rotation to my bot 
tldr; use a pre-built proxy, dont write one from scratch
no, i've written literally everything except coloured logging and discord connection myself
even loading from .env 
reinventing the wheel for no reason
Hey
well, it (might) be faster than using 3rd libs
Does anyone here know how to do node.js??
meh, how much loc is dotenv?
I don't think loc matter, the thing with dotenv is that you call a function at the start and then it doesn't do anything else, so there is no reason not to use it. There's no overhead
well, one thing is that it does not support different .envs, like .env.devel and .env.prod
I need some help if anyone has a solution.
unless, i'd just do process.env.NODE_ENV === "production" ? "../.env.prod" : "../.env.devel" in the options ¯\_(ツ)_/¯
why didn't i realize that when i wrote my own loader
lol
I have an object (typescript) and then have partial that is the same type of the object. I have to set the fields in the full object to the fields of the partial and keep the rest of the original object fields the same. I don't know how to do it dynamically.
hello
i would like to make a bot with simple 3 commands:
ban
kick
mute
pls anyone who can help me doing it as simplified as in this main.js comannds i would appreciate
Object.assign
The Object.assign() method
copies all enumerable
own properties from one or more
source objects to a target object. It returns the target
object.
Awesome. Thanks!
Do you know, if I pass my original object, it merges it in place, right?
you can probably avoid it by implementing some custom caching for the stuff you need, will likely be way more efficient than djs's caching anyway
but at that scale you probably wanna use a barebones gateway instead of a general purpose lib
Does anyone know how I can create a command for my bot to exit the voice channel?
fixed
Hey guys, is it normal that custom css animations aren't working if we put em in the description part? Normal css works just fine but just not animations
It says <script> beacons will be deleted but not @keyframes in <style>
Hello I am currently seeing a new arrangement. It's difficult because it's an array statement that I've never tried so far. The array statement is as follows.
ulList[i] = {
name: ${message.channel.send},
}
This is just an example. Value is not a problem. The question is how to get the value
honestly, i have zero idea why most of the stuff in this pagation is in there.
why do you need promises for this?
i thought that was the problem
but its the new Array part
ulList[i].name will give you the value in that case.
it changes it permanently in the cache
how can i find what the type of a var is in python
like if var is an int do this
else do that?
its super dirty, but why not do something like this.
pageItems.map(arr => {
return arr.map(wall => {
return `the string for this wallpaper ${wall}`;
})
})
obviously, instead of returning the return arr.map(wall => {
youd make your embeds there and return the embed instead. then youd just set p to the outer map.
on my page, how do you add a background image?
if you want to simply set an image without filters, you can do
body {
background-image: url(blablabla.com)
}
okay
lol
@solemn latch Umm It seems that [i] should not be entered because this is the data value loaded when crawling with cheerio [ { name: value } ] Because it is expressed as
I have succeeded in crawling, but I want to send the information received by discord embed.
wheres name at 🤔
if you wanted the title its
variablename[0].title for example.
@opal plank come here i need help with something
erwin going to bonk you 🤔
lmao
let ulList = []; But when I do ulList.name it doesn't work
erwin is brazil too tho
@earnest phoenix [] isn't {}
ulist is empty in that case
you don't get attributes from []
ulList[0].title here?
it has no properties
@quartz kindle whatever you're good at ts stuff right
you didnt define ulist as whats shown in the screenshot
you defined it as []
which doesnt have a property .name(at index 0, or any index.)
{} is included when information is received by crawling
just ask your question
so i'm trying to generate a d.ts, for my modules index.js, from an index.ts if that makes sense
set declaration to true in your tsconfig.json
not done
that will generate declaration files on compile
but when i import everything
and put it into an object
everything is any
so no actual types are being put out
do you have "types": "index.d.ts" in your package.json
no, but that's not my problem
well then add it
on your top.gg page, how do you add this to your description?
the type of text and font
same as on discord
with `
o ok
import AllowedMentions from "./lib/models/allowedmentions"
let petals
petals = {}
petals.AllowedMentions = AllowedMentions
// petals.AllowedMentions is any
-Like this?```
that's "diff" language
that depends on what language you choose to use in a code block.
Okay
what you want is a code box
Oki
top.gg description accepts markdown as a scripting language
and markdown accepts both quote blocks with 1 ` and code blocks with 3
then top.gg colors them based on css
for masked links, can you do [text](link) on the page?
yes
Im trying to add reaction roles, but the bot doesnt give the role nor respond to the reaction if the reaction appeared before bot started, how can I fix that? Enable some intent or?
djs?
Yup
i think you have to add a partials array in ClientOptions
I tried that once but uh my messageEdit event went crazy lol
something like new Client({ partials: ['REACTIONS', 'CHANNELS'] }) i think
@mellow kelp I tried to define a class constructor like this, in react
class AnyClass {
constructor(readonly val:number){}
}
And it is showing error for using readonly. It says, a ',' is expected after readonly it
and typecasting with as is also not working for me
that works just fine for me
maybe you have an outdated typescript version or something?
no idea then tbh
where can I share my code?
getHtml()
.then(html => {
let ulList = [];
const $ = cheerio.load(html.data);
const $bodyList = $("###").children("###")
$bodyList.each(function(i, elem) {
ulList[i] = {
title: $(this).find('div.profile-header').attr('data-nick'), // 플레이어 닉네임
updata_time: $(this).find('p.mb-0').text().replace(/\s/gi, ""),//
image_url: $(this).find('div.profile-header__icon img').attr("src"), // 플레이어 프로필 사진
lankimage: $(this).find('div.profile-tier-competitive img').attr('src'), // 플레이어 랭크 사진
lankname: $(this).find('b.mt-1').text().replace(/\s/gi, "").substr(0,7), // 플레이어 랭크
send: "ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ",
lank_info_1: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(0,3),// 평균 판수
lank_info_2: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(3,5), // 승률
lank_info_4: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(8,3), // 평균 딜량
lank_info_5: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(11,4), // 킬뎃
lank_info_6: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(15,5), // 평균 헤드샷
lank_info_7: $(this).find('div.float-right').text().replace(/\s/gi, "").substr(20,3), // 평균 킬
send1: "ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ",
};
});
console.log(ulList.find(lank_info_1)) // here is ReferenceError: lank_info_1 is not defined
const data = ulList.filter(n => n.title);
return data;
})
.then(res => {
log(res)
})
Even though I have defined [], I can't get the value in the name of ulList by any method...
Can someone give me an idea of how to await events in node js? For example a message has been edited. The bot waits 1 sec for another message edit. If it finds another edit it sends 2 embeds using a webhook
you can make a sleep function using promises and setTimeout
shoosh
i got my answer faster elsewhere
y'all move as fast as the mcdonald's i work at
imagine:
- ordering people around
- thinking #development is here for your will
- assuming you are entitled to an answer
- pinging and then telling me to "shoosh"
- complaining about how fast i answer knowing people have stuff to do irl
grats, you earned yourself a block
oh wow
also, topic https://woo.pics/images/a25a17c488.png
do it anyways
hi shiv
Oh shoot, I need to start pinging shiv for mod issues.
Make sure he really feels welcome
You need to start pinging shiv. No reason, just do.
how do i fix this?
Delete the json.sqlite
k
Is there any property or method to see how many boosts a user has given?
nope
the api doesn't provide it
there's ways to estimate it but it isn't reliable at all
if you're in dapi, you can read this <#381889909113225237 message>
basically me and a few other people brainstorming
Ok, thank you
uh
nothing
lmfao
it takes one (1) google search
yes js number is fun
too lazy to type the rest 🥲
who would have thought we would live in a world where typing 5 extra characters would take longer than the time it takes for the search request to make several trips over thousands of kilometers and return an autocompleted answer
why isnt this working? ```js
<body>
<div class="hide"><input id="counterCount" value="0"></div>
<h1 class="counter" id="counter">0</h1>
<input class="button" type="Submit" value="Click Me!" onclick="updateCounter()"></input>
<script>
function updateCounter() {
let counter = document.getElementById("counter");
let count = document.getElementById("counterCount");
count.innerHTML = `${Number(count.value) + 100}`;
counter.innerHTML = `${count.value}`;
}
</script>
</body>```
what i want to happen is every time u click the button, the counter which isnt hidden goes up by one
you want to update both numbers at once?
guys can i ask something i have a problem i want make A status of the bot when i add this for how many guild he join it says on his Status undefine Ples Help
${client.guilds.cache.size}
english please?
well i just want the number to get bigger by one
no i just want the counter class one to be updated
i added the input one cuz its the way i thought of making it work
ples help my
you dont need the input
well ya i know but i cant think of another way to do it
just do what you're already doing, get the innerHTML, convert to number, increse, set innerHTML
no one okay sorry
i dont understand what you want
Maybe you defined your client weirdly or something which causes it to be undefined
It should show the server count
i want make on my bot status how much Server On it
this what i add
${client.guilds.cache.size}
it say undefined on his status
UvuvwevwevweOnyetenyevweUgwemubwemOssas
yes
More context???
uhhh
give us more context
show code
show ALL code
i do Status on .env wait
?
const stat = process.env.BOT_STATUS;
?
BOT_STATUS="${client.guilds.cache.size}"
you cannot do that with env
can we see ALL relevant code and ^^
env files are not code, they are text only
wait Tim
variables inside env do not work
ahah, thats where you are wrong
🤔
if i put text like Prefix or some thing it work
but variables don’t
client doesnt exist inside env
oh i undrestand
yep i try ${prefix} It say undefined Tooo
can i have any source code of multi status
Hey guys! Today I had my first crash when reaching memory limit on my AWS node.js free plan 👀
Made a provisional memory logs and found out the usage almost lineary increases, found out about "data leaks" which I suppose is the issue during some googling but it seems like quite complicated topic so, any ideas what could be the biggest most common issue so I can make a provisional fix before fixing the issue completely?
This is the memory log
21:00 - 436
21:30 - 483
22:30 - 533
23:30 - 574
discord.js?
yesyes
ooof 😂
meet discord.js caching
Memory leaks always happen with discord.js
is there a way i can get the maximum amount of ram a node.js process is allowed from node.js
You can increase the limit with the startup command
discord.js-light better amirite
sooo, how can I make it not cache and where is it caching most of the times? 😆
Emm another error
Mine is in about 7.5k and apparently it’s using about 550 MB 🤔
client.user.setActivity("INSERT TEXT HERE");
^
TypeError: Cannot read property 'setActivity' of null
client.user.setActivity("INSERT TEXT HERE");
client.on("ready", () =>{
console.log(Logged in as ${client.user.tag}!);
client.user.setPresence({
status: "online", // You can show online, idle... Do not disturb is dnd
game: {
name: "!help", // The message shown
type: "PLAYING" // PLAYING, WATCHING, LISTENING, STREAMING,
}
});
});
That good or bad lol
You can start by sweeping messages, modify ClientOptions so that not all messages are being cached
Put it in ready event
that’s when user is created
bruh mine is in 600 and uses up to 200mb
mine is 550 with 1k users, starts up at 380MB but eats up to that 1G in a day 🥴

mine is in 350 and uses 69mb
nice
ikr
ye
I usually use this one Linux command which can clear all caches
damn
Oh it’s 361
i use repl.it
so uhhh
im trying to figure out what they gave me
since i bought the yearly plan
h elp
use your free AWS instance to forward the messages to AWS lambdas. it will make your instance lightweight
mine uses like 5.8 gb of ram what the
how many servers do you have
w 16k servers
bruh
5.8gb of ram[
Welp this is what happens to the other 15 or so GB 🤣
what the fuck
gonna have to improve that
how did u do that free memory thing
if u dont mind me asking
I use this npm package called os
thanks g
LMFAO 96mb for 369 servers
is this not normal
I used like 150mb for 50 servers in djs
i mean
wtf are they caching
it is discord.js
everything
yes it’s normal then
yes djs is an oof
bruh im using 700mb for 1k servers and 300k+ users
messages, channels, servers, users
should i just clear out my caches
I’m using 100mb for 370 servers
(of course theres a leak somewhere that i havent fully figured out)
periodically
i also have a completely cached user map
ohwaitthatswhatthatmeans
There’s one of those in every piece of software
dont forget i have a completely different user object ontop of that
which is quite hefty and big too
optimisation
i dislike manipulating stuff from other libs
just run everything through jsminify problem solved
optymazatyn
i wont push my custom user object onto d.js's
why not
that'll likely create a ton of bugs, specially with their caching resetting mine
do partials use considerably less memory w djs
Does Eris cache less than discord.js
lmao
you could restart the bot every six hours lol
excuseme
tim holy fuck
tim is a wizard
hes hacking
i really would rather have caching, though i might switch to redis instead of process memory
that’s just a bit more than me and I have like 370 servers
just store everything in swap
wtf tim
OooooooOOOO
fuck swap
no memory usage kappa
aiight, I'll look into it, thank you 😄
i can literally run 20 instances of the same bot for no reason whatsoever and still have 100gb leftover
but why
wha
why 20
cuz 126gb of ram
and not 200
oh ofc I forgot
can you loan me some ram in this trying time
try running 100 instances of mine
i'll just download it from your server
no can do
this is all for me to gurgle on
sftp
Erwin I’m just gonna steal your server
700k guilds for only 14gb ram
srtp
you’ll notice nothing
@quartz kindle what lib are you using?
discord.js-light
take a guess
because that number is insane
lmao
yeye
I get 401 errors after regenerating my token and I did change the token in my code
of course it’s djs light
which makes no sense
djs light is very pog I like it
at first it responds to commands
it would be funny if tim used eris, after having made djs-light
lmao
i tried using eris
hello?
but ran into weird bugs
i have it on the prod server
oh tim literally made djs light
why does my code throw out 401 errors
but installing it locally is a pain cuz windows
idk ask discord
I changed the token in my code after regenerating
it makes no sense
in the first 10 seconds it works
I have a Linux pc for testing
after that
Ubuntu server
it just throws 401 errors
just sits and runs
actually, you know what? fuck it
brb in 30
no sense
what the the
oh god Erwin what are you doing
im just gonna ask untill I get an answer then
why do I get 401 errors even tho I regenerated the token and put the new one into my code
it works in the first 5 to 10 seconds but afterwards it throws out 401 errors
oh I see why
lol
107
0
71
0.45
4.1%
0.4
145
50.0%
129
0.78
0.1%
0.5
0
0
0
0
0
0
0
0
0
-
0
This is the user information I get, but this is tied to one, so it's difficult. I thought, so how do I do it, how to recognize the next digit separately from the beginning and ending point with all spaces left behind?
I want to skip the point where the space starts and ends
what have you done
what are you doing
installing it locally
read what you said before for context
correct
so, i got fed up with my own bitching and whining that im doing it rn
there we go, ubuntu running
wsl?
cool
not as good as my entire pc dedicated to it tho
cli ftw 
i agree
i started navigating through folders with ps on windows
i find it easier and faster to just type what i need and autocomplete with tab
instead of clicking through folders, waiting for it to load...
though i wonder if i can access redis from my windows

rather than putting the code in the vm
tias ig
i assume i should be able to websocket into it
websocket?
iirc redis has support for websockets
cool
so i can run redis instance and connect it via TPC
hpoefully
perfect
now to setup the websocket clients
its annoying that it doesnt list all dependencies BEFORE it tries to install itself
had to install it 4 times
but the test only needed to be ran once
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
By the error, it looks like one of your embed fields is empty
the db values might be empty??
Try console logging your db values
k

members plus was shutdown wasnt it?
db.set(`${message.guild.id}.${message.author.id}.houseAddress`, undefined)``` i tried this but how do i make the value `undefined`?
also this is dev so you might wanna get out
PAIMON FOOD
try it 
dam its only been 30 mins
i'll run the main one
still too early for top gear
heres my token then
Nzc3NGQ0ANg4NDExNjI7HDA0.X6_Kqw.jtTsloTGHFTrJ2hlficlCnYyAu7
there we go
spin er' up
aye aye
user token 
the odds of randomly getting one are pretty miniscule
tokens
Nzc3NGQ0ANg4NDExNjI7HDA0 doesn't even represent the user id 
look, it was a meme, im not actually gonna encode a random id to b64
too much effort for a joke
exdee
developergasm
Internal API
IPC pipe
Top.gg webhook
Redis
Postgres
Discord-SDK
Discord.js
Teyvat Library
what else i got thats notable?
yourself

no
aye?
can you hover over #general void?
voice*
does the buttons and presence display there?
aye
Guys i need help i made this for Count on his status But it say on his status like this
${client.guilds.size} Servers
var statuss = ["${client.guilds.size} Servers","${client.users.size} Members","${client.channels.size} Channels","taybot.ga","${prefix}"];
var secound = 8;
client.on("ready", () =>{
var timeing = Math.floor(secound*1000);
setInterval(function(){
var ammount = statuss.length;
var num = Math.floor(Math.random() * ammount);
client.user.setActivity(statuss[num], {type: 'PLAYING', url: ''})
}, timeing)
});
Help
you're using the wrong quotes
backticks for template literals
i fix it but on his status it says 0 server but he already on 3 server
wheres problem
move statuss and second inside the ready event
also, really, stop using var
okay now?
let statuss = [${client.guilds.size} Servers,${client.users.size} Members,${client.channels.size} Channels,"taybot.ga",${prefix}help];
let secound = 8;
client.on("ready", () =>{
let timeing = Math.floor(secound*1000);
setInterval(function(){
let ammount = statuss.length;
let num = Math.floor(Math.random() * ammount);
client.user.setActivity(statuss[num], {type: 'PLAYING', url: 'https://twitch.tv/taybot'})
}, timeing)
});
you didnt read what i said
can you do ex
does discord.js-light require any configuration outside caching
no, its a basic moving 2 lines 2 lines down
like is it just the normal library otherwise
let timeing = Math.floor(second*1000);
^
ReferenceError: second is not defined
variable scope 
above timeing and below "ready"
thanks so much it work now
thank you sir
Kinda solved the memory crashes, just put those parameters into previously vanilla client constant
messageCacheMaxSize: 1000,
messageCacheLifetime: 310,
messageSweepInterval: 310
});```
And here are the new logs instead of the previous ones increasing by 50MB/30min
1:00 - 440
1:30 - 445
2:00 - 454
2:30 - 443
you have to install top.gg's library and set a webhook
https://top.gg/api/docs?__cf_chl_jschl_tk__=e41035f5ec56d8ce9d7ee164f8d9a8130ca77b0e-1611625940-0-AbKJ1QuAOH_-IB2rFPOVzXdvTtDvAkgsp-arVvp7t4t0bZuEfLlzRrdxk9r52G7hgqUzeXhdX604We1kN_bFCNw26HsWGVY_qujxClSmvkjf0oX_5sfQmFKNkmIgjo-jywSZ_xlYed8rgnqa6zERebsUN52mX12aiX__R3z0cwsxnsSJn0TyWnzEG3FhxAhBnZlHKPKN9x0c2uxAjzzt_7R3j-qtMY9vebSmaI2085ksAv8g-fICIRzytKiltBvLQ9qUUcPk5WbOg5M2b77oDN5piEXxqF2hYCnuUtx7J5WjGz8u3el5VunQJGV3q51UNQ#jslib
I’ve read that and I’m confused
My friend has an auth token and he’s confused aswell
He did it in jda
np
and it has to be an approved bot
you cant use top.gg's api without the bot being approved @earnest phoenix
My friend has an approved bot
He’s trying to help me make it
I’m just confused
Someone said I need a webhook
He said he wants server votes, not bot votes
It’s for a guild not a bot
🙈
it should work the same as bot, no?
It’s very confusing dude I’ve been trying to figure this out forever
No it doesn’t apparently I need a webhook
webhook part should be the same as bot, the only difference is that you'd use the server auth , not the bot
servers does need a webhook
I can do it in java js python php
js would be the easiest imo
Okay how would I do it?
i would assume the node-sdk would work with guilds
cuz i think internally it only checks the auth
let me ping rq
@slim heart oi
do you recall if you can use the sdk for servers?
Including server webhooks?
you should be able to simply copy the example and change the auth key
not me forgetting the name of the package
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user) // 221221226561929217
}) // attach the middleware
app.listen(3000) // your port
npm install 404
this is the example, this is basically what you need
rather than console.log(), you'd dump it into a database
THEN you can reliably get which users voted or not
i can show my vote logs and shapes, one sec
dump into db
dumb into dp
uhm,
just timestamp and user, thats it
please tell me not
not sure, let me check
cu z i accidentally just compiled to the dir and overwrote it if it does exist
berry be paniking
alr
Neither ~/dist nor /dist
So, you're indeed brazillian ain't u?
anybody using heroku and python here? i was wondering how you setup your Procfile to also listen to the Top.gg webhooks
That's something I think ain't possible
It has nothing to do with procfile actually, it's just about the address + port
You see, heroku only opens ports for web dynos
Not worker
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
where would i get the webhook auth from?
im stupid, please adress me with the proper pronoun, stupid
stupid is bronzillian
your server should have it
on the settings page
in top.gg
So you kinda can't have both worker dynos and open ports
oh okay so that
And without ports u can't listen to webhooks
you can run the whole thing in a single web dyno

But it'll turn off after a while
i was thinking i would use web dyno but have some setting so that i don't get this issue Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
So uptimerobot ig
doesnt worker also turn off?
because the bot is working during that 60secs
No
Worker dynos only turn off once a day
Or once you run out of hours
Web dynos are glitch-like
ah
So you gotta ping once every 15 min i think
yes, thats what i'm thinking. web dyno but figure a way to bind the port to shut it up
Web dynos will shut your bot down
thats only if you don't pay right? i'm paying
if you're paying you can run both
yes, but then i'm paying for two dynos the worker and the web
for just webhook functionality
That's crazy but ok
what are you paying for then?
It'd be cheaper and more versatile if you used a vps
i was using hobby but standard now, i needed the preboot
many of my users were facing issues whenever i pushed updates
ahhh, don't talk me into starting a VPS
where should i consider?










