Code Monkey home page Code Monkey logo

azerothcorediscordbot's People

Contributors

xanderdelaet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

azerothcorediscordbot's Issues

Discord Bot loses connection to server after a period of time and has to be restarted

I'm uncertain if this is an issue with the bot itself or my setup.
After the bot has been started, all the commands are fully functional. However, after a period of inactivity (seems to be a few hours), the bot seems to lose connection to the server. The loss of connection is not noticed until another command is sent to the bot, at which time the bot will respond with the following error:
There was an error trying to execute that command!

This is the output printed to the console:

Error: Can't add new command when connection is in closed state
    at Connection._addCommandClosedState (/opt/warcraft/AzerothCoreDiscordBot/node_modules/mysql2/lib/connection.js:148:17)
    at Connection.query (/opt/warcraft/AzerothCoreDiscordBot/node_modules/mysql2/lib/connection.js:546:17)
    at Object.execute (/opt/warcraft/AzerothCoreDiscordBot/commands/online.js:14:16)
    at Client.<anonymous> (/opt/warcraft/AzerothCoreDiscordBot/server.js:72:65)
    at Client.emit (node:events:527:28)
    at MessageCreateAction.handle (/opt/warcraft/AzerothCoreDiscordBot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/opt/warcraft/AzerothCoreDiscordBot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/opt/warcraft/AzerothCoreDiscordBot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31) 
    at WebSocketShard.onPacket (/opt/warcraft/AzerothCoreDiscordBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/opt/warcraft/AzerothCoreDiscordBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10) {      
  fatal: true
}

The azerothcore server itself is a docker installation. My config.js is as follows:

module.exports = {

        token: "<redacted>",
        prefix: "!",
        statusMessage: "with my 25 characters!",
        color: "#0000FF",

        databaseHost: '127.0.0.1',
        databaseUser     : '<redacted>',
        databasePassword : '<redacted>',

        soapPort: 7878,
        soapHostname: "127.0.0.1",
        soapAuth: "<redacted>"

}

One other note is that the soapAuth user is the GM account I use when I need to perform GM functions. Would logging into that account cause the bot to disconnect, and is it recommended for the bot to have a dedicated GM account through which to authenticate with the server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.