Exemple #1
0
        private List <ulong> _temporaryChannels; // This isn't for config, but instead for keeping track of the active channels.

        public override void Initialize()
        {
            AssertPermission(Discord.GuildPermission.ManageChannels);

            GuildHandler.UserVoiceStateUpdated += UserVoiceStateUpdated;
            GuildHandler.ChannelCreated        += OnChannelCreated;
            GuildHandler.ChannelDestroyed      += OnChannelDeleted;

            _defaultChannels = GetConfigCache("DefaultVoiceChannels", x => x.GetGuild().VoiceChannels.Select(y => y.Id).ToList());
            _newVoiceNames   = GetConfigCache("NewVoiceNames", x => new List <string> {
                "Extra Voice 1", "Extra Voice 2"
            });
            _desiredFreeChannels = GetConfigCache("DesiredFreeChannels", x => 1);
            _ignoreChannels      = GetConfigCache("IgnoreChannels", x => new List <ulong> {
                x.GetGuild().AFKChannel.ZeroIfNull()
            });
            _newChannelCategory = GetConfigCache("NewChannelCategory", x => (ulong)x.GetGuild().VoiceChannels.FirstOrDefault()?.CategoryId.GetValueOrDefault());

            _newVoiceNames.OnModified += NewVoiceName_OnModified;

            AddConfigInfo <SocketVoiceChannel>("Add Default Channel", "Add default channel", x => _defaultChannels.MutateValue(y => y.Add(x.Id)), x => $"Added channel '{x.Name}' to list of default.", "Channel");
            AddConfigInfo <ulong>("Add Default Channel", "Add default channel", x => _defaultChannels.MutateValue(y => y.Add(GuildHandler.GetVoiceChannel(x).Id)), x => $"Added channel '{GuildHandler.GetVoiceChannel(x).Name}' to list of default.", "Channel");
            AddConfigInfo <string>("Add Default Channel", "Add default channel", x => _defaultChannels.MutateValue(y => y.Add(GuildHandler.GetVoiceChannel(x).Id)), x => $"Added channel '{GuildHandler.GetVoiceChannel(x).Name}' to list of default.", "Channel");
            AddConfigInfo("Add Default Channel", "List default channels", () => "Current default channels are:\n" + string.Join('\n', _defaultChannels.GetValue().Select(x => GuildHandler.GetVoiceChannel(x).Name)));

            AddConfigInfo <SocketVoiceChannel>("Remove Default Channel", "Remove default channel", x => _defaultChannels.MutateValue(y => y.Remove(x.Id)), x => $"Removed channel '{x.Name}' from list of default.", "Channel");
            AddConfigInfo <ulong>("Remove Default Channel", "Remove default channel", x => _defaultChannels.MutateValue(y => y.Remove(GuildHandler.GetVoiceChannel(x).Id)), x => $"Removed channel '{GuildHandler.GetVoiceChannel(x).Name}' from list of default.", "Channel");
            AddConfigInfo <string>("Remove Default Channel", "Remove default channel", x => _defaultChannels.MutateValue(y => y.Remove(GuildHandler.GetVoiceChannel(x).Id)), x => $"Removed channel '{GuildHandler.GetVoiceChannel(x).Name}' from list of default.", "Channel");

            AddConfigInfo <string>("Add Voice Name", "Add voice name", x => _newVoiceNames.MutateValue(y => y.Add(x)), x => $"Added '{x}' name to list of possible options.", "Name");
            AddConfigInfo("Add Voice Name", "List voice names", () => "Current possible extra voice names:\n " + string.Join('\n', _newVoiceNames.GetValue()));
            AddConfigInfo <string>("Remove Voice Name", "Remove voice name", x => _newVoiceNames.MutateValue(y => y.Remove(x)), x => $"Removed '{x}' name from list of possible options.", "Name");

            AddConfigInfo <int>("Set Desired Free Channels", "Set desired amount", x => _desiredFreeChannels.SetValue(x), x => $"Set desired amount to {x}", "Amount");
            AddConfigInfo("Set Desired Free Channels", "Show desired amount", () => $"Current desired amount is {_desiredFreeChannels.GetValue ()}");

            AddConfigInfo <SocketVoiceChannel>("Ignore Channel", "Ignore channel", x => _ignoreChannels.MutateValue(y => y.Add(x.Id)), x => $"Added channel '{x.Name}' to list of ignored.", "Channel");
            AddConfigInfo <ulong>("Ignore Channel", "Ignore channel", x => _ignoreChannels.MutateValue(y => y.Add(GuildHandler.GetVoiceChannel(x).Id)), x => $"Added channel '{GuildHandler.GetVoiceChannel(x).Name}' to list of default.", "ignored");
            AddConfigInfo <string>("Ignore Channel", "Ignore channel", x => _ignoreChannels.MutateValue(y => y.Add(GuildHandler.GetVoiceChannel(x).Id)), x => $"Added channel '{GuildHandler.GetVoiceChannel(x).Name}' to list of ignored.", "Channel");

            AddConfigInfo <SocketVoiceChannel>("Unignore Channel", "Unignore channel", x => _ignoreChannels.MutateValue(y => y.Remove(x.Id)), x => $"Removed channel '{x.Name}' from list of ignored.", "Channel");
            AddConfigInfo <ulong>("Unignore Channel", "Unignore channel", x => _ignoreChannels.MutateValue(y => y.Remove(GuildHandler.GetVoiceChannel(x).Id)), x => $"Removed channel '{GuildHandler.GetVoiceChannel(x).Name}' from list of ignored.", "Channel");
            AddConfigInfo <string>("Unignore Channel", "Unignore channel", x => _ignoreChannels.MutateValue(y => y.Remove(GuildHandler.GetVoiceChannel(x).Id)), x => $"Removed channel '{GuildHandler.GetVoiceChannel(x).Name}' from list of ignored.", "Channel");

            AddConfigInfo <SocketCategoryChannel>("Set New Channel Category", "Set category", x => _newChannelCategory.SetValue(x.Id), x => $"Set category where new channels will be created to {x.Name}", "Channel");
            AddConfigInfo <ulong>("Set New Channel Category", "Set category", x => _newChannelCategory.SetValue(GuildHandler.GetCategoryChannel(x).Id), x => $"Set category where new channels will be created to {GuildHandler.GetCategoryChannel(x).Name}", "Channel");
            AddConfigInfo <string>("Set New Channel Category", "Set category", x => _newChannelCategory.SetValue(GuildHandler.GetCategoryChannel(x).Id), x => $"Set category where new channels will be created to {GuildHandler.GetCategoryChannel(x).Name}", "Channel");
            AddConfigInfo("Set New Channel Category", "Get category", () => $"New channels will currently be created in category {GuildHandler.GetCategoryChannel(_newChannelCategory.GetValue()).Name}");
        }
