Ejemplo n.º 1
0
        public override void Initialize()
        {
            AssertPermission(GuildPermission.ManageChannels);

            _commandSet = new VoiceNameSet {
                ParentPlugin = this
            };
            GuildHandler.ChannelCreated        += OnChannelCreated;
            GuildHandler.ChannelDestroyed      += OnChannelDestroyed;
            GuildHandler.UserVoiceStateUpdated += OnVoiceStateUpdated;
            GuildHandler.GuildMemberUpdated    += OnGuildMemberUpdated;
            GuildHandler.ChannelUpdated        += OnChannelUpdated;
            InitDefaultTags();

            _channelNames = GetConfigCache("ChannelNames", x => x.GetGuild().VoiceChannels.ToDictionary(y => y.Id, z => z.Name));
            _channelNames.Store();

            _toIgnore = GetConfigCache("ToIgnore", x => new List <ulong> {
                (x.GetGuild().AFKChannel?.Id).GetValueOrDefault()
            });
            _musicBotId          = GetConfigCache("MusicBotId", x => (ulong)0);
            _internationalRoleId = GetConfigCache("MusicBotId", x => (ulong)0);
            _nameFormat          = GetConfigCache("NameFormat", x => $"{_formatStart}{_formatNameStr}{_formatEnd} - {_formatStart}{_formatGameStr}{_formatEnd} {_formatStart}({_formatAmountPlayersStr}){_formatEnd}"); // lol
            _shortenedGameNames  = GetConfigCache("ShortenedGameNames", x => new Dictionary <string, string>());

            AddConfigInfo("Set Channel Name", "Display channel names", () => "Current channel names:\n" + string.Join('\n', _channelNames.GetValue().Select(x => x.Value).ToArray()));
            AddConfigInfo <SocketVoiceChannel, string>("Set Channel Name", "Set channel name", (x, y) => _channelNames.MutateValue(z => z[x.Id] = y), (success, x, y) => $"Succesfully set channel '{x.Name}' to '{y}'", "Channel", "New name");
            AddConfigInfo <string, string>("Set Channel Name", "Set channel name", (x, y) => _channelNames.MutateValue(z => z[GuildHandler.GetVoiceChannel(x).Id] = y), (success, x, y) => "Succesfully set channel names.", "Channel", "New name");

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

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

            AddConfigInfo <SocketGuildUser>("Set Music Bot", "Set music bot.", x => _musicBotId.SetValue(x.Id), (success, x) => $"Set music bot to be {x.Id}.", "Music Bot");
            AddConfigInfo <string>("Set Music Bot", "Set music bot.", x => _musicBotId.SetValue(GuildHandler.GetUser(x).Id), (success, x) => $"Set music bot to be {GuildHandler.GetUser(x).GetShownName()}.", "Music Bot");
            AddConfigInfo("Set Music Bot", "Show music bot.", () => GuildHandler.FindUser(_musicBotId.GetValue()) == null ? "Current music bot doesn't exist :(" : "Current music bot is " + GuildHandler.GetUser(_musicBotId.GetValue()).GetShownName());

            AddConfigInfo <SocketRole>("Set International Role", "Set role.", x => _internationalRoleId.SetValue(x.Id), (success, x) => $"Set international role to be {x}.", "Role");
            AddConfigInfo <string>("Set International Role", "Set role.", x => _internationalRoleId.SetValue(GuildHandler.GetRole(x).Id), (success, x) => $"Set international role to be {GuildHandler.GetRole(x).Name}.", "Role Name");
            AddConfigInfo("Set International Role", "Show role.", () => GuildHandler.FindRole(_internationalRoleId.GetValue()) == null ? "Current international role doesn't exist :(" : "Current international role is " + GuildHandler.GetRole(_internationalRoleId.GetValue()).Name);

            AddConfigInfo("Set Name Format", "Set format", () => $"Current format is '{_nameFormat.GetValue()}' which might look like this in practice: '{FormatName(_nameFormat.GetValue(), _formatStart, _formatEnd, "General 1", "Cool Game 3: The Coolest", 5)}'.");
            AddConfigInfo <string>("Set Name Format", "Set format", x => _nameFormat.SetValue(x), (success, x) => $"Set format to '{x}' which might look like this in practice: '{FormatName(x, _formatStart, _formatEnd, "General 1", "Cool Game 3: The Coolest", 5)}'.", "Format");

            AddConfigInfo <string, string>("Shorten Game Name", "Shorten a games name", (x, y) => SetShortenedGameName(x, y), (success, x, y) => $"'{x}' will now be shortened to '{y}'.", "Game", "Name");
            SendMessage("Moduthulhu-Command Root", "AddCommand", _commandSet);

            AddGeneralFeaturesStateAttribute("AutomatedVoiceNames", "Automatically changing voice channel names to reflect games played within.");

            RegisterMessageAction("AddTag", x => AddTag(new Tag((string)x[0], (string)x[1], (Func <SocketVoiceChannel, bool>)x[2])));
            RegisterMessageAction("RemoveTag", x => RemoveTag((string)x[0]));

            SetStateChangeHeaders("Tags", "The following voice channel tags has been added", "The following voice channel tags has been removed", "The following  voice channel tags has been modified");

            RegisterMessageAction("UpdateChannel", x => UpdateChannel(GuildHandler.GetVoiceChannel((ulong)x[0])).ConfigureAwait(false));
        }
