Beispiel #1
0
        public override void Load(bool startup)
        {
            config.LoadConfig();
            if (config.Token == "" || config.ChannelID == "")
            {
                Logger.Log(LogType.Warning, "Invalid config! Please setup the Discord bot in discord.properties! (plugin reload required)");
                return;
            }

            dc = new Discord.Discord(config.Token, config.ChannelID);

            OnPlayerConnectEvent.Register(PlayerConnect, Priority.Low);
            OnPlayerDisconnectEvent.Register(PlayerDisconnect, Priority.Low);
            OnPlayerChatEvent.Register(PlayerChat, Priority.Low);
            OnPlayerCommandEvent.Register(PlayerCommand, Priority.Low);
            OnModActionEvent.Register(ModAction, Priority.Low);

            OnMessageReceivedEvent.Register(DiscordMessage, Priority.Low);

            Command.Register(new CmdDiscordBot());
            registered = true;
        }
Beispiel #2
0
 public override void Load(bool startup)
 {
     OnPlayerChatEvent.Register(DoTeamChat, Priority.Low);
 }