Exemple #2
0
        public override void Initialize()
        {
            GuildHandler.ReactionAdded   += OnReactionAdded;
            GuildHandler.ReactionRemoved += OnReactionRemoved;
            _karmaCommand = new KarmaCommandSet {
                ParentPlugin = this
            };
            SendMessage("Moduthulhu-Command Root", "AddCommand", _karmaCommand);

            _upvoteEmoteId   = GetConfigCache("UpvoteEmoteId", x => x.GetGuild().Emotes.Where(y => y.Name == "upvote").FirstOrDefault().ZeroIfNull());
            _downvoteEmoteId = GetConfigCache("DownvoteEmoteId", x => x.GetGuild().Emotes.Where(y => y.Name == "downvote").FirstOrDefault().ZeroIfNull());

            AddConfigInfo("Set Upvote Emote", "Get emote", () => $"Current upvote emote is '{GuildHandler.GetGuild().GetEmoteAsync(_upvoteEmoteId.GetValue()).Result.Name}'.");
            AddConfigInfo <string>("Set Upvote Emote", "Set emote", x => _upvoteEmoteId.SetValue((GuildHandler.GetGuild().GetEmoteAsync(_upvoteEmoteId.GetValue()).Result?.Id).GetValueOrDefault()),
                                   x => $"Set upvote emote to '{x}'.", "Emote");
            AddConfigInfo("Set Downvote Emote", "Get emote", () => $"Current downvote emote is '{GuildHandler.GetGuild().GetEmoteAsync(_downvoteEmoteId.GetValue()).Result.Name}'.");
            AddConfigInfo <string>("Set Downvote Emote", "Set emote", x => _downvoteEmoteId.SetValue((GuildHandler.GetGuild().GetEmoteAsync(_downvoteEmoteId.GetValue()).Result?.Id).GetValueOrDefault()),
                                   x => $"Set downote emote to '{x}'.", "Emote");

            AddGeneralFeaturesStateAttribute("Karma", "Tracking of total upvotes / downvotes per user.");
        }