Ejemplo n.º 2
0
        public void NameShip(SocketGuildUser shippieOne, SocketGuildUser shippieTwo, string name)
        {
            ShipName shipName = new ShipName(shippieOne.Id, shippieTwo.Id, name);

            _shipNames.GetValue().Remove(shipName);
            _shipNames.MutateValue(x => x.Add(shipName));
        }
Ejemplo n.º 3
0
        public void NameShip(ulong shippieOne, ulong shippieTwo, string name)
        {
            ShipName shipName = new ShipName(shippieOne, shippieTwo, name);

            _shipNames.GetValue().Remove(shipName);
            _shipNames.MutateValue(x => x.Add(shipName));
        }
Ejemplo n.º 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)), (success, x) => $"Added new {name} message: '{x}'.", "Message");
            AddConfigInfo <int>(name, "Remove a message", x => message.MutateValue(y => { msg = y[x]; y.RemoveAt(x); }), (success, x) => $"Removed {name} message: '{msg}'.", "Index");
            AddConfigInfo(name, "Display messages", () => $"Current '{name}' messages:\n{string.Join('\n', message.GetValue().ToArray ())}");
        }
Ejemplo n.º 5
0
        private Task OnChannelCreated(SocketChannel channel)
        {
            if (channel is SocketVoiceChannel)
            {
                SocketVoiceChannel voiceChannel = channel as SocketVoiceChannel;

                if (!_temporaryChannels.Contains(channel.Id))
                {
                    _defaultChannels.MutateValue(x => x.Add(channel.Id));
                }
            }

            return(Task.CompletedTask);
        }
Ejemplo n.º 6
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}");
        }
Ejemplo n.º 7
0
        public bool AddPlugin(string pluginName)
        {
            Type pluginType = Plugin.Find(PluginLoader.GetPlugins(), pluginName);

            if (pluginType != null)
            {
                string fullName = Plugin.GetFullName(pluginType);
                if (_enabledPlugins.GetValue().Contains(fullName))
                {
                    throw new ArgumentException("Plugin " + fullName + " is already active.");
                }

                Type[] dependencies = PluginLoader.DependencyTree.GetDependencies(fullName);
                Type[] missing      = dependencies.Where(x => !_enabledPlugins.GetValue().Any(y => y.StartsWith(Plugin.GetFullName(x), StringComparison.Ordinal))).ToArray();
                if (missing.Length > 0)
                {
                    throw new ArgumentException($"Plugin {fullName} cannot be loaded as it is missing dependencies: {string.Join(",", missing.Select(x => Plugin.GetVersionedFullName(x)))}");
                }

                _enabledPlugins.MutateValue(x => x.Add(fullName));
                return(true);
            }
            throw new ArgumentException("No plugin named '" + pluginName + "' is available to be added.");
        }
Ejemplo n.º 8
0
        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");
        }
Ejemplo n.º 9
0
 public void AddShip(ulong guildId, Ship ship)
 {
     _ships.MutateValue(x => x.Add(ship));
 }
