Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot crashes if webhook already exist for log channel that isn't accessible by the bot #156

Closed
zhiyan114 opened this issue Jun 18, 2023 · 1 comment · Fixed by #155
Closed
Labels
bug Something isn't working

Comments

@zhiyan114
Copy link
Collaborator

zhiyan114 commented Jun 18, 2023

In certain condition, a webhook that is created under the log channel may be inaccessible by the ticket bot; thus, throwing the error. Since the algorithm detects that the channel already has a webhook, it will not create one that is usable.

I can push out a fix to my current PR (#155)

Context:
musiker15 -

node index.js

████████╗██╗ ██████╗██╗  ██╗███████╗████████╗    ██████╗  ██████╗ ████████╗
╚══██╔══╝██║██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝    ██╔══██╗██╔═══██╗╚══██╔══╝
   ██║   ██║██║     █████╔╝ █████╗     ██║       ██████╔╝██║   ██║   ██║   
   ██║   ██║██║     ██╔═██╗ ██╔══╝     ██║       ██╔══██╗██║   ██║   ██║   
   ██║   ██║╚██████╗██║  ██╗███████╗   ██║       ██████╔╝╚██████╔╝   ██║   
   ╚═╝   ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝   ╚═╝       ╚═════╝  ╚═════╝    ╚═╝
                 https://github.com/Sayrix/ticket-bot

Connecting to Discord...
🚀  The bot is ready! Logged in as MSK Support#6882 (456456456456)
🌟  You can leave a star on GitHub: https://github.com/Sayrix/ticket-bot 
📖  Documentation: https://doc.ticket.pm 
⛅  Host your ticket-bot by being a sponsor from 1$/month: https://github.com/sponsors/Sayrix 
💖  Thanks to our sponsors: VespidEmperor, BlutwurstPro, Musiker15, LostServices, MCZ-Le-J, nunofaria13, ZeaDRGOD, BgMonsterXx, GapsaW, Lucas6635, nicolasbaud
✅  Connected to WebSocket server.
✅  Successfully registered application commands.
TypeError: Cannot read properties of undefined (reading 'send')
    at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:42:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Promise {
  <rejected> TypeError: Cannot read properties of undefined (reading 'send')
      at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:42:6)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
} undefined
TypeError: Cannot read properties of undefined (reading 'send')
    at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:80:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Promise {
  <rejected> TypeError: Cannot read properties of undefined (reading 'send')
      at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:80:6)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
} undefined
TypeError: Cannot read properties of undefined (reading 'send')
    at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:99:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Promise {
  <rejected> TypeError: Cannot read properties of undefined (reading 'send')
      at Client.log (/opt/discordBot/msk_scripts/ticketsystem/utils/logs.js:99:6)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
} undefined
@zhiyan114 zhiyan114 added the bug Something isn't working label Jun 18, 2023
@zhiyan114
Copy link
Collaborator Author

Avoid opening another issues, there also seems to be a bug where empty url config prevents the status from updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant