#development
1 messages Β· Page 1775 of 1
you need to send a user with this
not a webhook
and no, you cant send webhooks to a user
so you have 2 options
if u have ur bot accessible in that code snippet, you can use that
otherwise you'd have to use the api to send that
using axios, curl or something else
Hello people. I am new here. I made a new and working bot. How to get it reviewed and posted on top.gg? Any help will be appreciated
add it on top.gg
How? And where
in the website https://top.gg/
login and add ur bot
theres a button at the top
the heck is this?
I am using my bot on the test server. It is working fine.
nice
But i am stuck on a point. The bot code is running on my laptop. Any way where i can get it to the cloud. To make it 24*7 online.
P.S. I am cheap. Please suggest something free
buy a vps
Google Cloud gives you a year free with $300 credits.
There are plenty of other alternatives.
I was thinking about free tier at AWS EC2 server. Any comments?
EC2 can get expensive.
I ran it for a short period.
There is a free tier. Around 1gb of space.
Just cool with me. I am not in a hurry. But any idea, how much time?
I'm aware, but the trial period will expire.
Ahh I see
3 weeks i think?
huh whats that?
python
Everything self learnt. Planned to learn js java in the coming months
fair
JS and java, pog
can confirm
Was never able to enter this channel without seeing erwin say detritus
Sorry this might be a stupid question. But is it safe to share the bot invite url that was generated in the discord bot application with my friends.
i mean would this pose any harm to the bot or the code?
its just an invite url
not at all
Cool.
and you can ake your own invite even without an invite
you can just use the id instead

Oh i see.
and id is public so
Okay
for example
thats ur id btw
just replace client_id with the id of the bot
and boom, you got yourself an invite
luca for example
the forbidden invite

i fell for it
no ads erwin wow!
Okay thanks a lot Erwin.
no problomo
omg this is painful
this is google support GOOGLE
I whent to ask a question about DNS forwarding stuff on my Domain to my VPS and I get this
Vertical Pointing Stick

