ServerMod / SCPDiscord

A ServerMod plugin which adds remote interaction to an SCP:SL server through Discord.
https://karlofduty.com
GNU General Public License v3.0
21 stars 28 forks source link

TypeError: Cannot read property 'roles' of undefined #169

Closed Memer1337 closed 5 years ago

Memer1337 commented 5 years ago

TypeError: Cannot read property 'roles' of undefined and my bot status is "Looking for server startup"

KarlOfDuty commented 5 years ago

Please show the entire error message.

Memer1337 commented 5 years ago

Hello, I fixed that problem reinstalling bot, but it still an other problem, bot doesn't log or send any messange, only "bot online" or "shutting down".

KarlOfDuty commented 5 years ago

Please post your configs here without your bot token.

Memer1337 commented 5 years ago
# Prefix for discord commands
prefix: "+"

# Port to listen on, this has to be the same as the "bot port" in the plugin config and all bots you run have to have different ports or they will clash.
listeningPort: 8888

# Channel to post the bot status messages in
statusChannels: [ "569518665310011394", "569497049075023882" ]

# The channels where bot commands can be used
commandChannels: [ "569497049075023882" ]

# Log more messages to the console, useful for debugging
verbose: false

# Message cooldown, number of milliseconds to wait between sending messages. Use this if your server sends too many messages for the bot to keep up. (Bot will get delayed if it hits more than 5 messages per 5 seconds)
cooldown: 1000

# Set permissions for discord roles here, the list names are the names of the discord roles and the list items are the first word of a command. Discord admins have access to all commands.
permissions:
    "add-role-id-1-here": # An everyone role example
        - list
    "add-role-id-2-here": # A donator role example
        - vs_whitelist
        - syncrole
        - unsyncrole
    "add-role-id-3-here": # A moderator example
        - syncrole
        - ban
        - unban
        - kick
        - roundrestart
        - hidetag
        - showtag
        - vs_reload
        - vs_enable
        - vs_disable
        - scpd_reload
        - scpd_unsync

# You need to enter your server id here to use role syncing, this will also show your server's roleIDs on startup
serverID: "add-server-id-here"

# Dictionary of discord roles to be synced to the game, value on the left is the discord role id and the right is the name of the game role they should be granted. (Not the role title but the role designation in the RA config)
# The bot will give players the first role in the list that they have access to so make sure to put the highest ranks in the top of the list.
roleSync: 
    "add-role-id-1-here": "owner"
    "add-role-id-2-here": "moderator"
    "add-role-id-3-here": "donator"

Sometimes bot send only - SCP:SL server connection lost. but anything about passing on the server, only in status how many players play

KarlOfDuty commented 5 years ago

Your plugin config too.

Memer1337 commented 5 years ago
# Connection settings, the port cannot be the same as the SCPSL server port.
bot:
    ip: "51.158.184.44"
    port: 8888

settings:
    # The language is the same as the name of the language file you want to use.
    # Included language files: english (default), russian, french, polish, italian, englishemote, russianemote, frenchemote
    language: "english"
    # Whether or not to show this server's player count in the bot's activity.
    # Set to false to disable.
    playercount: true
    # The message timestamp, see syntax guide here: https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/8kb3ddd4(v=vs.85)
    # Set to "" to disable.
    timestamp: "HH:mm:ss"
    # Whether or not the plugin should send more detailed console messages
    # Set to true to turn on.
    verbose: true
    # Whether or not the plugin should send debug information in the console
    # Set to true to turn on.
    debug: false
    # Turns on the config validation which shows the values after they have been read by the plugin so you can see they are correct
    configvalidation: false

# Name your channels here, this name is used in the channels section below. The left value is a name of your choice and the right is a channel id you want it to represent.
aliases: ["default":"569518665310011394","staff":"569497049075023882"]

