Relative Content

Tag Archive for typescriptdiscord.js

suddenly meet some problem with ts compiler and EventEmitter

I’m writing my discord bot with typescript and one day recently it just don’t get EventEmitter type define for some part of my code. the discord.js client is fine with it. but others like the mongoose connection, djs collector just can’t pass the compilation. i can’t figure out where the problem comes from. intellisense don’t get any suggestions for EventEmitter

how to use loops with conditional statement in typescript

For days i cant figure out how to get the for loop to iterate over all items and then run the conditional. So I want it to iterate overall the channels and then check if its true. It will run the conditionals on each item as they pass. When the conditional is true it. Ive tried mapping, probably incorrectly, and even tried to turn it into a JSON. I even started messiong with Message collections.