#development
1 messages · Page 1254 of 1
could do but that'd be very janky
you could segment the apps
i already requested priviledged limits to twitch, just waiting for a response
hopefully they accept and i dont have to deal with this shit
verified bots have 2000/10s limits
while i get 20/10s
different api
oh
make a unique bot per user of your bot
that sounds like a memory issue
discord bot dev community continues to become more and more toxic
they can each run on separate machines
sounds like a vm clusterfuck
also 20 tokens per app iirc
verified bots get different ratelimits??????
@digital ibex i mean thats a smart idea to do
cause like
theres a limit to how many tokens you can generate
you dont want unverified bots being able to nuke shit
the 21th will cancel the 1st
but you want verified bots to do mass actions that are actually user-requested across hundreds servers
i understand why
yea it was jsut an example
scaling on twitch is one pain in the ass tbh
no sharing
no ratelimit checking
poorly documented shit
i just misinterpreted the thing, the uhh badge and verifying the bot
sharing is caring
snippets provided in docs are outdated
There's no header for rate limits really?
some of the api old endpoints still work
there are shit that i receieve on the message payload which are deprecated
but still works
I've seen some bad APIs, like Hypixel's one
so in my head, i was thinking u cant verify ur bot anymore
but i realised
pls help
you in for one hell of a nightmare
Unknown Emoji
i want to do something that isnt saturated as fuck like discord bots are
add a try catch block @modest smelt
ok
like?
hmm
im learning java cause thats the only CS course they have @ my school
a game or something
Web server? Command line tool?
Hi
hi
how do i make a try except block such that if it doesn't work, i will get to know the error?
Use try: ... except: ...: https://www.w3schools.com/python/python_try_except.asp
await reaction_message.add_reaction(numbers[i]) put it around here
If you're into reading bibles: https://realpython.com/python-exceptions/
yeah im sure its the library now
100%
i finished the query and then right after the library threw an error
imma start a ticket on their github asking if they have an internal ratelimiter
Yeah it's a horrible API
When they added SkyBlock support
They'd give you just the ID of whatnot, so you'd need to make a request for each of them
and most of their endpoints and what they return are undocumented
I still remember trying to convert a PHP class to a JS one just to get a player's level when I didn't realize someone make a wiki on how to calculate the player's level.
A single /player API request can be 2 MB+ in size for someone who plays a lot. It stacks up.
hypixel devs are a bunch of rookies
Oo
which is why everything is a mess
the api is so messy because they just pull every single entry from their database
up until recently they used json files to store game & world data
then they migrated to mongo

it's just a bunch of 15-18 year olds thinking they're senior level programmers
when they're just in fact stealing code snippets
tbf no one with a degree would work at hypixel for such a low pay
hypixel's api is a mess
their namings are a mess too
eugune
@earnest phoenix how do u know its a low pay
simon posted job listings
it's just a mess
kind of minecraft itself
built on trash legacy code no one ever bothered to fix
so what you end up with is a huge dumpster fire
aka why minecraft is so slow and ram intensive and why hypixel has lag spikes every nanosecond
This image sums it up well
yeah im sure its the library now
@opal plank https://kooleyy.is-inside.me/qEgu9v5Q.png
twitchjs
the one you put a thing on
yeah that one
i absolutely hate that their lib swallows to many errors
did you bother reading that issue?
'Just try/catch everything'
feels bad that you cannot see all my private repo commits
@thick gull
did you bother reading that issue?
@opal plank no
oh i remember that lmao
its kinda bs tbh
i forgot how to use the express router send help
*pings tim*
@earnest phoenix the docs are biiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiig
i cba
i think i have officially bothered everyone i could about this tbh
twitch staff, twitch forum mods, librabry devs, proficient devs
did i miss anyone?
app.plsRoute("magix", result => {
result.send("nice website with animation and responsive pls kthx")
})
cries
lol
im going to get more into front end soon
though i'd probably be moving away from express into Koa
@quartz kindle have you tried Koa?
@opal plank nope
and they're still misusing it... and storing worlds in mongo
@earnest phoenix WORLDS
WORLDS
IN MONGO

