channel._cacheMessage is not a function

I used MikoMc discord activity script, then after I input the token and run it, the code has an error:channel._cacheMessage is not a function

Please censor the token in your image, as the token gives a user total control of your bot.

Also consider using Secrets for storing the token to keep it more secure.

2 Likes

In the tools section you should be able to find the Secrets tool. Create a secret named something like DISCORD_TOKEN and set it’s value to that token then in the code replace the token string in client.login with process.env.DISCORD_TOKEN. This will hide your token from anyone who looks at your code keeping it safe and preventing people with potentially malicious intent from doing bad things with it.