Exemple #3
0
        public override void Initialize()
        {
            GuildHandler.MessageReceived += OnMessageRecieved;
            _phrases = GetConfigCache("Phrases", x => new List <Phrase>());

            #region
            AddConfigInfo("Add Phrase", "Add empty phrase.", () => { _phrases.GetValue().Add(new Phrase()); _phrases.Store(); }, (success) => $"Added new empty response phrase at index {_phrases.GetValue ().Count - 1}. You must edit it using the other config options available here.");
            AddConfigInfo <int>("Remove Phrase", "Remove phrase.", x => { _phrases.GetValue().RemoveAt(x); _phrases.Store(); }, (success, x) => $"Removed response phrase at the index {x}.", "Index");
            AddConfigInfo("List Phrases", "List current phrases.", () => "Current phrases:\n" + string.Join('\n', _phrases.GetValue().Select(x => _phrases.GetValue().IndexOf(x) + " -> " + x.ToString(GuildHandler))));

            AddConfigInfo("Set Phrase Trigger", "Set trigger", () => { _phrases.GetValue().LastOrDefault().Trigger = string.Empty; _phrases.Store(); }, (success) => $"Most recent phrase trigger reset.");
            AddConfigInfo <string>("Set Phrase Trigger", "Set trigger", y => { _phrases.GetValue().LastOrDefault().Trigger = y; _phrases.Store(); }, (success, y) => $"Most recent phrase trigger set to {y}.", "Trigger");
            AddConfigInfo <int>("Set Phrase Trigger", "Set trigger", x => { _phrases.GetValue()[x].Trigger = string.Empty; _phrases.Store(); }, (success, x) => $"Phrase trigger at index {x} reset.", "Index");
            AddConfigInfo <int, string>("Set Phrase Trigger", "Set trigger", (x, y) => { _phrases.GetValue()[x].Trigger = y; _phrases.Store(); }, (success, x, y) => $"Phrase trigger at index {x} updated to '{y}'.", "Index", "Trigger");

            AddConfigInfo("Set Phrase User", "Set user", () => { _phrases.GetValue().LastOrDefault().UserId = 0; _phrases.Store(); }, (success) => $"Most recent phrase user reset.");
            AddConfigInfo <SocketGuildUser>("Set Phrase User", "Set user", y => { _phrases.GetValue().LastOrDefault().UserId = y.Id; _phrases.Store(); }, (success, x) => $"Most recent phrase user updated to '{x.GetShownName ()}'.", "User");
            AddConfigInfo <string>("Set Phrase User", "Set user", y => { _phrases.GetValue().LastOrDefault().UserId = GuildHandler.GetUser(y).Id; _phrases.Store(); }, (success, y) => $"Most recent phrase user updated to '{GuildHandler.GetUser (y).GetShownName ()}'.", "Username");
            AddConfigInfo <ulong>("Set Phrase User", "Set user", y => { _phrases.GetValue().LastOrDefault().UserId = y; _phrases.Store(); }, (success, y) => $"Most recent phrase user updated to '{GuildHandler.GetUser (y).GetShownName ()}.", "User ID");

            AddConfigInfo <int>("Set Phrase User", "Set user", x => { _phrases.GetValue()[x].UserId = 0; _phrases.Store(); }, (success, x) => $"Phrase user at index {x} reset.", "Index");
            AddConfigInfo <int, SocketGuildUser>("Set Phrase User", "Set user", (x, y) => { _phrases.GetValue()[x].UserId = y.Id; _phrases.Store(); }, (success, x, y) => $"Phrase user at index {x} updated to '{y.GetShownName()}'.", "Index", "User");
            AddConfigInfo <int, string>("Set Phrase User", "Set user", (x, y) => { _phrases.GetValue()[x].UserId = GuildHandler.FindUser(y).Id; _phrases.Store(); }, (success, x, y) => $"Phrase user at index {x} updated to '{GuildHandler.GetUser (y).GetShownName ()}'.", "Index", "Username");
            AddConfigInfo <int, ulong>("Set Phrase User", "Set user", (x, y) => { _phrases.GetValue()[x].UserId = y; _phrases.Store(); }, (success, x, y) => $"Phrase user at index {x} updated to '{GuildHandler.GetUser(y).GetShownName ()}'.", "Index", "User ID");

            AddConfigInfo("Set Phrase Channel", "Set channel", () => { _phrases.GetValue().LastOrDefault().ChannelId = 0; _phrases.Store(); }, (success) => $"Most recent phrase channel reset.");
            AddConfigInfo <SocketTextChannel>("Set Phrase Channel", "Set channel", y => { _phrases.GetValue().LastOrDefault().ChannelId = y.Id; _phrases.Store(); }, (success, x) => $"Most recent phrase channel updated to '{x.Name}'.", "Channel");
            AddConfigInfo <string>("Set Phrase Channel", "Set channel", y => { _phrases.GetValue().LastOrDefault().ChannelId = GuildHandler.GetTextChannel(y).Id; _phrases.Store(); }, (success, x) => $"Most recent phrase channel updated to '{GuildHandler.GetTextChannel (x).Name}'.", "Channel Name");
            AddConfigInfo <ulong>("Set Phrase Channel", "Set channel", y => { _phrases.GetValue().LastOrDefault().ChannelId = y; _phrases.Store(); }, (success, x) => $"Most recent phrase channel updated to '{GuildHandler.GetTextChannel (x).Name}'.", "Channel ID");

            AddConfigInfo <int>("Set Phrase Channel", "Set channel", x => { _phrases.GetValue()[x].ChannelId = 0; _phrases.Store(); }, (success, x) => $"Phrase channel at index {x} reset.", "Index");
            AddConfigInfo <int, SocketTextChannel>("Set Phrase Channel", "Set channel", (x, y) => { _phrases.GetValue()[x].ChannelId = y.Id; _phrases.Store(); }, (success, x, y) => $"Phrase channel at index {x} updated to '{y.Name}'.", "Index", "Channel");
            AddConfigInfo <int, string>("Set Phrase Channel", "Set channel", (x, y) => { _phrases.GetValue()[x].ChannelId = GuildHandler.GetTextChannel(y).Id; _phrases.Store(); }, (success, x, y) => $"Phrase channel at index {x} updated to '{GuildHandler.GetTextChannel(y).Name}'.", "Index", "Channel Name");
            AddConfigInfo <int, ulong>("Set Phrase Channel", "Set channel", (x, y) => { _phrases.GetValue()[x].ChannelId = y; _phrases.Store(); }, (success, x, y) => $"Phrase channel at index {x} '{GuildHandler.GetTextChannel (y)}'.", "Index", "Channel ID");

            AddConfigInfo("Set Phrase Chance", "Set chance", () => { _phrases.GetValue().LastOrDefault().Chance = 0; _phrases.Store(); }, (success) => $"Most recent chance reset.");
            AddConfigInfo <double>("Set Phrase Chance", "Set chance", y => { _phrases.GetValue().LastOrDefault().Chance = Math.Clamp(y, 0d, 100d); _phrases.Store(); }, (success, y) => $"Most recent phrase chance updated to {y}.", "Chance");
            AddConfigInfo("Set Phrase Response", "Set response", () => { _phrases.GetValue().LastOrDefault().Response = string.Empty; _phrases.Store(); }, (success) => $"Most recent phrase response reset.");
            AddConfigInfo <string>("Set Phrase Response", "Set response", y => { _phrases.GetValue().LastOrDefault().Response = y; _phrases.Store(); }, (success, x) => $"Most recent phrase response updated {x}.", "Response");
            AddConfigInfo("Set Phrase Emoji", "Set emoji", () => { _phrases.GetValue().LastOrDefault().Emoji = string.Empty; _phrases.Store(); }, (success) => $"Most recent phrase emoji reset.");
            AddConfigInfo <string>("Set Phrase Emoji", "Set emoji", y => { _phrases.GetValue().LastOrDefault().Emoji = y; _phrases.Store(); }, (success, x) => $"Most recent phrase emoji updated {x}.", "Emoji");

            AddConfigInfo <int>("Set Phrase Chance", "Set chance", x => { _phrases.GetValue()[x].Chance = 100; _phrases.Store(); }, (success, x) => $"Phrase at index {x} chance reset.", "Index");
            AddConfigInfo <int, double>("Set Phrase Chance", "Set chance", (x, y) => { _phrases.GetValue()[x].Chance = Math.Clamp(y, 0d, 100d); _phrases.Store(); }, (success, x, y) => $"Phrase at index {x} chance updated to {y}.", "Index", "Chance");
            AddConfigInfo <int>("Set Phrase Response", "Set response", x => { _phrases.GetValue()[x].Response = string.Empty; _phrases.Store(); }, (success, x) => $"Phrase at index {x} response reset.", "Index");
            AddConfigInfo <int, string>("Set Phrase Response", "Set response", (x, y) => { _phrases.GetValue()[x].Response = y; _phrases.Store(); }, (success, x, y) => $"Phrase at index {x} response updated to {y}.", "Index", "Response");
            AddConfigInfo <int>("Set Phrase Emoji", "Set emoji", x => { _phrases.GetValue()[x].Emoji = string.Empty; _phrases.Store(); }, (success, x) => $"Phrase at index {x} emoji reset.", "Index");
            AddConfigInfo <int, string>("Set Phrase Emoji", "Set emoji", (x, y) => { _phrases.GetValue()[x].Emoji = y; _phrases.Store(); }, (success, x, y) => $"Phrase at index {x} emoji updated to {y}.", "Index", "Emoji");
            #endregion
            AddGeneralFeaturesStateAttribute("AutomatedPhrases", "Automatic response to certain phrases as configured.");
        }