@bronze vault VPS obv stands for visible pee stains
LMFAO
Very Popular Sus
Vanity per Server
very pathetic server
or is that just the $2 offering π€£
im currently watching my bots graphs to see if i fixed a ram leak
spot the leak anyone? π lol
very pricy shit - 99% of "profesinal devs"
hi me bot need good host
sorry me 9 age cant buy vps
can I add multiple functions to an event like I can do with an express app?
like in Express
const verify (data,next) =>....;
app.get('index', verify, (dat) => {/*code*/})
can I do the same with an EventEmitter class?
like
const handle (data) => ...;
myObj.on('whatever', handle, (dat) => {/*code*/})
Or do I have to code my own system?
lol, dont even joke. someone could right click your message and report you @earnest phoenix
Guys, with what hosting service you host your bot?
no, but you can do:
function on(emitter, event, ...fns) {
for (const fn of fns) emitter.on(event, fn);
}
on(myObj, "whatever", handle, () => {...})
OVH here
mfw the "memory leak" is caching
Im trying to connect with my host, im using bitvise to connect. Iβm trying to input my user password but it doesnβt work? Typing neither copy pasting works
Anyone know why?
Discord.js moment
@lament rock nah thats not caching, thats a new without delete, when handling a certain type of command
Ah I see
caching should show a steady increase over weeks, about the same shape of graph as my users graph
<1GB is really good for how many guilds you're in
this one is users
I need to look at my stats page for my bot
Idk. I leverage the cheweybot stats api. I just have a redirect on my site for easy access. Idk what Chewey uses specifically. I think he mentioned graphjs a while back though.
https://amanda.moe/to/stats
ah, cheweybot is good
i used that in sporks, then took its page, and fed it my own stats db for triviabot
there were some things chewey couldnt do well, like this:
thats fair
I didn't need anything over the top
I do store all my stats in a db, so I could make my own if I really wanted to or needed to
these ones are my stats: https://triviabot.co.uk/botstats/
i got pie charts too, for things like how many guilds use which prefixes, and which languages etc
and thats interesting, a whole three servers play in chinese. talk about wasted effort lol
b u r n
how do you measure network I/O?
the library stores number of btytes in/out/compressed/uncompressed for each shard
i just record differences per minute, divide by 60 to get bytes per second
what do you use to make the chart?
chart.js, mysql and php
and a C++ reporting module within triviabot to post to the mysql
a set of mysql views keep the dataset size sane by taking averages, the older the data the further apart the readings
which is why the older data has smoother curves
damn js gets all the fancy charts
lol, chart.js is the only js part of my entire bot
and thats only because its web frontend
what language do you use for your backend?
php for the site probably?
yes php 7.1
no
i want to upgrade to 8, maybe some time soon
for the bot
C++
shameless plug
cool
https://github.com/brainboxdotcc/triviabot <- bot source there if youre curious!
yeah cant have . in a github name π¦
but i have a lot of names like that, facebook is the same
because they wouldnt release my old name to me
basically, i had facebook years ago... and i closed it down because i thought fb sucked, still do. completely deleted my account. turns out that doesnt delete your pages, fb take 'stewardship' of them, and wont release them
Only problem I have with ditritus is that the api is very unorganized and without looking at the source code yourself it'll be hard to get things going
in the end i filed a DMCA request against my own page they were holding to ransom to get it closed down, but then STILL couldnt use the hold name
and the docs don't help
for now
they put an administrative/legal hold on it
we all working on getting it better
i dont know enough js to say for sure but maybe detritus is the best js lib? dunno
or is it ts?
I don't think y'all should be focusing on guides or example code
isnt the name detritus the hint that its disorganised, detritus means random junk
π
true lmao
that doesn't justify it tho
Everything's all over the place
I have to import interfaces from a million places
interesting π
i didnt realise, but i made my lib in such a way theres lots of ways to make a bot with it, i didnt intend it but the first real world example of a bot someone made with it that wasnt my own, they derived the main class
like you would in py ig
so then they could do like cpp this->some_api_call()
Plus the docs are generated which generally isn't a bad thing but in this case it is because of how disorganized everything is
you'll see a million things in the sidebar that are most likely not what you want
my docs are generated too, its too complex to write them otherwise, not exactly a REST API when youre dealing with C++
got namespaces and all sorts to concern about
discord.js' docs are also generated and they're really really good, but that's because the lib is well organized and well... predictable
detritus is far from that
that's my main problem with it
I know a lot of modern C++ but I don't like it's ecosystem, it's almost non-existant, which means tons of boilerplate n stuff
Discord.js' internal typings are a nightmare
saying it's organized is a blatant lie.
Isn't it written in js
Yes, but you can still make proper use of JSDoc to properly annotate internally
i feel its the opposite. like tim said, its TOO organized
how's that a bad thing
its quite annoying jumping from file to file to find a type
Unnecessary classes which would just be simple interfaces
usually you'd group things together in files
but a lot of the times they are TOO organized in their own files/folders
Why are you jumping from file to file to find a type? It's a js library, all the typings are in a single file, and also, why not use the docs, which are amazing
cuz the docs search bar dont work half of the time

so i use intellisense
detritus
ah thought you were talking about d.js
nah, we moved from there

