예제 #1
0
        public void RemoveChannelCounterByType(ulong guildId, ChannelCounterType counterType)
        {
            var guild = _guild.GetOrCreateGuildAccount(guildId);

            var counter = guild.ChannelCounters.Find(x => x.Type == counterType);

            if (counter is null)
            {
                throw new Exception($"There is no counter active of type '{counterType}'.");
            }

            guild.ChannelCounters.Remove(counter);

            _guild.SaveGuildAccount(guild);
        }
        public ChannelCounterInfo(ChannelCounterType type)
        {
            Type    = type;
            Trigger = type.Humanize().ToLower();
            CheckIntervalInMinutes = 6;
            Description            = "No description provided.";

            switch (type)
            {
            case ChannelCounterType.FlashStatus:
                Trigger                = "flash";
                Description            = "Shows the current server status of flash servers.";
                CheckIntervalInMinutes = 3;
                break;

            case ChannelCounterType.PAStatus:
                Trigger                = "pa";
                Description            = "Shows the current server status of pa servers.";
                CheckIntervalInMinutes = 3;
                break;

            case ChannelCounterType.OnlinePlayers:
                Description = "Shows the current amount of in-game flash players.";
                break;

            case ChannelCounterType.TotalCommandsExecuted:
                Trigger     = "commands";
                Description = "Shows the current amount of executed commands.";
                break;

            case ChannelCounterType.MemberCount:
                Description = "Shows the current amount of all Discord Users in this server.";
                break;

            default:
                break;
            }
        }
예제 #3
0
 public ChannelCounter(ulong channelId, ChannelCounterType type)
 {
     ChannelId = channelId;
     Type      = type;
 }