Ejemplo n.º 10
0
        public override void Initialize()
        {
            commandSet = new VoiceNameSet()
            {
                ParentPlugin = this
            };
            GuildHandler.ChannelCreated        += OnChannelCreated;
            GuildHandler.ChannelDestroyed      += OnChannelDestroyed;
            GuildHandler.UserVoiceStateUpdated += OnVoiceStateUpdated;
            GuildHandler.GuildMemberUpdated    += OnGuildMemberUpdated;
            InitDefaultTags();

            _channelNames = GetConfigCache("ChannelNames", x => x.GetGuild().VoiceChannels.ToDictionary(y => y.Id, z => z.Name));
            _toIgnore     = GetConfigCache("ToIgnore", x => new List <ulong>()
            {
                (x.GetGuild().AFKChannel?.Id).GetValueOrDefault()
            });
            //_nameFormat = GetConfigCache("NameFormat", x => "[TAGS][NAME] - [GAME]");
            _musicBotId          = GetConfigCache("MusicBotId", x => (ulong)0);
            _internationalRoleId = GetConfigCache("MusicBotId", x => (ulong)0);

            AddConfigInfo("Set Channel Name", "Display channel names", () => "Current channel names:\n" + string.Join('\n', _channelNames.GetValue().Select(x => x.Value).ToArray()));
            AddConfigInfo("Set Channel Name", "Set channel name", new Action <SocketVoiceChannel, string>((x, y) => _channelNames.MutateValue(z => z[x.Id] = y)), () => "Succesfully set channel names.", "Channel", "New name");
            AddConfigInfo("Set Channel Name", "Set channel name", new Action <string, string>((x, y) => _channelNames.MutateValue(z => z[GuildHandler.FindVoiceChannel(x).Id] = y)), () => "Succesfully set channel names.", "Channel", "New name");

            AddConfigInfo("Dont Name Channel", "Ignore channel", new Action <SocketVoiceChannel>((x) => _toIgnore.MutateValue(y => y.Add(x.Id))), () => "Added channel to list of ignored.", "Channel");
            AddConfigInfo("Dont Name Channel", "Ignore channel", new Action <ulong>((x) => _toIgnore.MutateValue(y => y.Add(x))), () => "Added channel to list of default.", "ignored");
            AddConfigInfo("Dont Name Channel", "Ignore channel", new Action <string>((x) => _toIgnore.MutateValue(y => y.Add(GuildHandler.FindVoiceChannel(x).Id))), () => "Added channel to list of ignored.", "Channel");

            AddConfigInfo("Do Name Channel", "Unignore channel", new Action <SocketVoiceChannel>((x) => _toIgnore.MutateValue(y => y.Remove(x.Id))), () => "Removed channel from list of ignored.", "Channel");
            AddConfigInfo("Do Name Channel", "Unignore channel", new Action <ulong>((x) => _toIgnore.MutateValue(y => y.Remove(x))), () => "Removed channel from list of ignored.", "Channel");
            AddConfigInfo("Do Name Channel", "Unignore channel", new Action <string>((x) => _toIgnore.MutateValue(y => y.Remove(GuildHandler.FindVoiceChannel(x).Id))), () => "Removed channel from list of ignored.", "Channel");

            AddConfigInfo("Set Music Bot", "Set music bot.", new Action <SocketGuildUser>((x) => _musicBotId.SetValue(x.Id)), () => $"Set music bot to be {GuildHandler.GetUser(_musicBotId.GetValue()).GetShownName()}.", "Music Bot");
            AddConfigInfo("Set Music Bot", "Set music bot.", new Action <string>((x) => _musicBotId.SetValue(GuildHandler.FindUser(x).Id)), () => $"Set music bot to be {GuildHandler.GetUser(_musicBotId.GetValue()).GetShownName()}.", "Music Bot");
            AddConfigInfo("Set Music Bot", "Show music bot.", () => GuildHandler.GetUser(_musicBotId.GetValue()) == null ? "Current music bot doesn't exist :(" : "Current music bot is " + GuildHandler.GetUser(_musicBotId.GetValue()).GetShownName());

            AddConfigInfo("Set International Role", "Set role.", new Action <SocketRole>((x) => _internationalRoleId.SetValue(x.Id)), () => $"Set international role to be {GuildHandler.GetRole(_internationalRoleId.GetValue()).Name}.", "Role");
            AddConfigInfo("Set International Role", "Set role.", new Action <string>((x) => _internationalRoleId.SetValue(GuildHandler.FindRole(x).Id)), () => $"Set international role to be {GuildHandler.GetRole(_internationalRoleId.GetValue()).Name}.", "Role Name");
            AddConfigInfo("Set International Role", "Show role.", () => GuildHandler.GetRole(_internationalRoleId.GetValue()) == null ? "Current international role doesn't exist :(" : "Current international role is " + GuildHandler.GetRole(_internationalRoleId.GetValue()).Name);

            SendMessage("Lomztein-Command Root", "AddCommand", commandSet);
        }
Ejemplo n.º 11
0
 public Quote AddQuote(Quote newQuote)
 {
     _quotes.MutateValue(x => x.Add(newQuote));
     return(newQuote);
 }