@quartz kindle have you tried Koa?
@opal plank at A KOA rn
koa seems fun
ACID compliant db's
Im afraid my request might be denied
upon reading the guide i found out that i should've specified the ratelimit i wish to be granted
though i didnt specify, simply put 'this isnt enough, pliz increase'
@umbral zealot do you know if koa has some similar things from express such as slow-down and ratelimit?
well, I mean, probably not built in
things like those are a pain to code manually
it's something that's either available as a separate package, or you can write the middleware yourself
thats the issue
they are quite complicated to do
while i COULD, i rather not
web isnt my forte per se
I mean...
they are different
this would be the ratelimit
There are a lot of options for you in terms of rate limiting
the one im speaking of is slow down, it increased the response of each request
its exponential ratelimiting iirc
I mean, you could just add a setTimeout in there lol
{"error":404,"message":"Endpoint not found"}
got this error while doing oauth, i want to put it into a separate route dir/file and this error keeps occuring
hey can somebody help me
with?
how do i make these return values to an embed
ar loss = Number(ls.get(userLS)) - (bet);
ls.set(userLS, loss);
endGame(user);
return `\`Croupier stands with\` ${newTotal}\`; Croupier wins, **\`${user.username}\` loses**.\``;
}
else if (newTotal == userTotal[0]) {
endGame(user);
return `\`Croupier stands with\` ${newTotal}\`; **It's a tie**.\``;
}
else {
var gain = Number(ls.get(userLS)) + (bet);
ls.set(userLS, gain);
endGame(user);
return `\`Croupier stands with\` ${newTotal}; **${user.username} \`wins**!\``;```
make an embed with the string results in it
could you give me an example?
"return" means you have a function, and this function will return that string. Just assign that return to a variable, or use the function directly in the embed builder.
Learn more about how functions work here: https://js.evie.dev/functions
function doThing() {
return 5+5
}
new MessagEmbed()
.addField('result', doThing())``
idk the actual usage of d.js
but that's how you return
hmm okay
i will try my best
just one moer question
unction userHit(user, message, prefix) {
var cardsObj = ls.getObj(user.id + "blackjackGame");
var card = new Card(randCard());
var total = arrCardCalc(cardsObj.userTotal);
var newTotal = total[0] + aceCheck(card.toInteger, total[0]);
var userLS = user.id + "profile";
var bet = Number(cardsObj.bet);
message.channel.send(`${user.username} drew ${card.val + " " + card.suite}`);
if (newTotal > 21) {
const embed1 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username}\` busted; Croupier wins,`, value= `**\`${user.username} \`loses**.\``)
.setFooter('Command hosted for Kings Family!')
var loss = Number(ls.get(userLS)) - (bet);
ls.set(userLS, loss);
endGame(user);
return (embed1)```
wouldn't this just work?
i just wanted to know
as i want to change my whole code
that is really long
i also cannot test this specific message
otherwise i would have to win the blackjack with 21
which is unlikely to happen
I'm a noob, should I use mongoose, MongoDB, MongoDB cloud or whatever?
Errors found:
```ReferenceError: embed3 is not defined
At ReferenceError: embed3 is not defined```
well, you didn't define a variable called embed3. ..
const embed1 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username}\` busted; Croupier wins,`, value= `**\`${user.username} \`loses**.\``)
.setFooter('Command hosted for Kings Family!')
const embed2 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username} has blackjack;`, value=`${user.username}\` wins, doubled the winning amount**!\``)
.setFooter('Command hosted for Kings Family!')
const embed3 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username}, \`hit or stand?\n`, value= `${prefix}hit\` or \`${prefix}stand\``)
.setFooter('Command hosted for Kings Family!')
var loss = Number(ls.get(userLS)) - (bet);
ls.set(userLS, loss);
endGame(user);
return (embed1);
}
else if (newTotal == 21 && total[1] == 1) {
var gain = Number(ls.get(userLS)) + (bet * 2);
ls.set(userLS, gain);
endGame(user);
return (embed2);
}
else {
cardsObj.userTotal.push(card);
ls.setObj(user.id + "blackjackGame", cardsObj);
return (embed3);
}```
Ah it's because you don't undertand scopes
hey, im having an issue with discord oauth. im trying to separate all my routes and paths into different files, and before this it worked fine but now its returning 404 endpoint not found
huh, what did i do wrong then?
because i had it in a if scope?
Errors found:
At ReferenceError: user is not defined
okay my code broke```
please someone help me out
+help
im making the "userinfo" command to display badges, is .concat a good method to make the badge stuff?
or is better to do array to string?
It´s is possible to make a portal that people log in with some credentials and then a bot gives him a verificate role on his discord??
use oauth
const Discord = require ('discord.js');
var ls = require("./ls");
var rand = require("./random");
var user = message.author
const embed1 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username}\` busted; Croupier wins,`, value= `**\`${user.username} \`loses**.\``)
.setFooter('Command hosted for Kings Family!')
const embed2 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username} has blackjack;`, value=`${user.username}\` wins, doubled the winning amount**!\``)
.setFooter('Command hosted for Kings Family!')
const embed3 = new Discord.MessageEmbed()
.setColor('#ff0000')
.setTitle('Blackjack Casino Game')
.setDescription('*Shows all the game results!*')
.addField(name= `${user.username}, \`hit or stand?\n`, value= `${prefix}hit\` or \`${prefix}stand\``)
.setFooter('Command hosted for Kings Family!')
module.exports = {
commands: embeds
}```my message is undefined?
could anyone help me with this one ?
``` .addField(name= ${user.username}\ busted; Croupier wins,, value= `${user.username} `loses.``)
are you sure of that?
shouldn't it be in {}
i mean what is name= for?
shouldn't it be
.addField("Field name","Field Value") or .addField(name="Field name",value="Field value")
?
use oauth
@earnest phoenix but that is to log in into my website with discord, right?
i think that this is also good
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)```from the docs
@earnest phoenix but that is to log in into my website with discord, right?
@tight flame that is also for credentials and can be used for verification
shit i have an idea
i have a good idea
this is the best idea
so i can do that, if they log in into my website it gives permisions on the discord?
but login without discord credentials
so my website must have oauth?
Yes.
can have dm with you @misty sigil ?
no
oh okay
Anyone know how to use the OAuth of external API to change permisions to a user in discord
hey boys
message is not defined
probably in the var user = message.author
but how do i fix it.
Anyone know how to use the OAuth External to verificate a user in discord (by changing his permisions)
Anyone wanna break my bot???? And then figure out how to improve it
Ping me if yes
should be fairly easy
Anyone wanna break my bot so it gets rate limited again and possible have its token revoked?
everything i touch breaks
destroys ur server and deletes all the code
laughs in github and backups
sad
ar em ar eff
typescript bot
i have a question
just ask
wdym?
do you KNOw the user?
no i mean like this:
@client.command()
async def userId(self, ctx, member: discord.Member = None):
if member == None:
user = ctx.message.author
await ctx.channel.send(f"The user ID for {user} is: {user.id}")
else:
user = member.message
```haven't finished
what should i do?
@opal plank ?
erwin best py dev, dont lie
nah, js dev here
can someone help?
the docs can
kk
Anyone wanna break my bot so it gets rate limited again and possible have its token revoked?
@opal plank lol
in case you missed the joke
client.on('message', message => {```
literally have this in my code
message is still not defined
@eternal osprey what do you mean it's not defined?
what is a shard?
@modest smelt what do you mean fluent with json
@misty sigil why u said ill come here
if you can code well in json... @misty sigil
programming language
ik
ok what do you need
basically i have this code
@earnest phoenix this is where development help is
Yes?
ok
{"747929495427874836": 749316268414337104}
this is a json file
the keyname is the guild id
and the value is the value
No
?
@misty sigil is there already an veryfieng bot
dont do it
dont use json for a database
smh
@misty sigil is there already an veryfieng bot
@earnest phoenix what?
Like
why?
İ dont want my server raid again
there are many.
https://top.gg/bot/580578395411185664 comes to mind
its made by tim so it gets my stamp of approval
the same tim behind discordjs light
ok lets talk about that l7er
l8er*
can someone help me make a customizable prefix?
Brehh@misty sigil
The bot thinks am a bot
Robot
@misty sigil can i send u an dm
uhhhhhhhh
uh
no
can someone help me make a customizable prefix?
@modest smelt Use a database
No.
Yes.
İs there an bot like mee6 dyno carl Owo chips in once
once?
Yes
wdym
All those bots have other commands
i am making a bot
that does a lot of things
currency bot
moderation
tickets
welcoming
What are tickets
basically only admins and u can talk
like if u have a question
my bot is called The Everything Bot!
it can also make polls
Lol
İ just want moderation and verification bot etc
Lemme see
DM me
No Invites here
?
i wouldnt advise it they use a json database
im working on invites
@modern sable
we're converting to mongo
@modest smelt dont ask others to invite your bot
i asked this question before but i didnt get too much support:
Read.
how do i use keyv with sharding
i decided that I will completely start over my discord bot
how do i use keyv with sharding
i decided that I will completely start over my discord bot
how many servers is your bot in
"one" (for my test bot) im starting over because i know im gonna need sharding soon
and yes i know when im actually gonna need to start sharding
im gonna need to make sharding when my bot is 2.5k servers
so im just preparing for it
my actual bot is around 200 servers but still...
did you mean 2.5k
how do i use keyv with sharding
You asking that question makes me worried
there isn't much code you have to change
i never done sharding before
each process will simply open a connection to the database
wait so..
i could just
let Keyv = require("keyv");
let db = new Keyv('sqlite://database.sqlite');
basically ^ to my bot.js
(yes i do have a index.js alr)
does anyone know how to get and make changes to multiple user stuff in json file
{
"298588307368050698": {
"weeklyDonation": "69"
}
}```
something like that
if you're sharding via running index on every shard then yes
if i have lots of user how can i change the weekly donation at once
but I wouldn't recommend spending the effort sharding now, you should do it once you're certain your bot will grow above 2.5k
if you're sharding via running index on every shard then yes
@split hazel so if i added the shard manager onindex.jsand i madebot.jsbe the bot file, i can add:
let Keyv = require("keyv");
let db = new Keyv('sqlite://database.sqlite');
on bot.js?
wait what
that should work yes
the database doesn't stop you from opening multiple connections
something i learnt today hm ok
so no one can help me?
Speedy
they're designed to handle multiple connections
do you mind not shitposting
@stark abyss I highly recommend not using json dbs but
let file = require("./NAME.json");
file.USERID["weeklyDonation"] = "THING";
I am just json file because the max number of user is gonna be no more then around 25
this is different then what you think
keyv is a lot easier than json dbs
oh
I think you misunderstood me
I know how to get one's thing
i wanna get all of the userid and then change their weeklydonations
like reseting it to 0
use Object.keys() on the object to get the array of user ids
loop through the array and set each individual user's value to 0
you may have to teach me how to use Object.keys()
Object.keys(userid)?
wait what is it doing?
it returns an array with all of the object's properties
okay
for example
Object.keys({a: 1, b: 2, c: 3}); // ['a', 'b', 'c']```
ah so I can for loop it
now how is it possible to get a guild by id wait i just found out
nvm i dont know how to do it with the manager variabl
assuming you're still doing the sharding thing you need to use broadcast eval
since your guilds are no longer all in the same process, they're split in multiple ones
so instead of <client>.shard.broadcastEval('')
i would use <manager>.broadcastEval('')
fs.writeFile ('./donations.json', JSON.stringify (donation, null, 4), err => {
if(err) return console.log(err + " error found")
message.channel.send("Message Written! ")
})
``` I am doing that and it puts it in
```css
{
"298588307368050698": {
"weeklyDonation": "69"
}
}```
But I don't want the number 69 to be a string because I want to add to it
i don't understand how json works thx in advance
screeches in database noises
I wouldn’t use json for heavy weight database stuff. Json has a hard time handling heavy weight data, data that changes constantly. I would recommend you think about using either mongodb, MySQL, SQLite, or quick.db instead.
I mean you can use those as well
npm i jsoning 😎
And it was because I never actually used them
postgres >
Quick.db is the easiest to use
but also not the best
it gets the job done
definetly going to recommend using postgres for a 25 max row table
its like using a an industrial level cutting saw to break a thin stick in half
what's donation?
it's a string because that's how it was in the first place. is it from your args?
you can parse the string as numbers, Number(string) and store that
wait wat
just need to make sure that it's an actual number since it could be NaN
ok
you can parse the string as numbers,
Number(string)and store that
didn't understand this part
args[0]; // "hello"
Number(args[0]); // NaN
args[0]; // "22"
Number(args[0]); // 22```
it tries to convert strings to numbers and return NaN if it fails
How do I get emoji information?
ex: /info 
for example message.guild.emojis.cache.get(args [0]) searches by emoji id.
You need to parse the raw argument to get the ID.
discord.js has emoji.identifier so you don't need to type it manually
never mind, it doesn't have the <>
well anyway you can use emoji.toString()
args[0] == emoji.toString()
Hey guys, is there a problem with discord.js for loading users cache ? It's taking so long with my bot.. It loaded ~10k users in 24hours.. Because of this, my bot is getting a very high ping xD Like 1k ms, even more.. 😅
ty
i don't know if you should be doing that, wouldn't that be api abuse? (take no word from me i have no clue how it works)
No don't worry it's okay :p I've never had this problem before.. Very weird
idk all i can offer is some good luck

why are you cacheing all of them though wouldn't it be better just to cache when u need 
nope it's not a problem like that and the problem was not here days ago :/
var url =
"mongodb+srv://Person47:" +
process.env.MONGOPASSWORD +
"@void-bot-data.mwq2n.mongodb.net";
MongoClient.connect(url, {useNewUrlParser: true, useUnifiedTopology: true}, function(err, db) {
if (err) throw err;
var dbo = db.db("mydb");
dbo.createCollection("customers", function(err, res) {
if (err) throw err;
console.log("Collection created!");
db.close();
});
var myobj = { name: "Company Inc", address: "Highway 37" };
dbo.collection("customers").insertOne(myobj, function(err, res) {
if (err) throw err;
console.log("1 document inserted");
db.close();
});
dbo.collection("customers").findOne({}, function(err, result) {
if (err) throw err;
console.log(result.name);
db.close();
});
});
MongoError: a collection 'mydb.customers' already exists
the collection already exists
how do i delete it
why don't you go to the collection on the website and delete it manually?
didn't you go the website to create a cluster?
yes
<collection>.drop()
or that..
came from the first google search result
@silver lintel for future reference though if you go the mongodb website then cluster and if u hit the collections you can view and delete data
unless yours is different idk
yes
yeah if you hit the collections you can view all the stuff and edit
Who can i help me with my code pls ?
.p
what lib
Who can i help me with my code pls ?
@slate socket maybe. you're not really giving any information
Someone can help me with this?
whats the best api to fetch song lyrics?
Dylan it means the file or directory could not be found at that path.
can you verify to see if it does
Dylan it means the file or directory could not be found at that path.
@sudden geyser I have to create a file called index.html ?
at that path, yes
what is index html ?
Lite said me to create it but idk what is it for
do my eyes decieve me or is that an actual person using glitch for websites rather than hosting discord bots? 
¯_(ツ)_/¯
kudos
yeah bots or website?9
glitch is MEANT for sites
welp i use it ;-;
:v

Well, to start with, nobody wants to debug tiny-ass screenshots taken from a phone.
when half the code isn't visible, too.
@umbral zealot i didnt to debug lol
I only ask if theres a way to opitmize it or not
Well, whatever it is you wanna do with that code we can't help with that screenshot 😛
why not just link the github.... 
don't think a lot of people here will want to download a zip to look at your code. you're making it real hard to help you right now
that's still private (I don't think you can make forks of private repos public) ¯_(ツ)_/¯
¯_(ツ)_/¯
what does it do
advert?
yeah this really isn't the place to advertise your bot
No it's just so I have someone to test it for development but damn ok
I just need some feedback
but ig not
Well then you should have lead with that 😉
That's what friends are for. Or testing on your own servers
@faint prism I have 1 friend and 7 testers that don't test
Soooooooo
I am the only coder and I have 1 artist
Not allowed
?
That falls under advertising
or advertise in the proper place
usually when you are the one developing your bot you'd patch what you know is wrong
its not like you purposefully leave shit half baked lol
'oh, yeah, this command crashes my bot, but thats intended'

-helptest
We aren't a server full of guinea pigs, and are not obligated help you with features that can easily be tested with alts or friends. If you don't have either - at least you can make alts without problems.
whole point of other people testing is people see shit you overlooked
I'd just want someone to test if it looks good and runs well from others standpoints. And asking myself is kinda bad
@opal plank I have a random command like after 6 days it stops my bot and I don't know hwo to fix so I just setup a macro to restart it
¯_(ツ)_/¯
@solemn leaf thats really stupid though
ok
or use a global error handler to output message somewhere
process.on('error', (err:Error) => channel.send(JSON.stringify(err)))
lazy dev
I got an idea
you arent suppose to copy paste you dork
thats precisely why i put shit in ts
so i hear complaints of people copy pasting
LEARN from it
dude you're a genius
then write a txt file and send the file to the channel
you can do that?>
that's why I write in C# snippets lol
erwin
thats me
send it in rs
send what in?
I'll do COBOL
CSS best programing lang
C++
no, css
c
could do c++ one too
css*
no just c
or c
send it in glua
aaaaanyway
write a txt file locally and then attach it to message payload
it has a key for attachments
just attach it there
ok
wtf why
if he plans on using it once, might aswell
but it'll simply overwrite
if you are smart enough to keep the same name
if he's using it once why not just keep it in memory
not sure if you can use buffer
Hold up
and send in a byte array
new Buffer.from(error)
attachments: buffer
?
imma store it on my video storage
been a while since i dicked with buffers
i think i only used it twice for my bot to stream directly to twitch and display the presence on my client
faster than making an I/O call to your secondary storage because it's "ez"
i really shot myself in the foot rn
when your headphones come out of your jack and plays on the surround speakers 
what
you shot yourself in the foot
yes
dead ass shot yourself
i completely forgot i had mized my juice with vodka and chugged almsot half a liter of it without realizing(cuz theres no alchool taste)
message payload
so
process.on('error', (err) => message.payload.attachments(new Buffer.from(JSON.stringify(err))))
you have no idea what you're doing, do you?
you cant attach anything on message cuz message doesnt exist
no of course not
and as you may know
.on means its a listener
just clike your message event
client.on('message')
thats an event
so
i would nest
i literally said not to nest events you dork
ok
it joke
outside of bot.on
ok
not nested on anything
ok
thats an event listener
therefore bad habits to nest them inside eachother
'message' doesnt exist
now what?
var idk = new Buffer.from(JSON.stringify(err))
process.on('error', (err) => message.payload.attachments(idk))
message exists only on bot.on('message', message => {})
?
err doesnt exist either
I got this
you're just copying my stuff at this point
you clearly dont
try to understand what im saying
2 different listeners
ok
that was joke
oh
im wasting my time trying to teach you basics of js which you should already know before making a bot
at least be considerate
bot.on('error, (err) => { var idk = new Buffer.from(JSON.stringify(err)) })
process.on('error', (err) => message.payload.attachments(idk))
soemthing like that?
that is nested?
Is that really nested
I thought I closed it
it is closed
formet it
yeah
my bad, im the one who missed that
vodkuh
shhhh

ok
You're drunk, Erwin. Go home
it'll catch any unhandled errors
so
Shiv you home. Go drunk.
wait

can I just do
again
here
process.on('error', (err) => message.payload.attachments(idk))
message doesnt exist
how you going to send a message to a channel if message doesnt exist?
is error an event?
indeed
alrighty then
process.on('error', (err) => {
var idk = new Buffer.from(JSON.stringify(err))
message.payload.attachments(idk)
})
its not technically error
its uncaught/unhandled rejections
but for simplicity sake im saying error here
again
message doesnt exist
message does
whats wrong?
therefore message doesnt exist
module.exports.run = async (bot, message, args) => {
process.on('error', (err) => {
var idk = new Buffer.from(JSON.stringify(err))
message.payload.attachments(idk)
})
client.on('message', message => {})```
you seem to be missing scopes
I was running off of my eval
message doesnt exist in process
ok, what is the queston you are trying to answer erwin?
you dont

attachment
wrong
without message, idk if that is possible
@vernal rivet pst billy pass me the answers
im thinkng
i mean i am not the one answering that question i am just here to help the person that is answering it
aight
oh ok i see what your talking about now, this is in process.on() method got you
thats called scope blocks
ok
err only exists on process.on because you declared it
aki do you understand what scopes are?
message only exists where you decalred it, insice client.on message
soemthing about somehting seeing varibles?
that is a better place to start erwin
in the guild
not wrong but technically wrong
erm
what is a common variable for both listeners that i showed?
message won't exist in the process.on event handler
client.channels.cache
^^^
oka
therefore