Exemple #4
0
        private void AddConfigInfoForMessage(CachedValue <List <string> > message, string name)
        {
            string msg = string.Empty;

            AddConfigInfo <string>(name, "Add a message", x => message.MutateValue(y => y.Add(x)), x => $"Added new {name} message: '{x}'.", "Message");
            AddConfigInfo <int>(name, "Remove a message", x => message.MutateValue(y => { msg = y[x]; y.RemoveAt(x); }), x => $"Removed {name} message: '{msg}'.", "Index");
            AddConfigInfo(name, "Display messages", () => $"Current '{name}' messages:\n{string.Join('\n', message.GetValue().ToArray ())}");
        }
        public override void Initialize()
        {
            GuildHandler.UserJoined += GuildHandler_UserJoined;
            PopulateReferenceFunctions();

            _title       = GetConfigCache("Title", x => "Welcome to [ServerName]!");
            _description = GetConfigCache("Description", x => "Hello [Joinee]! You have been invited and thus completely voluntarily joined [ServerName], and we are absolutely thrilled to have you here! There is absolutely no reason to believe any memetic hazards to have been at play!");
            _url         = GetConfigCache <string>("Url", x => null);
            _colourHex   = GetConfigCache("Colour", x => "08F26E");
            _iconUrl     = GetConfigCache("IconUrl", x => "[ServerIconUrl]");
            _author      = GetConfigCache("Author", x => new EmbedAuthor(GuildHandler.BotUser.GetShownName(), null, GuildHandler.BotUser.GetAvatarUrl()));
            _fields      = GetConfigCache("Fields", x => new List <FieldData>());
            _footerText  = GetConfigCache("Footer", x => "[DateNow]");

            _command = new DemoWelcomeMessageCommand {
                ParentPlugin = this
            };
            SendMessage("Moduthulhu-Command Root", "AddCommand", _command);

            AddConfigInfo <string>("Set Welcome Title", "Set title", x => _title.SetValue(x), (success, x) => $"Welcome message title has been set to '{x}'.", "Title");
            AddConfigInfo <string>("Set Welcome Description", "Set description", x => _description.SetValue(x), (success, x) => $"Welcome message description has been set to '{x}'.", "Description");
            AddConfigInfo <string>("Set Welcome Url", "Set url", x => _url.SetValue(x), (success, x) => $"Welcome message url has been set to '{x}'.", "Url");
            AddConfigInfo <string>("Set Welcome Colour", "Set color (hex)", x => _colourHex.SetValue(x), (success, x) => $"Welcome message colour has been set to '#{x}'.", "Colour (hex)");
            AddConfigInfo <string>("Set Welcome Icon Url", "Set icon url", x => _iconUrl.SetValue(x), (success, x) => $"Welcome message icon url has been set to '{x}'.", "Icon Url");
            AddConfigInfo <string>("Set Welcome Footer", "Set footer", x => _footerText.SetValue(x), (success, x) => $"Welcome message footer has been set to '{x}'.", "Footer");

            AddConfigInfo <string, string>("Add Welcome Field", "Add field", (x, y) => _fields.MutateValue(z => z.Add(new FieldData(x, y, false))), (success, x, y) => $"Added field with title '{x}' and value '{y}'", "Title", "Value");
            AddConfigInfo <string, string, bool>("Add Welcome Field", "Add field", (x, y, z) => _fields.MutateValue(w => w.Add(new FieldData(x, y, z))), (success, x, y, z) => $"Added field with title '{x}' and value '{y}' that is inline: {z}", "Title", "Value", "Inline");
            AddConfigInfo("Add Welcome Field", "Add field", () => $"Current fields in the welcome message embed:{string.Join ("\n", _fields.GetValue ().Select (x => $"**{x.Name}**\n{x.Value}"))}");

            AddConfigInfo <string>("Remove Welcome Field", "Remove field", x => _fields.MutateValue(y => y.RemoveAll(z => z.Name == x)), (success, x) => $"Removed any fields with the title '{x}'.", "Title");

            AddConfigInfo <IUser>("Set Welcome Author", "Set Author", x => _author.SetValue(new EmbedAuthor(x.GetShownName(), null, x.GetAvatarUrl())), (success, x) => $"Set welcome message author to {x.GetShownName ()}.", "User");
            AddConfigInfo <string>("Set Welcome Author", "Set Author", x => _author.SetValue(new EmbedAuthor(x, null, null)), (success, x) => $"Set welcome message author to '{x}'.", "Author Name");
            AddConfigInfo <string, string>("Set Welcome Author", "Set Author", (x, y) => _author.SetValue(new EmbedAuthor(x, null, y)), (success, x, y) => $"Set welcome message author to '{x}' with icon url '{y}'.", "Author Name", "Author Icon Url");
            AddConfigInfo <string, string, string>("Set Welcome Author", "Set Author", (x, y, z) => _author.SetValue(new EmbedAuthor(x, z, y)), (success, x, y, z) => $"Set welcome message author to '{x}' with icon url '{y}' and url to {z}.", "Author Name", "Author Icon Url", "Author Url");
        }
Exemple #6
0
        public override void Initialize()
        {
            _command = new SetColour()
            {
                ParentPlugin = this
            };

            GuildHandler.UserJoined += OnUserJoined;
            SendMessage("Lomztein-Command Root", "AddCommand", _command);

            _colourRolePrefix = GetConfigCache("ColourRolePrefix", x => "cl_");
            _colourOnJoin     = GetConfigCache("ColourOnJoin", x => false);

            AddConfigInfo("Set Colour Prefix", "Set colour prefix", new Action <string>(x => _colourRolePrefix.SetValue(x)), () => $"Set colour prefix to '{_colourRolePrefix.GetValue()}'", "Prefix");
            AddConfigInfo("Set Colour Prefix", "Get colour prefix", () => $"Current colour prefix is '{_colourRolePrefix.GetValue()}'.");

            AddConfigInfo("Colour on Join", "Colour on join?", new Action(() => _colourOnJoin.SetValue(!_colourOnJoin.GetValue())), () => _colourOnJoin.GetValue() ? $"New members now be automatically given a random available colour on join." : $"New members will no longer be coloured on join.");
        }
Exemple #7
0
 public override void Initialize()
 {
     cmd = new UrbanDefineCommand {
         ParentPlugin = this
     };
     SendMessage("Moduthulhu-Command Root", "AddCommand", cmd);
     _enableHyperlinkReactions = GetConfigCache("EnableHyperlinkReactions", x => false);
     AddConfigInfo("Toggle Hyperlink Reactions", "Toggle reactions", () => _enableHyperlinkReactions.SetValue(!_enableHyperlinkReactions.GetValue()), () => _enableHyperlinkReactions.GetValue() ? "Hyperlink reactions has been enabled." : "Hyperlink reactions has been disabled.");
     GuildHandler.ReactionAdded += GuildHandler_ReactionAdded;
 }
        public override void Initialize()
        {
            _announcementChannel = GetConfigCache("AnnouncementChannel", x => x.GetGuild().TextChannels.FirstOrDefault(y => y.Name == "general" || y.Name == "main" || y.Name == "chat").ZeroIfNull());
            _announcementMessage = GetConfigCache("AnnouncementMessage", x => "Congratulations to **[USERNAME]** as today they celebrate their [AGE] birthday!");

            AddConfigInfo <string>("Set Birthday Channel", "Set announcement channel.", x => _announcementChannel.SetValue(GuildHandler.GetVoiceChannel(x).Id), (success, x) => $"Channel channel set to {GuildHandler.GetTextChannel(x).Mention}.", "Channel Name");
            AddConfigInfo <ulong>("Set Birthday Channel", "Set announcement channel.", x => _announcementChannel.SetValue(GuildHandler.GetVoiceChannel(x).Id), (success, x) => $"Channel channel set to {GuildHandler.GetTextChannel(x).Mention}.", "Channel Id");
            AddConfigInfo <SocketTextChannel>("Set Birthday Channel", "Set announcement channel.", x => _announcementChannel.SetValue(x.Id), (success, x) => $"Channel channel set to {x.Name}", "Channel");
            AddConfigInfo("Set Birthday Channel", "Get announcement channel.", () => $"Current announcement channel is {GuildHandler.GetTextChannel(_announcementChannel.GetValue()).Mention}.");

            AddConfigInfo <string>("Set Birthday Message", "Set birthday message.", x => _announcementMessage.SetValue(x), (success, x) => $"New announcement message: '{x}'.", "Message");
            AddConfigInfo("Set Birthday Message", "Get birthday message.", () => $"Current announcement message: '{_announcementMessage.GetValue()}'.");

            _command = new BirthdayCommand {
                ParentPlugin = this
            };
            _allBirthdays = GetDataCache("Birthdays", x => new Dictionary <ulong, BirthdayDate>());

            GuildHandler.Clock.OnHourPassed += Clock_OnHourPassed;

            SendMessage("Moduthulhu-Command Root", "AddCommand", _command);

            AddGeneralFeaturesStateAttribute("BirthdayGreetings", "Automatic birthday wishing if desired.");
        }