#development
1 messages · Page 1674 of 1
great so does it work with that link?
did you also add that link in the authorized oauth2 URIs in your discord dev portal?
It works, thanks!
Awesome!
anyone?
Hi. What's bot token?
What?
if you have to ask this you probably want to read a guide or two in how to make a discord bot, sure we could explain it, but this can be annoying for both sides.
im gonna say they aren't a dev
Hmmmm. I'll check that guide.
want to know about bots or just tokens?
No thank you.
well, technically yeah, but its fully made in ts
you can always use js syntax with ts
perfect
though you wont be getting intellisence n shit without ts, but thats up to you
its optional
Sorry, how do I get the player's ID or name+tag using the identify scope?
oauth?
oauth, yes.
should return a member object on authentifiction
where does it return it to?
if you got an id from the return request you can always ping the api for a user object
I get a "?code=XXXX" in the url
you should return to your site/app after they finished authorizing
that should contain their id
depends on how you login, i use passport and it returns the member object on authentification
with that you can request discord directly if you want
how...?
with the /users endpoint
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Sorry... this is for javascript?
its for all languages that can support it
regardless of your lang
if you use js i can recommend looking into passport and discord-passport, this makes oauth quite easy
or does it make it automatically?
you need to request it
if you want to make it barebones you have to send an json to the api
ugh, let me help you a bit more
it seems yuo dont know http very well
send a GET request to https://discord.com/api/v8/users/${id_here}
sorry... I'm still learning html / js as my main language is python but I need to use js for the website
wait but I dont have the id
return... what-?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
right there
I don't know how to do that
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
that code is useless if you dont request the data for it
thats basically a temporary token
Do you guys have a genshin impact bot idea?
idk man
?
@oblique pagoda wrong server dude
i already have a genshin bot, check my status
they are required past 2500 servers
enforced by discord
after 2500 you NEED sharding
and after 150.000(115k now i think, or something, they changed recently) you need a special request for discord
it is recommended you start sharding past 1.5k servers
that gives you quite a bit of time to change your code
is there any discord server for discussing node.js/v8 internals?
most servers are only about standard/high level node/js
not that im aware of
oh well then
v8 is some pre-historic shit
im getting my ass kicked by the v8 compiler
why u even using v8
Not sure but the node website says this
https://discordapp.com/invite/vUsrbjd

Lul
im testing 10 million iterations of a function that does type detections with a typeof switch
and with extremely small changes, its suddenly 3x slower for no reason
changes that are not even relevant
like you change something in a piece of code that only runs if typeof is number
and it makes another piece of code elsewhere 3x slower
you can use internal sharding, which affords 0% changes on your code
and even more weird, i've had it happen with things as random as changing the character length of a function by adding random lines that do nothing
Most of it is connected, but no idea about your issue
like this line
if(Number.isInteger(data)) { return Math.abs(data) < L48 ? packInteger(data, 0) : packLargeInteger(data, 0); }
run it with a small number 10 million times, takes 200ms
run it another 10 million times with a large number so that it triggers packLargeInteger instead, and it takes 600ms
run the first test again, and now it takes 500ms instead of 200ms
just because the large one ran once
the function parts are deoptimizing each other
That's weird
like wtf
Maybe there's an issue in crankshaft/TurboFan?

wasnt crankshaft repaced by turbofan already?
yes
Tim node dev confirmed
ew
he would make it light-weight
node-light
petition for time to append light every new update
v1 = djs-light
v2 = djs-ligh-ligh
v3 = djs-light-light-light
lmao
for each minor update, you add a letter instead of the full word
nah tim can work with big trash like "djs"
v1 = djs-light
v2 = djs-ligh-ligh
v3.3 = djs-light-light-light-lig
Good luck
everyone on ts now
Well if you contribute to v8 that means you automatically contributed to node also
As node uses v8 
@quartz kindle Bro what u trying to make tho