garbage in the trash can, usable trash(hahah detritus joke) in the table to be used
yeah looking up things in detritus is like going to a treasure hunt in the lib's source code
i would help with the typings if i had time
since im with covid, im not working, and when this shit ends i'll have to commit to work a lot more
write lib in ts
and its annoying af to focus on coding while you coughing half of your lungs out
get well soon
sankyu
but i can do some 30-40m spree
hopefully the docs receieve a good update now that he finished 15.3
slashClient is fully out now
Honestly it's not a problem with the docs generator
i say it is
it's with the structure of the lib
I have a ts project that uses tsdoc and the docs are fine
without examples and explanations, the docs are a mood-killer for any entry level dev
They can have examples and explanations via comments
which is what im trying to do
client.on('clickButton', async (button) => {
await button.clicker.fetch();
console.log(button.clicker.member.id)
const yellow = button.guild.roles.cache.get('842790304607109120')
if(button.id === 'yellow') {
if(button.clicker.member.roles.cache.has('842790304607109120')) {
button.clicker.member.roles.remove('842790304607109120')
let e = new Discord.MessageEmbed()
e.setTitle('Role Removed'); e.setDescription(`Successfully removed the ${yellow} role from you.`); e.setColor('GREEN');
button.reply.send({embed: e, ephemeral: true})
}
else {
button.clicker.member.roles.add('842790304607109120')
let e = new Discord.MessageEmbed()
e.setTitle('Role Added'); e.setDescription(`Successfully added the ${yellow} role to you.`); e.setColor('GREEN');
button.reply.send({embed: e, ephemeral: true})
}
}
});
does anyone know why this only works after restarting?
its supposed to remove/add depending on if they have the role or not
it works once, then i have to restart the bot for it to do the opposite action
Even with explanations it would still be very hard to find stuff. There's just too much shit
which is good imo
its better to provide a full lib than a half assed one
anything you need IS there, its just a matter of WHERE
thats where the examples and better docs comes in
for now the best source is asking in the server if u cant find it
but that shouldnt be the case
it'd be much better to have better docs instead
You could write the docs manually then
thats the plan
probably the fact you use on and don't remove the listener later
remove the listener? wym
gl with that
cake for now at least plans to add comments/tsdocs on the functions
is that client.on inside of a command that gets called often or is it in a root scope
but imo ACTUAL docs would be equally as important
index.js
idk its just weird that it sends that it "removed" the role that i didnt even have
or added the role i already had
does anyone have any bot command suggestions?
make a command that'll dm every user with "FREE NITRO" ads scam

Does anyone know how I can insert information into a message? example: Hello, this is a test and my server is with ${guild.memberCount}
exactly like u did
thats called Template literals
just google it up
Ok
But is it possible to do with a message that a user sent and not bot?
that'd require a selfbot, and will get you banned, as its against ToS
Ok...
why this is taking so long?
oki i might sound dumb but how do i send my bots like code type like how library says null i want it to say JS or JavaScript because thats what its library is
`/workspace/ASTEROID/node_modules/discord.js/src/client/ClientDataManager.js:81
guild.channels.set(channel.id, channel);
^
TypeError: Cannot read property 'id' of undefined
at ClientDataManager.newChannel (/workspace/ASTEROID/node_modules/discord.js/src/client/ClientDataManager.js:81:36)
at Guild.setup (/workspace/ASTEROID/node_modules/discord.js/src/structures/Guild.js:307:68)`
How do I solve it?
You could hardcode it
Channel is undefined
I get it, what do I have to do?
Disord js version? if v11 update it
wdym lol
It's probably due to outdated Discord.js like tak said
You can hard code the library you use
Or if you wanna show the version get it from the library
How do I update, direct npm install discord.I did JS and installed it as a v12. If I erase this and make a v11, it'll be fine, won't it?
that options is deprecated now
in topgg at least
o
aCtuaLly iTs a TranSpilEr
Those cheap ads anywhere⦠
dunno wutchu talking bout

well i have djs-light on my info command as well
Didnt you want to deprecate d.js-light this month when v13 drops?
cause its a rewrite, and judging from the amount of complaints they are probably gonna make it better, maybe not to the point djs-l is no longer needed, but close i hope
also, i dont wanna deal with their shit code anymore
im either gonna transition my bots to no lib / pure api
or make my own mini lib
recommend detritus instead

brb making detritus-light
what would u even change lmao
even the examples in the docs are in js tho
what you have to say about this now mr.Smart pants https://detritusjs.com/#command-client-sample
Documentation for Detritus Client
ts good, frick u
ts is just spicy js
what the hell kind of god forsaken code was I writing here last year https://simp.pics/image/3XXrO6xMwIkwpS6o
lmao
const rollRandomNumber = (num: RandomNumber) => num
Xet ??????
are you ok?
im just gonna drop this here to make u feel a lil bit better
please tell me you wrote this
i wrote this too
how???
in the first 2h of learning js
yikes
Hmm, those screenshots make me want to commit Seppuku.
I, of course, only write amazing code
any code that isnt amazing just wasn't written by me
ofc
How dare you
Typescript is the language of the gods of js
js is weak compared to ts
Ts is our lord and saviour
All hail the power of typescript
Yes
how can i host some javascript files on my site like mysite.com/script.js
and then use them as cdn's on my other sites
If you are using something like express you can put em in your public directory and server em statically or whatever its called
it's like a landingpage
i got 350 domain names and i'll control them from 1 js file
so i need to use it as a cdn
You bought 350 domains
well yes
may I ask why
cuz my customer wanted em
is it like the same domain on 350 different TLD's?
no
He wanted 350 domains
350 different domain names

mhm
he wanted me to make some good SEO
some fresh content
so he can get the price higher based on the visits
but i'll control all his paypal links from 1 file
ez
hosted on 1 main site
you have no server at all?
no
pain
you need to host it somewhere
Yea
i did the github thingy
with this
The pain it will feel to setup nginx for all of them
but he wants me to do it with one of his domain names
i wont lmaoo
pfft
i aint gonna point all the domain names to a vps
and waiting hours for all the nameservers on them to update
as well as changing the dns records to point to the IP
i wish i could make https://www.jsdelivr.com/ work for custom domain names
Sounds like fun
idek if i can get it to work like that
Probably can
rip
you can try setting one of his domain names as a redirect
to the file on github
oh
lol
do u know anything else like jsdelivr
maybe they have options for custom domains
and not just github
And each one displays one word and each word makes up a sentence
the game is to remember each word

bro what
It is me speaking nonsense
E
Honestly tho that would be funny
Just make each domain display a character
and it spells out a youtube link
the js i've used for his sites killed me
lol
a lot of clicks
price high
E
python gamers
how can i have more than one subdomain in flask
so like: sub1.sub2.domain.com
well I don't think that is how subdomains even work.
Your subdomain is prefixed on the main domain. I don't think you really wanna stack em on each other that would get confusing
alright
also wot does this mena
mean*
AssertionError: View function mapping is overwriting an existing endpoint function: payment_webhook
ok i fixed it
Hi
Thereβs nothing wrong by using deeper DNS levels to handle your stuff.
But I guess he has issues because his DNS isnβt set up properly.
If you wanna listen to multiple/all hostnames make sure to create a wildcard in your DNS with the same target.
(e.g. *.sub.domain.com)
``` returns undefined, not sure why (remaking a cmd handler from anson devs tutorial since my old one was messy)
can someone explain to me why
[1,2,3].join``
works ? (JS/TS)
been doing JS since 1998 and some kid just threw this at me
mind blown
what in the fuck
@quartz kindle?
Exactly what I said lol
right?
with the ``
good question
wait what you're old
man
bro -
Does it have to do with the prototype?
????
since 1988
maybe
1998*
@ruby sun you've been doing JS longer than most people here have lived
what
ig u have more than 30
of course
Most users here are 14-18
wat
I'm almost 24 myself.
I have 14 and middle
L

damn man
I know your feeling my guy.
how life treats you π
does people older than 30 use discord lol
of course
im going to start using `` for functions to fuck with people
thank you for sending that here
LOL
np Million
I'm new to using public APIs, what would be the best way to extract some of the data out of a JSON response like this in js? ```json
{
chess_rapid: {
last: { rating: 761, date: 1622040874, rd: 38 },
best: {
rating: 1215,
date: 1609875931,
game: 'https://www.chess.com/game/live/6529890705'
},
record: { win: 121, loss: 106, draw: 10 }
},
chess_bullet: {
last: { rating: 515, date: 1621969059, rd: 100 },
best: {
rating: 1023,
date: 1614054833,
game: 'https://www.chess.com/game/live/9572121805'
},
record: { win: 2, loss: 11, draw: 0 }
},
chess_blitz: {
last: { rating: 332, date: 1614897727, rd: 111 },
best: {
rating: 1118,
date: 1612282413,
game: 'https://www.chess.com/game/live/6427598544'
},
record: { win: 3, loss: 12, draw: 0 }
},
fide: 0,
tactics: {
highest: { rating: 798, date: 1612888354 },
lowest: { rating: 772, date: 1612888446 }
},
lessons: {},
puzzle_rush: {}
}
it's messed up right lol
impress your peers with brainf*ck-level of js
imagine a 95 yr old progamming it would be [candy,crush,cool] string
Depends if you set your TS environment to ES6 or not I guess.
the same way you extract any JSON data I guess?
Well if I'm trying to get to chess_rapid.last.rating, is there anything wrong with just saying ```js
let CurrentRapidRating = MyJSON.chess_rapid.last.rating
what the fuck
how the fuck
I've never really done anything with JSONs before
and why the fuck
i refuse to believe this is intended functionality
nothing wrong with that!
same lol
alright, just making sure I'm doing things the right way, thanks!
np!
I know about that
forgot its name tho
actually chalk has some pretty good examples of where it could work
talking to me?
oh ok
instead of doing
chalk.cyan("text")
you can do
chalk`{cyan ${anything here lol}} {red ${something more lmao}}`
these are called tagged template literals and are from ES2015
^
^ also u
I'm 30++ Why?
Because the fact that I was doing JS in 1998 blew his mind away lol
Β―_(γ)_/Β―
ok then, keep your secrets
the fact thay there are people here born before the 2000s blows my mind
The fact that people from the generation who built the modern-day internet are on the internet blows your mind ? 
Pretty sure half the staff working at Discord are +30~40
alright
it doesnt "blow my mind" its just cool to think

