Closed Tman0560 closed 3 years ago
@Tman0560 have you followed steps mentioned in README
?
Yes I have. I used the “use it as a independent bot” instructions in the Read Me
@Tman0560 no console errors? Bot token is valid? If still error then could you please share your code
No console errors. Bot Token is Valid. The bot works against the AI but it does nothing when doing !ttt @user. I wrote the script in Visual Studio Code.
@Tman0560 attack a screenshot of the code if possible? So I can have look at it
Sure
Hello @Tman0560, which version of Node do you use? I will try to reproduce the bug to fix it. Sounds weird because you should have either an error message in your text channel or a fatal error with the stack trace in your console. Also, the mentionned member must validate those conditions to start a duel with it : https://github.com/utarwyn/discord-tictactoe/blob/37f936092bfa37801b52cb9c4b40322c40701175/src/bot/commands/StartCommand.ts#L67-L70
Otherwise a warning message is sent by the bot in the same channel, do you see it? The only case when a message is neither printed in the console nor in the text channel is when the command is not handled or a game is already running in it. Or a permission problem.
I use Node version 15.4, Also I use a raspberry pi 3 to run the bot. It’s a 32 bit system so do you think that affects it? The Bot also has the proper permissions for the server. Like you said it doesn’t give me a error in the code or in the text chat.
@utarwyn @anjannair With some messing around I managed to have it give me an error code. Here's the error code...
/usr/bin/node ./main.js
null: TypeError: fields.flat is not a function
at Function.normalizeFields (/home/pi/Desktop/discordbot/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
at MessageEmbed.setup (/home/pi/Desktop/discordbot/node_modules/discord.js/src/structures/MessageEmbed.js:78:91)
at new MessageEmbed (/home/pi/Desktop/discordbot/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
at embedLikes.map.e (/home/pi/Desktop/discordbot/node_modules/discord.js/src/structures/APIMessage.js:166:40)
at Array.map (
Oh.. it seems to be a Discord.js
problem. Like that issue on their repository: discordjs/discord.js#3913
They are all saying to upgrade Node to at least v12+ or v14+. So check your node version with node -version
and upgrade it if needed. This is not a problem with my bot I think.
Okay cool I will do some investigating then on that I will let you know if it was the node version
It was the node version and nothing wrong with your bot. Thank you so much for your help!
Great news! Thank you for the feedback, enjoy the bot :smile:
I can't seem to get a duel to start. I can play against the AI but when I use !ttt and then the users @ nothing works. Could anyone help me out?