Example #1
0
        public async Task SetupAsync(bool createRoles, [Remainder] string guild)
        {
            try
            {
                GuildInfo config = GuildConfig.gConfig.Find(x => x.DiscordID.Contains(Context.Guild.Id.ToString()));
                if (config.DiscordID != null)
                {
                    GuildConfig.gConfig.Remove(config);
                }
                GuildConfig.Add(Context.Guild.Id.ToString(), guild);
                if (createRoles)
                {
                    await Context.Guild.CreateRoleAsync("Founder", null, Discord.Color.Gold);

                    await Context.Guild.CreateRoleAsync("Leader", null, Discord.Color.Gold);

                    await Context.Guild.CreateRoleAsync("Officer", null, Discord.Color.Orange);

                    await Context.Guild.CreateRoleAsync("Member", null, Discord.Color.Blue);

                    await Context.Guild.CreateRoleAsync("Initiate", null, Discord.Color.Green);

                    await Context.Guild.CreateRoleAsync("Guest", null, Discord.Color.DarkOrange);

                    Generic(Color.Blue,
                            "roles for this discord have been created!",
                            "The roles have been made but they don't do anything yet! Change their permissions to suit your needs.",
                            "Don't change the names, and don't put any roles above mine! This will mess up auto-assigning.");
                }
                else
                {
                    Generic(Color.Orange,
                            "you put false for creating roles.",
                            "If you already have the roles made, that is great! but if you haven't, my auto-assigning feature will not work.",
                            $"If you havent got the roles and want them, do {Config.bot.cmdPrefix}Setup true {guild}"
                            );
                }
                Generic(Color.Green, "setup was successful!", $"This discord, {Context.Guild.Name}, will give anyone who assigns in the guild {guild}, their rank according to [this realmeye page](https://www.realmeye.com/guild/{SpaceDestroyer(guild)})", "(If the roles have been made.)");
            }
            catch (Exception e)
            {
                Error(e.ToString());
            }
        }