more benchmarks, probably
no im working on a binary serializer
JustTimThings™️
yeah cause it's not in json format
Bro, imagine if I add ArrayPrototypeRandom() to the v8 engine
No more pain of writing that <array>[Math.floor(Math.random() * length)] 
yes
You gotta also get in contact with TC39
why do not make your own function and require it?
https://tc39.es/process-document/ Doesn't look like an easy thing to do
"Why not recreate all array methods and require it?"
I mean, just a small thing to add
Just like Array.prototype.pop()
make an npm lib that adds it to the Array prototype globally
because prototype pollution is nice :^)
what are goods sites to code on to make an webpage for your bot?
no but for full on web dev
I'm not sure what you mean
websites are made using html, css and js
or, at least the frontend of the site
you meant to use templates like wordpress?
all you need is a text editor and a browser
^
just dw 
alright
Hello, could I get some help please? (with that)
how i do uhh subcommands
If you're using a framework it might have a documentation for it
I'm trying to do the "Using webhook" one
I'M A LITTLE BUTTERFLY
I've copied it and put my dbl token as said, but clicking on the "test" button in the website doesn't do anything
dblpy runs the webhook if you set webhook_port at the very least
auth and path have default values, empty string and /dblwebhook respectively
I only have webhook_port=5000 which is the default one
Did you set auth and/or path?
no
Eh, let's leave that for later then
should I just delete them?
What URL did you enter on top.gg?
Delete them in what sense?
Do you have them set in DBLClient with the values the example gave you?
the default thing was webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000, maybe I should just put webhook_port=5000
Discord webhooks are not supported by top.gg
What webhook really means in this case is a webserver running on your machine
Preferably a VPS
How do I specify on mongodb that it should fetch guilds with certain passed ids?
It is possible, you just need to make sure port 5000 is open (accessible) on your bot's machine and that you enter the URL and Authorization key properly
You can use something like <model>.find({ guild_id: [<array of guild IDs>] }), at least in Mongoose
but not with a webhook, right?
Not with a Discord webhook
mongoose, perefect
How would i add an error page to an invalid link an user has entered to go to my site like https://sitehere/E and then it would show an 404 error on glitch.com?
See, the catch here is that you will receive requests in real time as someone votes and then you can make your bot send a message
im sorta confused how i would intergrate that as i have an 404 page made and ready to be used
oh ok
thank you!
P.S. that's why dblpy uses events like on_dbl_test and on_dbl_vote
_test is for test requests, aka whenever you press Test on top.gg, and _vote for when an actual vote is sent
What should be the command for
If we like to use uptimerobot on replit
anyone else having issues with setActivity()
no error
just doesnt set any activity
which would i use if im using repl.it to connect
and no i have no issues with setActivity
Hm, just installed jdk 7, manually on ubuntu 18.04. But it says permission denied. Any idea on how to fix it / what the issue is coming from? I don't have much information on what is wrong but it has read, write and execute permissions on the folder.
hmmm my bot's wont set
everything else works fine tho
then i used top.gg widget it is not showing right votes 😅
in embed https://top.gg/api/widget/707098046164631553.png
what language?
it showing 20 but it's not 20 it's 43 now 😓
same
idk then, i use py the second one down gives u a line of py to use to connect just look up how to connect js to mongodb
use connect your applications
i do use it
It's caching, showing 43 for me
Why not Compass?
is it bad if my console log is spammed w/ this?
(node:9940) UnhandledPromiseRejectionWarning: Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.
showing me 20 for me
Use https://top.gg/api/widget/707098046164631553.png?<something random>
could i use compass or
me?
you are not using compass now you want to connect with your bot code in replit.com so use applications
Alright.
this option @sterile lantern
oh got it 😓
RIP what happen to API?
thx 🤣 idk what happen to top.gg api
It's your browser caching
🤔 oh
or rather Discord in this case I believe
Electron I guess
¯_(ツ)_/¯
Question
all function calls will be resolved before the return executes
What do they mean by this.
Do they mean the functions will be called before the return inside the function executes?
Yeah
👍
holy hell why jdk 7?
that thing is as outdated as square wheels
data.Punishments.unshift({
PunishType: 'Warn',
Moderator: message.author.id,
Reason: reason,
});
data.save();```
i am saving punishments in mongo db like this
how would i fetch it and have it list in an embed
haha i fixed it but it's so I can run horizons 1.6.4 xd
so e.g: +punishments @/user
responds with
punishtype: warn
mod: mod
reason: reason
2nd punish if applicable```
ftb horizons
@sterile lantern i have no idea how to work with mongo, but logically you would have a case id or something so you can identify that specific entity
something like an incrementing number is enough
Hey guys, do any of you happen to know if there is a bot that will automatically add certain reactions to a message in a specified channel?
if you want to be extra, twitter snowflakes
wrong reply
oop
sorry
i hate mobile
Ahahahah np
easy to be ratelimited
hard to find one that does that for that reason
It's a channel with a slowmode of 10 mins, its to post specific things
It's unlikely that someone would have a made a bot like that, because there's a chance people aren't using slowmode, thus getting their bot rate limited
You can always ask someone to make a custom bot for your server specifically, but very rarely would people do that for free. There are websites like Fiverr where you can easily find bot developers for that sort of stuff.
Ah okay makes sense, would you happen to know anyone who would be able to do that?
Happy to pay
I don't know anyone, but like I said, any freelancing website like Fiverr is probably your best bet
Alr thanks man, appreciate it
is discord-oauth2 a good package for a dashboard?
punishments.find({ GuildID: message.guild.id, UserID: user.user.id}, async(err, data) => {
if(err) throw err;
if(data) {
message.channel.send(new Discord.MessageEmbed()
.setTitle(`${user.user.tag}'s warns`)
.setDescription(
data.content.map(
(w, i) =>
`\`${i + 1}\` | Moderator : ${message.guild.members.cache.get(w.Moderator).user.tag}\nReason : ${w.Reason}`
)
)
.setColor("BLUE")
)
}```
(node:1075) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
const punishments = require('../models/ModSchema');
punishments is defined as so ^
why would i need a case id tho
this is not enough, it isn't unique
im doing ;warnings user
so it displays the user's warnings
essentially i just want it to print that array
ah, so that's only warnings
i thought it was bans and mutes and that type of shit as well
well
even if it was
it's saved under Punishments
the array
so it should fetch all of the punishments and list them
but its not working for some reason
console.log data and see the structure of the object
[
{
Punishments: [ [Object], [Object], [Object] ],
_id: 6060e6444889770358d9d389,
GuildID: '730819054297808897',
UserID: '781165252862541865',
__v: 2
}
]```
so its an array
there is no .content property
${user.tag}'s punishments:
Type: type
Moderator:mod
Reason: reason
Type: type
Moderator:mod
Reason: reason
i want it to print that
that object isn't the punishment array
it has a property that contains the punishment array though
look closely
yes
so i map data.punishments?
ah
data is an array of objects that has the actual array you want
find can match multiple items to those conditions
i think you can use findOne
stringify?
bro are you dumb
findOne, which finds one object and returns it to you
on the other hand, find returns all objects that matched that condition, in order to return you all of those objects, the return type needs to be an array
tldr findOne returns an object, find returns an array of those objects
logical thinking bro
i have no clue how mongo works nor have i ever worked with it
bruh I still can't find out how
hm so wait
how to check how many mentions are in a message
are you retarded
you genuinely just ignored what ive been saying for the past few minutes 🙄
bruh
findOne finds one, find finds multiple aka an array of objects, be it empty (nothing was found) or one (an array with one element)
.findOne stops when a document matching a query was found, .find returns ALL documents matching a query
I got questions should I put permission of manage messages to be allowed to poll on do my poll command
You should probably use the username and tag instead of pinging the user two times
The ping doesn't work in the embed lmao
`\`${i + 1}\` | **Moderator**: ` + "`" + `${message.guild.members.cache.get(v.Moderator)}` + "`" + `\n**Reason:**` + "`" + `${v.Reason}` + `\n**Type**:` + "`" `${v.PunishType}` + "`"```
how come my formatting doesnt work
is it because its in the map
nvm
how come this happens
the formatting for the 2nd warn is weird
You should really invest some time into looking how to use template literals
??
Not needed to use them and concatenate other strings with it
hmm ok
... well actually can’t write an example on mobile 
Fuck discord mobile
still
Oh just another tip, instead of using single code snaps just use one codeblock for each warn
Will also allow you to use (much) spaces to format and move the text where u want
That’s the advantage of a monospace font
1 | warn
reason
whatever
God damn... took me like a minute to write this on mobile
I updated my discord.js but does anyone know the fix of this?
there is no part in my code that leads to a message
The bot can join multiple channels right?
Like 1 in each server?
Voice channels? I think yes
1 voice channel per guild
Yeah thought so, just was making sure they hadn't updated that cause my bot left a channel and joined another, thanks tho!

is there a way to regex or only have one extension blacklisted from a gitignore?
for example, exclude every .gz ending file in a folder?
doesnt *.gz work?
/.*\.gz/gi
does any know how to make a bot written in python send a message to ever channel in a server
no spam support here
ik theres a simpler way i just havnt found it yet.. how can i get the activity show with him showing as dnd?
client.on("ready", () =>{
console.log(`Logged in as ${client.user.tag}!`);
const newLocal = 'Star Wars | c2help';
client.user.setActivity(newLocal, {type: "WATCHING"});
client.user.setStatus('dnd').then(console.log)
})
in which language and library?
<client>.guilds.fetch('id')
but d.js should have it cached every guild by default
Why?
So when I save a punishment (warn, ban, etc) I want to assign a case ID
So one user gets warned, their case ID is 1
A different user gets banned, their case ID is 2
Essentially just increment
Would I save a value in the DB as 0 and when the command is successfully ran increment it by 1 and assign it to the case?
Assuming it would allow me to do !viewcase 1
Context please?
Very much depends on the database engine.
For SQL just use a primary ID key.
The cases aren’t getting an own ID in the case you will ever delete warn.
It would than list for example, warn1, warn3 etc.
I would sort the cases by the timestamp and loop through any case where db user ID = discord user ID
And just the iteration to assign the case ID
He's using mongo
i mean.. its quite obvious the issue...
emoji shows as :yes: instead of 
This is one of tge cases where sql would be more straightforward
Shrug
Obviously
You can't use emotes inside codeblocks
Oh nvm, that's an embed
ya
Permission issue
erm.. no?
Check if "use external emotes" is granted
Can you let me finish a single sentence?
its in the guild the emoji is in
mhmm
Remove the flextape from the mouth first
yeah I’m using mongo
I just want the case ID to increment
and then I’m able to do ;removecase 1
if it’s not possible I just generate a random case ID
@sterile lanternand whats stopping you from using increments?
Google how to do incremental columns in mongo. If not possible, increment yourself. Random might produce a similar key
I’m fairly sure makeID is impossible to generate the same result twice
doesn’t seem efficient with mongo tbh
how so?
well I mean I have to increment a value then assign it to the case each time a new case is made
e.g the value can be cases and its default value is 0
I’ll probs try and see if it’s easier to do increment or random
if makeID is a native mongo method, then it might be impossible.
you can either do it in raw SQL or in postgres natively
set a colum having an auto incrementing value, thats it
OR
SELECT id FROM cases ORDER BY id LIMIT 1
done, you now have the latest entry from your database, just add 1 onto and insert a new one
Postgres?
you can likely do the same but in mongo
Auto increment should be possible in any database
makeID is just this
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
console.log(makeid(5));```
i know they said mongo, but surely it has its alternative
Firebird cries in the corner
and yes, postgres
That logic could return a key which already exists
Erwin
imagine you generate 2 equal id's
you'd have to check mongo if it had it or not
so technically you wouldnt be saving 1 query
Why are you using ``text``?
Wait until you hit the MAX_SAFE_INTEGER for case count 
Like, ain't it supposed to be text?
what are you on about ?
Dyno could probably hit MAX_SAFE_INTEGER
is their bot dyno?
no. Just saying
then dont worry about it
Weird
That's your client's rendering. It shows as a single tick code block for everyone else
Maybe desktop version ignores the double tick
are you on android with an amoled display
Yep
That's why
pixels turned off
Maybe
They'd reject the report for being "too minor"
just reply with no u and theres nothing they can do
Minor bugs in discord: "I sleep"
Minor users in discord: "wAiT tHaTs IlLeGaL, gOtTa Be BaN"
Miner users in discord: 
minor bugs wont get them sued by COPA 
Discord admins: Wanna have a burger-
put it in a pastebin so that people don't have to download the attachment
pastebin = shit
https://paste.gg/ is great though
A sensible, modern pastebin. Share text and source code snippets with no hassle.
I wasn't exactly referring to pastebin. An alternative like hastebin would be better
looks shit too
just the general concept of it is what I'm looking for
g
Oh nos its 32kb good thing most drives can hold 1tb
which is like x10k more space
I just auto save mine to something that gets wiped each time I boot my pc
really eff
is it really that much to ask people to put their stuff into a website which displays the Content-Type as text/plain so that people who want to help don't have to download a file and then open it? Or perhaps people on mobile such as iOS (like me) would have to save the document to their files app and it gets auto uploaded to iCloud for whatever stupid reason, then they open that document and multi-task between Discord and their files app, then the extra pain to go through and delete the file from iCloud AND iCloud trash AND their phone once they're done helping a user?
certainly the issue is storing the file /s. Of course my drive can contain it, but I don't want to download files unnecessarily.
A full 40 minutes after they asked the question and we're still talking about this? lol
Judging by how they haven't responded at all, I could care less about their problem now. I never looked at their text file. Just responding to whoever is actually talking to me
I Guess ¯_(ツ)_/¯
holy cheese that's a long argument
If we could have bots here we could just make a bot that uploads all message.txt attachments to a paste system. But we do'nt, really.
Would be nice
Was the reason why Discord asked this place to remove all bots possible ever made public
It feels like it was a pretty direct (albeit extremely late) response to bot farms.
Would make some sense, although very late indeed
a gist system is so fckn easy that there's no reason discord doesn't have one to begin with
like, keep gists for what, 3 days?
And it's even more ironic that they're already hosting the file on a CDN, and they're never deleted unless you delete the message, so...
actually, images get yeeted after some time
had issues with users that saved profile backgrounds to discord then used their links
some time later the image url simply doesn't work anymore
idk man. Image is still there. Probably a logical issue on your end
weird
like
I manually tried to access the url
also checked if the message still exists
maybe the image url get changed?
I made a dumb choice of using toLowerCase on string values which could include links and that broke links
That was a nuisance for some time
make sure you have the correct intents for message reaction add. If you use them in DMs, there's an intent for that. If you use them in guilds, there's another intenet for that. Using both means 2 intents have to be present
what's the intent name
im not using it in dm
GUILD_MESSAGE_REACTIONS?
oh wait
its actually working.. but for new messages
if i react on old messages its not being called
That is because those messages aren't cached, you'll probably need to use the raw event
oh wait no that's the old way
what does this versioning mean?
{
"engines": {
"node": ">=12"
}
}
does it mean, that it also support 14.x and 15.x?
it supports node v12 and upper
yeah
I only remember having to specify a node version for Heroku
perhaps some native deps or libs which make use of some esnext features might specify it
Hey my bot economy system is returning undefined or null if a user has no cash in his account.How to return 0?
use the nullish coalescing operator ?? if you're on node 14+, else use the logical or operator ||, like obj.balance || 0
Oh ok
My Node.js is v12 & djs is v12.5.1
use the latter
ok
balance || 0
Oh ok
if the balance is undefined or null, it will be 0
ohok
ty
This will not affect my bot verification right
I mean Top.gg verification
Should not
Ok
@pale vessel
if(command === "balance") {
const bal = db.get(`balance.${user.id}.wallet`)
if(!bal) bal = 0;
message.channel.send(`${message.author} You have ${bal}`)
}```
Ok
Lets say I'm trying to get the author and content of a message, how would I do that?
it should be, go to their docs and search for Message
Ik it's something along the lines of ${message.author}
you can see all available properties and methods that's accessible
yeah it is
you can even guess the same for content
Ik content is just message.content
you answered ur own question
lol
I think before you ask here you should ask yourself
what
someone had a stroke
Can't i just steal .js date from a website and then use it in a bot
what's the context behind this question
idk
okay
hey
i'm making a welcomer event for my bot
and i search how to give role AFTER the new member accepted the community rules
hmm ok thks i'll try
it's is_pending my bad
not sure if it's there in libraries yet
i believe that's new
Detritus > d.js
moment

fs.readdir("./src/", (err, directories) => {
Logger.log(`Loading a total of ${directories.length} categorie(s).`, "log")
directories.forEach(dir => {
fs.readdir("./src/" + dir + "/", (err, commands) => {
commands.forEach(cmd => {
if (cmd.endsWith('.js')) {
try {
let command = require(`${"./src/" + dir}${path.sep}${cmd}`)
Logger.log(`Loading Command: ${command.name}.`,"ready")
client.commands.set(command.name, command);
} catch (e) {
Logger.log(`Unable to load command ${commands}: ${e}`,"error")
}
}
})
})
})
})``` how can i add aliases to it
on your module.exports check for alias: []
if there is, set() them too
OOOOOOOOOOOR
advertisement
you could use detritus
this single line is all u need

pffff
Well the problem is more that i can add alias: [] but it doesn't connect like even if i type $h instead of $help it doesnt incorporate
prefixes should be different than aliases
ohw i mean without the prefix
aliases is the command name itself
i know
then?
ofcourse i know but ii was a demonstration
whats the snippet you using for the alias?
Detritus ads
F i didnt add any
then you arent setting any aliases

cant expect it to work if you didnt code it to set alias too
But doesnt the command handler find the aliases
you WROTE the command handler
if you didnt write it to do that, how do you think it would do it by itself?
I know but im mentaly dumb
hence why you should try detritus sometime
its a lot easier to do all that automatically
yeah ill check it out
@dusky lagoon which lib you think this is?
this is low level detritus, which you should be using exactly the same (expect the permissions) for your bot
this is a more advanced one to not have to repeat itself
you can do this too instead of repeating the same thing over all commands
mine is also connected to a terminal logger so that makes it a lil complicated i think
read past this #development message
those are all things you can use out of the gate from detritus
without having to code it yourself

shush
Soon it might reach 1000+
I'm not saying its bad, the lib is pog

i expect you to join the army of jeovah witnesses too @earnest phoenix
Gladly
Erwin loli moment
nani?
why not embed?
hmmmmmmmm
it no embed 4 me
It doesn't embed for me either
Dog be sus on trampoline?
dont know what you talking about mate

detritus best lib
command handler internal
veri gud
10/10
would do it again
5 star on google reviews
Bro, imagine if detritus is sus
stinky
Too bad, discord.urmom is on its way to slay its opponents
lel
How to add playing -help on bot?
Do you know how discord bots work?
Yes
when bottum be invite to servers
What language are you using?
Node js
@earnest phoenix
Correct method for it (if using discord.js) would be
client.user.setActivity('text')
Thanks
client.editStatus(status, game) for Eris
Eris?
Not working something wrong should I give; after it?
It is saying your repl should have a port open
@upbeat void
Another library
That's not the issue with the code, probably you're trying to visit it's webpage and you don't have a valid repl port open
What should I do?
JavaScript?
yes js
why does my bot account takes 2 minutes to start? while my other bot accounts start within 5 secs
if you're using discord.js
client.on('message', () => {
db.get(_yourkey 'its_value')
}
with quick.db
db fetchs differ upon what you're using
You might have
• nested events
• too many commands
• errors
• etc.
lol that is not efficent
i use atm mongodb with changestream
sure is, you wanted to fetch values per message
bc i need sync between dash and bot
I'm not familiar with mongodb's changestresm sorry! I gave you the basic idea tho
it doesn't happen with other accounts
only 1 specific bot account
Per message would be
client.on('message' , () => {
// However you fetch stuff from mongodb : changestresm
}```
Do the hosts differ?
no
¯_(ツ)_/¯
nice
Cache the things so first you get them from the database, and the next time you get them from memory
yeah i atm i use it .I use cache with updates
Guys i need help with editing the bot's message
I can do it with normal messages, but how to in embeds??
In what language?
let embed = ... // Ur first embed
let msg = await message.channel.send(embed) // Send the first embed
embed.addField(..., ...) // Create a new embed (or in this case at a field to the first embed)
msg.edit("", embed) // edit the message
djs
hm
if i want to change the description just embed.setDescription?
There's pretty much nothing we can do to help other than "use try/catch, or catch(), to prevent errors" since that's as generic an error as you'll ever get
the only thing it says here is that a promise error wasn't caught, and this could be literally anywhere within your code
I guess it could be related to shard.js
It could literally be related to any line of any file in your entire bot
what the
await manager.spawn().catch(e => console.log('Shard Error: ' + e))
i make it this
now it worked smoothly
I doubt it worked smoothly as you're getting a promise rejection error
right now you're just ignoring the error
commands loading, token connected.
How did this fix with catch? I do not understand.
I think it's magical xd
omg
1 gb download in 3 minutes
for one bot
does anyone know a npm package to publish issue on a github repo ?
i'm trying to do a bug command, that with a verification from the bot's staff automatically opens an issue on the repo
can anyone help me? I cant push my project to github
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/Vigintillionn/LoL-cd-bot.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I did hit pull but it still wont work
you must pull before pushing
use github webhooks
Can anyone help me? What did i do wrong here
if (message.content.toLowerCase().startsWith(config.prefix + "mlg" + " " + "water" + " " + "bucket")) {
if (guild.id !== config.serverID) {
message.channel.send(NESG)
} else {
let mwb = new Discord.MessageEmbed()
.setColor(colore)
.setDescription(`Mlg water bucket \n \n \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`);
message.channel.send(mwb)
.then(m => {
mwb.setDescription(`Mlg water bucket \n ${Dream3} \n \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`)
setTimeout(async () => {await m.edit(mwb)}, 2000)
})
.then(m => {
mwb.setDescription(`Mlg water bucket \n \n ${Dream3} \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`)
setTimeout(async () => {await m.edit(mwb)}, 2000)
})
}
}```
i've looked at that, but i think that webhooks only allows to add comments on existing issue, doesn't it ?
any errors ?
Are you looking to create new issues, or act on new issues that were created?
create new one
I said I did git pull but I keep getting the error
wait ima send the error
it doesnt even stop the bot
there's just an error in the terminal
try creating a new branch, switching to it and pushing on it
thant do a pull request
can you send it ?
yes im copying it
github rest api https://docs.github.com/en/rest/reference/issues#create-an-issue
so do I do git branch -M <other name>?
k, i didn't found the 2nd one ty 😉
(node:4700) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'edit' of undefined
at Timeout._onTimeout (C:\Users\39328\Desktop\Dream\index.js:51:39)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4700) 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:4700) [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.```
i'll check that too
And which is line 51 of index.js?
what is line 51 ?
probably the second one
if (message.content.toLowerCase().startsWith(config.prefix + "mlg" + " " + "water" + " " + "bucket")) {
if (guild.id !== config.serverID) {
message.channel.send(NESG)
} else {
let mwb = new Discord.MessageEmbed()
.setColor(colore)
.setDescription(`Mlg water bucket \n \n \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`);
message.channel.send(mwb)
.then(m => {
mwb.setDescription(`Mlg water bucket \n ${Dream3} \n \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`)
setTimeout(async () => {await m.edit(mwb)}, 2000)
})
.then(m => {
mwb.setDescription(`Mlg water bucket \n \n ${Dream3} \n \n ${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}${GrassBlock}`)
line 51>> setTimeout(async () => {await m.edit(mwb)}, 2000)
})
}
}```
why do I always get this btw? On my other PC I never got this
and do I put in my username or email?
yeah k, but on this there are multiple lines
which one is the 51 ?
i wrote line 51>> on that line
oh yeah sry
So it's saying m is undefined, which.. it is.
maybe you only need one 🤔
you're not returning m from the first promise callback
There's no reason to have 2 .then() chained here
but the 2nd one works and the first doesnt
No, the second one fails and the first works. you're confused
i want the embed to get edited 2 times
nope
well then
in your first callback
You clearly don't have a correct understanding of how asynchronous code works.
just do two timeouts
I suggest you read this: https://js.evie.dev/promises
one of 2000ms
it waits 4 second and changes nothing, then this
and one of 4000ms
this is why the second one "works":
i will, thanks
the first one sets the embed, then starts a time out, and returns immediately
the second one sets the embed again, overriding the previous one, then errors
once the timeone of the first one finishes, it finally sends the embed, that was modified by the second one before the second errored
the timeout is a "fire and forget" kind of thing, it does not wait 2 seconds before continuing. the second .then is started immediately after the first .then finishes "starting" the timeout
So how do i fix it?
use async await, and use a promisified timeout or delay
alright
so now
how do I merge my 2 branches?
to 1
I looked up how
but when I go to pull requests all I see is this
make a PR request from the new one to the old one
caching
few hours later
how
it doesn't show any merge button
new pull request
then what?
@quartz kindle does partials contribute to it?
they shouldnt
I just get this
you have 2 branches right? one of them is newer and one is older
yes
still riddled what does djs or my code cached
then there should be a list of changes
yes
and from there you can create a PR
no this is the end
which branch are you currently on?
not sure
go back to the repository page and select the new branch
from the drop down menu
then create a PR from there
are you measuring rss or heapused?
same thing
hepUsed
do you have presences enabled?
lemme check, you mean the intents right?
yes
idk then
ah yeah, if you meant GUILD_PRESENCE
copy the entire code from the new branch then delete the branch
then paste the code onto the original branch
and git push
yes
tim.lockIn(development)```
if(tim.locked) {
tim.unlock()
}
oh no
so it contribute to those heapUsed? 🤔
yes, you can check the cache
they are stored in guild.presences.cache
delete tim.locked
delete tim.unlockedd
under what event? or how





