Skip to content

Bot is crashing on certain server messages #28

@Chitasa

Description

@Chitasa

Certain commands crash the bot on an Aternos Spigot Server when doing msg.toAnsi(), for instance setworldspawn and effect.

Error Message:

TypeError: [sprintf] expecting number but found string
    at sprintf_format (C:\Users\...\node_modules\sprintf-js\src\sprintf.js:62:27)
    at sprintf (C:\Users\...\node_modules\sprintf-js\src\sprintf.js:26:16)
    at vsprintf (C:\Users\...\node_modules\sprintf-js\src\sprintf.js:30:24)
    at ChatMessage.toMotd (C:\Users\...\node_modules\prismarine-chat\index.js:311:23)
    at C:\Users\...\node_modules\prismarine-chat\index.js:308:49
    at Array.map (<anonymous>)
    at ChatMessage.toMotd (C:\Users\...\node_modules\prismarine-chat\index.js:308:30)
    at ChatMessage.toAnsi (C:\Users\...\node_modules\prismarine-chat\index.js:347:24)
    at EventEmitter.<anonymous> (C:\Users\...\src\silentBot.js:100:35)
    at EventEmitter.emit (events.js:315:20)

JSON Message of setworldspawn:

{
  "italic": true,
  "color": "gray",
  "translate": "chat.type.admin",
  "with": [
    "O_o_f",
    {
      "translate": "commands.setworldspawn.success",
      "with": [
        "10",
        "114",
        "-2"
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions