versx / PoGoEventWatcher

12 stars 11 forks source link

Bot doesn't seem to work #18

Closed MC0R3 closed 1 year ago

MC0R3 commented 2 years ago

Hey there,

Don't think this post takes away from the brilliant work you (or your team) has been doing. I simply love it. As for this one, I can't get it to work.

I've tried for a few days now and can't seem to get this bot to work, I'm getting the following error:

(node:479807) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function at Function.normalizeFields (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:450:8) at MessageEmbed.setup (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:78:91) at new MessageEmbed (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:18:10) at embedLikes.map.e (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/APIMessage.js:166:40) at Array.map (<anonymous>) at APIMessage.resolveData (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/APIMessage.js:166:31) at TextChannel.send (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62) at /root/Tools/EventWatcher/dist/commands/events.js:64:25 at Generator.next (<anonymous>) at fulfilled (/root/Tools/EventWatcher/dist/commands/events.js:5:58) (node:479807) 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(). (rejection id: 5)

The bot permissions are in this screenshot. Am I missing something?

Again, thank you for your hard work.

MC0R3 commented 2 years ago

Small update:

Edited the permissions in Discord and got it to work now to create voice channels, although the bot can't seem to remove them. Using the command also gives an error, this time the following:

(node:735271) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
    at Function.normalizeFields (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
    at MessageEmbed.setup (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:78:91)
    at new MessageEmbed (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
    at embedLikes.map.e (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/APIMessage.js:166:40)
    at Array.map (<anonymous>)
    at APIMessage.resolveData (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/APIMessage.js:166:31)
    at TextChannel.send (/root/Tools/EventWatcher/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62)
    at /root/Tools/EventWatcher/dist/commands/events.js:64:25
    at Generator.next (<anonymous>)
    at fulfilled (/root/Tools/EventWatcher/dist/commands/events.js:5:58)
(node:735271) 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().

I will continue to test a bit further to see what exactly is going wrong.

rexbutz commented 2 years ago

FWIW, I have never had the bot auto remove the channels, I've always had to manually remove by tapping on the voice channel and tapping delete. So either I'm doing something wrong or the auto delete is broken. Please let me know if you get it working!

versx commented 2 years ago

@MC0R3 @rexbutz Have either of you tried testing https://github.com/versx/PoGoEventWatcher/pull/17 to see if it fixes your issues?

MC0R3 commented 2 years ago

Hi there,

Just switched branches and tested it. I get a return that there is missing access to remove channels, but I specifically added that the bot can manage channels in that specific category (see below). The text-versions are also not being posted, not sure what I missed, but open for suggestions :)

Schermafbeelding 2022-03-21 om 09 30 46

root@v2202111159943167776:~/Tools/EventWatcher# npm start > eventwatcher@2.0.5 start /root/Tools/EventWatcher > tsc && node ./dist/index.js

Logged in as PoGo Events#4811! Event voice channel 1/6 Season of Alola created

Failed to delete channel 943209671857147985: DiscordAPIError: Missing Access

MC0R3 commented 2 years ago

Hi there,

I'm building a Dockerfile (or trying to, it's my first one 😂 ) and I got some errors building, maybe it's related to this issue. Basically when I use FROM node:lastest, it doesn't build past RUN npm run create-locales so I checked the node version on the package and used version 6.14.4.

One of the things that did come up with both versions is the following: npm WARN deprecated discord.js@12.5.3: no longer supported npm WARN deprecated messageformat@2.3.0: Package renamed as '@messageformat/core', see messageformat.github.io for more details. 'messageformat' will eventually provide a polyfill for Intl.MessageFormat, once it's been defined by Unicode & ECMA.

I attached my build log, maybe it could be of any help (if it is at all related off course)

error.log

rexbutz commented 2 years ago

Also switched branches and am getting the same result:

> eventwatcher@2.0.5 start ~/PoGoEventWatcher
> tsc && node ./dist/index.js

Logged in as xxxxxxxxxx#0000
Failed to delete channel xxxxxxxxxxxx: DiscordAPIError: Missing Access
Failed to delete channel xxxxxxxxxxxx: DiscordAPIError: Missing Access
versx commented 2 years ago

@MC0R3 @rexbutz Thank you for testing the branch, I'll try to look into it more sometime this week. Just to possibly help with debugging, if you assign the Bot as an Admin, do you get the same error?

MC0R3 commented 2 years ago

Hi there,

I just made the bot admin, and a channel was auto deleted but no textposts where made. Output doesn't really tell anything except for creating a new voice channel for the current event.

rexbutz commented 2 years ago

Sorry for the delay, had to make sure I was paying attention to the channels. I switched it to Admin and can confirm that the channels are auto deleted after expiry.