# Using the channel aliases above you can direct events to different channels here
# Set to [] to disable an event.
channels:
    # Bot messages
    statusmessages: [ "default", "staff" ]

    # Channel topic updater
    topic: [ "default", "staff" ]

    # Round events
    onroundstart: [ "default", "staff" ]
    onconnect: [ "default", "staff" ]
    ondisconnect: 
        default: [ "default", "staff" ]
        banned: [ "default", "staff" ]
    onlatedisconnect: []
    oncheckroundend: []
    onroundend: [ "default", "staff" ]
    onwaitingforplayers: [ "default" ]
    onroundrestart: [ "default", "staff" ]
    onsetservername: []
    onscenechanged: []

    # Environment events
    onscp914activate: []
    onstartcountdown:
        noplayer: [ "default" ]
        initiated: [ "default" ]
        resumed: [ "default" ]
    onstopcountdown:
        default: [ "default" ]
        noplayer: [ "default" ]
    ondetonate: [ "default" ]
    ondecontaminate: [ "default" ]
    onsummonvehicle: 
        chaos: [ "default" ]
        mtf: [ "default" ]

    # Player events
    onplayerhurt:
        default: []
        friendlyfire: []
        noattacker: []
    onplayerdie: 
        default: [ "default" ]
        friendlyfire: [ "default", "staff" ]
        noattacker: [ "default" ]
    onplayerpickupitem: []
    onplayerdropitem: []
    onplayerjoin: [ "default", "staff" ]
    onnicknameset: [ "default", "staff" ]
    onassignteam: []
    onsetrole: []
    oncheckescape:
        allowed: [ "default" ]
        denied: []
    onspawn: [ "staff" ]
    ondooraccess:
        allowed: []
        denied: []
    onintercom: []
    onintercomcooldowncheck: []
    onpocketdimensionexit: [ "default" ]
    onpocketdimensionenter: [ "default" ]
    onpocketdimensiondie: []
    onthrowgrenade: [ "default", "staff" ]
    onplayerinfected: [ "default" ]
    onspawnragdoll: []
    onlure: [ "default" ]
    oncontain106: [ "default" ]
    onmedkituse: [ "default" ]
    onshoot:
        default: []
        friendlyfire: []
        notarget: []
    on106createportal: []
    on106teleport: []
    onelevatoruse: []
    onhandcuff:
        default: [ "default" ]
        nootherplayer: [ "default" ]
    onplayertriggertesla:
        default: []
        ignore: []
    onscp914changeknob: []
    onplayerradioswitch: []
    onmakenoise: []
    onrecallzombie: []
    oncallcommand: []
    onreload: []
    ongrenadeexplosion: []
    ongrenadehitplayer: []
    ongeneratorunlock: [ "default" ]
    ongeneratoraccess:
        closed: []
        opened: []
    ongeneratorinserttablet: []
    ongeneratorejecttablet: []
    on079door:
        closed: []
        opened: []
    on079lock:
        unlocked: []
        locked: []
    on079elevator:
        up: []
        down: []
    on079teslagate: []
    on079addexp: []
    on079levelup: [ "default" ]
    on079unlockdoors: []
    on079camerateleport: []
    on079startspeaker: []
    on079stopspeaker: []
    on079lockdown: []
    on079elevatorteleport: []

    # Admin events
    onadminquery: [ "staff" ]
    onauthcheck: [ "staff" ]
    onban: 
        admin: 
            kick: [ "default", "staff" ]
            ban: [ "default", "staff" ]
        console: 
            kick: [ "default", "staff" ]
            ban: [ "default", "staff" ]

    # Team events
    ondecideteamrespawnqueue: []
    onsetrolemaxhp: []
    onteamrespawn:
        mtf: []
        ci: [ "default" ]
    onsetscpconfig: []
    onsetntfunitname: [ "default" ]
KarlOfDuty commented 5 years ago

As you are connecting between different devices it is very likely to be a connection issue that doesn't have anything to do with the bot or plugin. I recommend you run both on the same device if possible. Otherwise, look at any and all firewalls between you and the target system.

Memer1337 commented 5 years ago

That starts working only after rebooting VPS server, thanks!