that like bot devs arent just a bunch of 15 year olds
Yeah, diversity is good
part-time tech related
I have a business totally not tech-related
which takes most of my time
Yeah I have one
why dont u have the role then?
havent added it?
oh boy i remember i waited like 6 months for them to get to mine
it was all time high
Still waiting for approval, probably not gonna happen until August at this rate
not that I care about waiting π€·ββοΈ
not helps, it fucking like THRUSTS your bot into fame lmao
topgg is like my only form of advertisement
and i got from like 100 servers to 1.4k
for basically no effort
It's a real-time earthquake warning for people here in Japan
yeah
only bot ever that isnt useles
less*
just a suggestion
maybe make a role setting
where u ping the role
I guess there's no harm in doing so
the channels where alerts are sent is already server-owner specified though
I like having the alerts to be seen by everyone as people can check on others
Had a few +M6.0 quakes lately
Yeah but Discord isn't really a thing in Japan 
I don't have any intentions to do so, sounds like a lot of work
I'm plugged directly in the seismographs here
so I actually get alerts before even feeling the quake
the organization owning those take applications
and u live in japan
ok ur bot is really useful lmao
TS
I only do Python when I actually need performance
python is the antithesis of preformance
I'm less comfortable writing python so I only do it when it's really necessary
lmao
Python is way more performant than TS
python is as scared of performance as a backend dev doing css
Hey
piefon
oh boy ts is garbage then
People today are not writing Python for performance.
They're writing it for convenience.
i use python for everything
its just not fasr
but i love it
python and i are in a 1 year long commited relationship
1 year long 
get married already
py3 is pog
whats the turbo button?
it was the first time I understood the term "false representation"
it was a button on PC which basically reduced the speed of your CPU
lmfao
On IBM PC compatible computers, the turbo button selects one of two run states: the default normal speed or a reduced "turbo" speed. It was relatively common on computers using the Intel 80286, Intel 80386 and Intel 80486 processors, from the mid 1980s to mid 1990s. The name is inspired by turbocharger, a device which increases an engine's power...
found an article about it
@ruby sun fr?
How do I extend the length of an embed in djs? My embeds are automatically putting inline fields on new lines because it runs out of space.
width? You can't
I don't think that's possible
you could try to workaround it by making just one field with all 5 names in the title
the description will look a bit weird though
thats because there is a thumbnail
maybe you could try putting it in a code block?
something like
Rapid Rating Stats
CR BR W L D
761 1215 121 106 10
he meant add more inline fields to the same line, I thought
I think I'll stick to just paginating the embed so all the data can fit instead
yo uh im making a discord bot that uses ai to mimic how people talk by recording conversations and it works but it doesnt look pretty
if anyones a frontend dev who wants to team up let me know
what front end is there other than sending text?
idk like help menu
oh wait like what if since each person has their own ai when you're being mimicked it would nickname itself and change its pfp
oh that'd be cool
is it possible to terminal log data in php
Can someone help me please?
It's easier if ask what you need to help with, rather than asking to be helped
someone knows how to send this information, is that the description of the embed comes out empty
let NivelesMap = niveles.map((v, i) => {
fetch(`https://gdbrowser.com/api/level/${v.id}`).then(res => res.json())
.then(x => `**${++i}.** [${x.name}]() Por ${x.author}\n β’ **ID:** ${x.id}`)
})
const NivelesEmbed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true }))
.setDescription(NivelesMap)
.setColor("#00FFEC")
message.channel.send(NivelesEmbed)
"niveles" is an array of objects
I don't know js, but try sending the embed with a string for testing
I don't think can send an array
if someone knows they ping me
Is there any way to set a default value for a variable if the value assigned to it throws an error? For example I have this code:
let CurrentRapidRating = ChessStats.chess_rapid.last.rating || "No matches played"
``` which does not set the value of `CurrentRapidRating` to `"No matches played"` when ChessStats.chess_rapid is undefined
you could set props for the entire object
if (!ChessStats.chess_rapid) {
ChessStats.chess_rapid = {
last.rating: "No matches played",
};
};
something like that
or use ternary operators to do something like
let CurrentRapidRating = ChessStats.chess_rapid ? ChessStats.chess_rapid.last.rating : "No matches played"
good idea
I'll try to figure something else out that works for many variables at once, since I would rather not do that for 15+ variables, but this will work as a temporary solution
Newer version of node support the nullable operator, so you can do:
const CurrentRapidRating = ChessStats.chess_rapid?.last?.rating || "No matches played";
Didn't know about that, thank you! Worked perfectly.
you got ratelimited
try to figure out what caused it, if you login automatic after a disconnect make sure to add a delay to it bcs you have a limited amount of logins per day (normal bot about 1000 times)
Nope
client.on("warn", console.log)
client.on("debug", console.log)
someting caused you to get ratelimited
First it consoled Preparing to connect the gateway
429 is the Error code for Ratelimited
Or how can I fix this
you have to wait, the debug event should tell you for how long you are ratelimited
yea thats normal with the debug event
does the theme matches the version of the software? maybe the theme is ancient and with newer versions they changed some stuff
can I make a specific property in an interface which could be undefined, defined using any utility types?
Like a partial?
for example, here I just want the b to not be undefined.
So the obj, should have, a and b as required
type Test = {
a: string
b?: string
c?: number
}
const obj: SomeUtility<Test, 'b'> = {...}
Hmm, might have to do this:
Omit<Test, "b"> & { b: string }
Otherwise you could make your own utility type for it.
You using javascript? Maybe use optional chaining
na na, that was a ts question
let customer = {
name: "Carl",
details: { age: 82 }
};
const customerCity = customer?.city ?? "Unknown city";
console.log(customerCity); // Unknown city``` The example it give
It will log "unknown city"
Omit<Test, "b"> & Required<Pick<Test, "b">>
@long crow he wants a typescript type
Just make all the other properties in he interface optional and the b property required?
also wdym a and <b> should be required
I dont hv access to Test as it is coming from a lib.
so i wanted to change that, with Utilities
hey
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', message => {
if (message.channel.type == 'dm') {
return message.channel.send("Si tu as un quelquonce problΓ¨me, je te conseille de contacter le #πγ»support");
}
});
client.login("ton daron c'est mega")
when the bot
recieve a message in dm
the bot spam
:/
This is fine right? @pale vessel
type MakeRequired<T, S = Test> = Omit<S, T> & Required<Pick<S, T>>
const obj: MakeRequired<'b'> = { ... }
when the bot recieves a message you arent checkig if the bot sent it in the dm
coz, the bot responds to itself, in a recursion
how to stop the loop?
that's why it spams
return immediately if the message is coming from a bot
message.author.bot
How do I change my bot's nick in all servers on "ready"?
Why
I want to include the prefix in the nick
the name of the bot is IsmailZ 2.0 so the nick will be [!] IsmailZ 2.0
So d'you know how to do it?
you should put your prefix in the bot's status
not in it's nickname
not all servers will give your bot permission to change the nickname
oh
yeah
I don't really care lol
They can edit it later
they'll have to edit it every time your bot restarts
at that point they'll just turn off it's permission to change nicknames
Just use your bot's status
@rocky hearth
Then how to set it that it will change it's nick when it joins a guild? (with guildCreate I think)
or nvm
I'll just use the status lmao
im getting on my pc just to see if that exe is infectionous
.net program per usual
they stored an entire virus dll
hardcoded as a byte array
in hopes that it'll fly by an antivirus
OH THEY SENT IT HERE TOO
that person is a moron lol
just delete from your pc kthx
Have a look at the Hatching Triage automated malware analysis report for this redline sample, with a score of 10 out of 10.
if you want the analysis stuff
yeah im going through the dll code now
this is such a badly written virus π
it isn't even obfuscated properly
ping me next time when someone sends a virus in here 
I kind of did and you said nah
oh
lmao I thought that link just went to a message in the same channel, not in #development
my bad 
Hey at least they made it themselves
probably not the only one who analyzed it tho
It do be FpsBoost.exe.exe
it's effort that counts

they thought that using file:/// would go around windows checking file calls to the kernel i guess??
but file:/// literally does that except it's done for you
is this x new
InternalOAuthError: Failed to obtain access token
at Strategy.OAuth2Strategy._createOAuthError (/home/runner/MBL/node_modules/passport-oauth2/lib/strategy.js:408:17)
at /home/runner/MBL/node_modules/passport-oauth2/lib/strategy.js:175:45
at /home/runner/MBL/node_modules/oauth/lib/oauth2.js:191:18
at passBackControl (/home/runner/MBL/node_modules/oauth/lib/oauth2.js:132:9)
at IncomingMessage.<anonymous> (/home/runner/MBL/node_modules/oauth/lib/oauth2.js:157:7)
at IncomingMessage.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)```Getting this error when trying to login on my website using discord
@rustic nova
@ me thanks :)
oh
so i have this code that should change the slowmode based on the amount of messages sent in the server and everything works fine except line 17 because it doesn't set the slowmode to 0 but the messagecount in guilds.json is 0 can somebody help
https://srcb.in/DWuvSmEKnv
My bot can't join Stage channels for some reason
It sends an error "This channel does not exists" in the console
And if I let it join a normal vc and move it to a stage channel later, it just disconnects
hi
huh
You can chat there
anyone?
what language
Discord.js
They can
All music bots I know can join stage channels
MEE6 can't become a stage mod tho
but Rythm etc can
But my bot can't even join the channel
It directly disconnects
don't ask there
it's probably lib related
they most likely won't be able to help you
what lib are you using? if it djs v12, it intended like that way
only v13 added support for stage channels for v12 stage channels are unknown
beacuse discord.js not supported stage channels
if you are using
Which one does then?
Cus all music bots I know can join stages
Yes I think that's what I use
Discord.js
discord.js v12 π
discord.js v13 will support
When will it be useable?
It technically is
While its still in development
its the master branch of discord.js
And I need to rewrite my whole script huh?
Well depends
My kiddo will never be in a stage channel then
v13 doesn't really introduce anything game breaking yet i don't think
So not a lot of rewrite
If my bot can join a stage channel it is game breaking 
I am not even sure if bots can to begin with
Wdym?
just like Rythm
I haven't seen rythm go into stage channels so idk
But I assume it just has to do with getting the stage channel and telling the bot to join it
and making sure it has the right perms to speak
Check my status and click "Listen in"
I'll show you
no thanks
as stated I don't know how to do it
but probbaly just takes getting the stage channel and making em join it
I assume a stage channel is similar to a voice channel with limitations
If I drag my bot to a stage channel it auto disconnects
Yes and people can't speak in it, only Stage Mods can and they can accept requests
do npm ls discord.js
My bot is a stage mod
K
Ask in the support server for discord.js then
idk
They'd be better suited for this question
v12 doesnt support stage
k
Can you give me a link?
nvm
v12 can only recognize stage channels iirc
since it was breaking code if they didn't implement that much
Yep
all v12 has for stage channels though is telling its a stage channel
nothing more then that

(node:26) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of null
at Client.<anonymous> (/home/container/index.js:135:204)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:834:20)
(node:26) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Which line is the error?
(can't understand error messages yet)
I'm validating slash command names. The docs say it has to match ^[\w-]{1,32}$ but /^[\w-]{1,32}$/.test(name) always returns true even if there's a number in there
there shouldn't be a number in there because of the anchors
Ask regex gods
wait
i can just match the string with the regexp and check if it returns the exact same string
it works
:)
how code
The reason being that \w also matches numbers
[a-zA-Z] should work
\W is only letters, right?
\W is everything that's not an alphabetical character
Non alphanumeric (uncapitalized would be the opposite)
Regex is pain
regex is fine
(node:26) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
at async MessageManager.delete (/home/container/node_modules/discord.js/src/managers/MessageManager.js:126:5)
at async Client.<anonymous> (/home/container/index.js:134:36)
(node:26) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
``` Where (which line) is the error?
uhhh almost all
unknown message means you tried to access an invalid or deleted message
Oh
this can happen on messages.fetch(), message.edit() or message.delete()
What's an invalid message?
so it's not my fault if that error happens
not a bug in my code r smth
it is your fault that you dont handle it
you need to have code to handle the possibility of the message you are editing or deleting hving already been deleted
I hate handling errors smh
where to place it tho
the discord api
Where I fetch the message you mean?
yes
okayyy
fetching, sending, editing, deleting, etc... all of those send requests to the api, therefore they may fail
client.channels.cache.get ()
is this counted as fetching a message?
One message removed from a suspended account.
they dont access the api
you're a weird female api
cus someone said that I can use client.channels.fetch() and client.channels.cache.get() and that they both are the same
they overlap a bit but have two different purposes
get -> try to get object from the cache, if not found return undefined
fetch -> try to get object from cache, if not found try to fetch it from the discord api
fetching from the discord api needs to be awaited, and may fail
return undefined = error?
no
ok
fetch will error if not found, get will not
because when fetch doesnt find, its a discord api error
I only edit message once
in my whole code
so I have to put this message.edit().catch(console.log) there?
its generally a good practice to catch errors on all requests
even channel.send() can fail
if you dont have perms, if the channel was deleted, if your bot was kicked/banned
if the bot doesn't have perms
If the bot doesn't have perms
yes
that's sad
async operations are vulnerable to race conditions
I have to use this message.send().catch(console.log)?
since they take a while to take effect, due to latency and network speed, other operations can happen in the mean while
Be a chad and don't catch anything
for example a channel can be deleted while the bot's message is in process of sending
so all api requests can fail
hence its good practice to always have error handling
yes that will log the error instead of crashing







"