Beispiel #1
0
        public static string buildOptionalQuery(GuildOptions realmOptions)
        {
            string        query = "&fields=";
            List <string> tmp   = new List <string>();

            if ((realmOptions & GuildOptions.GetMembers) == GuildOptions.GetMembers)
            {
                tmp.Add("members");
            }

            if ((realmOptions & GuildOptions.GetAchievements) == GuildOptions.GetAchievements)
            {
                tmp.Add("achievements");
            }

            if ((realmOptions & GuildOptions.GetNews) == GuildOptions.GetNews)
            {
                tmp.Add("news");
            }

            if (tmp.Count == 0)
            {
                return(string.Empty);
            }

            query += string.Join(",", tmp.ToArray());

            return(query);
        }
Beispiel #2
0
        public async Task Create(string category, string title, [Remainder] string description)
        {
            GuildOptions options = await DataStore.GuildOptions.Include(o => o.IssueCategories).SingleOrDefaultAsync(o => o.Id == Context.Guild.Id);

            if (options is null)
            {
                throw new CommandExecutionException("Please set up the server before trying to create issues. Run the `setup` command to get started.");
            }

            var categoryObj = options.IssueCategories.SingleOrDefault(c => c.Name == category);

            if (categoryObj is null)
            {
                throw new CommandExecutionException("Invalid category name specified.");
            }

            Proposal proposal = new Proposal
            {
                CategoryId = categoryObj.Id,
                ChannelId  = Context.Channel.Id,
                GuildId    = Context.Guild.Id,
                MessageId  = Context.Message.Id,
                Status     = ProposalStatus.Approved
            };


            DataStore.Add(proposal);
            await DataStore.SaveChangesAsync();

            await IssueHelper.CreateIssue(proposal, Context.Channel, Context.Message, options, title : title, description : description);
        }
Beispiel #3
0
 public static Guild GetGuild(string realm, string name, GuildOptions options)
 {
     Guild guild = Guilds.Exists(g => (g.Name == name) && (g.Realm == realm))
                       ? Guilds.Find(g => (g.Name == name) && (g.Realm == realm))
                       : ApiClient.GetGuild(realm, name, options);
     return guild;
 }
        private Embed GenerateIssueEmbed(Issue issue, IssueCategory category, GuildOptions options, bool inline)
        {
            category ??= issue.Category ?? dataStore.Categories.Single(c => c.Id == issue.CategoryId);

            var embed = new EmbedBuilder()
                        .WithTitle($"{category?.EmojiIcon} `{issue.Number}` {issue.Title}")
                        .WithDescription(issue.Description)
                        .WithTimestamp(issue.LastUpdatedTimestamp)
                        .WithColor(Strings.StatusColors[issue.Status])
                        .WithImageUrl(issue.ImageUrl)
                        .WithThumbnailUrl(issue.ThumbnailUrl)
                        .WithFields(
                new EmbedFieldBuilder
            {
                Name     = "Status",
                Value    = $"{Strings.StatusEmojis[issue.Status]} {issue.Status}",
                IsInline = true
            },
                new EmbedFieldBuilder
            {
                Name     = "Priority",
                Value    = $"{Strings.PriorityEmojis[issue.Priority]} {issue.Priority}",
                IsInline = true
            },
                new EmbedFieldBuilder
            {
                Name     = "Author",
                Value    = mainInstance.Client.GetUser(issue.Author).ToString(),
                IsInline = true
            },
                new EmbedFieldBuilder
            {
                Name     = $"Jump to {(inline ? "Issue Log" : "Message")}",
                Value    = $"[Click Here](https://canary.discordapp.com/channels/{issue.GuildId}/{(inline ? options.LoggingChannelId : issue.ChannelId)}/{(inline ? issue.LogMessageId : issue.MessageId)})",
                IsInline = true
            }
                )
                        .WithFooter($"Category: {issue.Category.Name} • Last Updated");

            if (issue.Assignee.HasValue)
            {
                IUser assignee            = mainInstance.Client.GetUser(issue.Assignee.Value);
                EmbedAuthorBuilder author = new EmbedAuthorBuilder
                {
                    Name    = $"{assignee.Username}#{assignee.Discriminator}",
                    IconUrl = assignee.GetAvatarUrl() ?? assignee.GetDefaultAvatarUrl()
                };

                embed.Author = author;
            }
            else
            {
                embed.Author = new EmbedAuthorBuilder
                {
                    Name = "Nobody assigned"
                };
            }

            return(embed.Build());
        }
        public async Task Setup(IMessageChannel issueLogChannel, IMessageChannel dashboardChannel, IRole modRole, IRole voterRole, int minVotes = 3, string githubRepository = null)
        {
            using (var tx = await DataStore.Database.BeginTransactionAsync())
            {
                GuildOptions existingOpts = DataStore.GuildOptions.Find(Context.Guild.Id);
                var          options      = existingOpts ?? new GuildOptions();

                options.Id = Context.Guild.Id;
                options.LoggingChannelId = issueLogChannel.Id;
                options.TrackerChannelId = dashboardChannel.Id;
                options.ModeratorRoleId  = modRole.Id;
                options.VoterRoleId      = voterRole.Id;
                options.MinApprovalVotes = minVotes;
                options.GithubRepository = githubRepository;

                if (existingOpts != null)
                {
                    DataStore.GuildOptions.Update(options);
                }
                else
                {
                    DataStore.GuildOptions.Add(options);
                }
                await DataStore.SaveChangesAsync();

                await tx.CommitAsync();
            }
            await Context.Channel.SendMessageAsync("Settings created or updated successfully");
        }
        //http://stackoverflow.com/questions/1285986/flags-enum-bitwise-operations-vs-string-of-bits
        //http://www.codeproject.com/Articles/396851/Ending-the-Great-Debate-on-Enum-Flags
        public static string BuildOptionalFields(GuildOptions guildOptions)
        {
            string fields    = "&fields=";
            var    fieldList = new List <string>();

            if ((guildOptions & GuildOptions.Members) == GuildOptions.Members)
            {
                fieldList.Add("members");
            }

            if ((guildOptions & GuildOptions.Achievements) == GuildOptions.Achievements)
            {
                fieldList.Add("achievements");
            }

            if ((guildOptions & GuildOptions.News) == GuildOptions.News)
            {
                fieldList.Add("news");
            }

            if ((guildOptions & GuildOptions.Challenge) == GuildOptions.Challenge)
            {
                fieldList.Add("challenge");
            }

            if (fieldList.Count == 0)
            {
                return(string.Empty);
            }

            fields += string.Join(",", fieldList);
            return(fields);
        }
Beispiel #7
0
        public static Guild GetGuild(string realm, string name, GuildOptions options)
        {
            Guild guild = Guilds.Exists(g => (g.Name == name) && (g.Realm == realm))
                              ? Guilds.Find(g => (g.Name == name) && (g.Realm == realm))
                              : ApiClient.GetGuild(realm, name, options);

            return(guild);
        }
Beispiel #8
0
        public Guild GetGuild(Region region, string realm, string name, GuildOptions realmOptions)
        {
            Guild guild;

            TryGetData <Guild>(
                string.Format(@"{0}/wow/guild/{1}/{2}?locale={3}{4}&apikey={5}", Host, realm, name, Locale, GuildUtility.buildOptionalQuery(realmOptions), APIKey),
                out guild);

            return(guild);
        }
Beispiel #9
0
        public GuildRoot GetGuild(string name, GuildOptions guildOptions, string realm)
        {
            var guild = new GuildRoot();
            var url   = string.Format(@"{0}/wow/guild/{1}/{2}?{3}&locale={4}&apikey={5}",
                                      _Host,
                                      realm,
                                      name,
                                      GuildFields.BuildOptionalFields(guildOptions),
                                      _Locale,
                                      _APIKey);

            guild = json.GetDataFromURL <GuildRoot>(url);

            return(guild);
        }
Beispiel #10
0
        public static string buildOptionalQuery(GuildOptions realmOptions)
        {
            string query = "?fields=";
            List<string> tmp = new List<string>();

            if ((realmOptions & GuildOptions.GetMembers) == GuildOptions.GetMembers)
                tmp.Add("members");

            if ((realmOptions & GuildOptions.GetAchievements) == GuildOptions.GetAchievements)
                tmp.Add("achievements");

            query += string.Join(",", tmp);

            return query;
        }
Beispiel #11
0
        //realm in getGuildAsync does not work (404 not found), why? setting realm in apiclient constructor works.
        public async Task <GuildRoot> GetGuildAsync(string name, GuildOptions guildOptions, string realm)
        {
            var guild = new GuildRoot();
            var url   = string.Format(
                @"{0}/wow/guild/{1}/{2}?{3}&locale={4}&apikey={5}",
                _Host,
                realm,
                name,
                GuildFields.BuildOptionalFields(guildOptions),
                _Locale,
                _APIKey);

            guild = await this.jsonUtility.GetDataFromURLAsync <GuildRoot>(url);

            return(guild);
        }
        public static (bool voter, bool mod) GetVoterStatus(IGuildUser user, GuildOptions options)
        {
            bool mod   = false;
            bool voter = false;

            if (user?.RoleIds.Contains(options.ModeratorRoleId) ?? false)
            {
                mod   = true;
                voter = true;
            }
            if (user?.RoleIds.Contains(options.VoterRoleId) ?? false)
            {
                voter = true;
            }

            return(voter, mod);
        }
Beispiel #13
0
        public static string buildOptionalQuery(GuildOptions realmOptions)
        {
            string query = "&fields=";
            List<string> tmp = new List<string>();

            if ((realmOptions & GuildOptions.GetMembers) == GuildOptions.GetMembers)
                tmp.Add("members");

            if ((realmOptions & GuildOptions.GetAchievements) == GuildOptions.GetAchievements)
                tmp.Add("achievements");

            if (tmp.Count == 0) return string.Empty;

            query += string.Join(",", tmp.ToArray());

            return query;
        }
Beispiel #14
0
        public static async Task <GuildOptions> GetGuildConfigOrCreateAsync(this Database.GuildConfigContext context, ulong guildId)
        {
            var config = await context.Guilds.Include(x => x.ChannelsWithoutExp).Include(x => x.ChannelsWithoutSupervision).Include(x => x.CommandChannels).Include(x => x.SelfRoles)
                         .Include(x => x.Lands).Include(x => x.ModeratorRoles).Include(x => x.RolesPerLevel).Include(x => x.WaifuConfig).ThenInclude(x => x.CommandChannels).Include(x => x.Raports)
                         .Include(x => x.WaifuConfig).ThenInclude(x => x.FightChannels).FirstOrDefaultAsync(x => x.Id == guildId);

            if (config == null)
            {
                config = new GuildOptions
                {
                    Id          = guildId,
                    SafariLimit = 50
                };
                await context.Guilds.AddAsync(config);
            }
            return(config);
        }
Beispiel #15
0
        private EmbedBuilder GetNonSupChannelsConfig(GuildOptions config, SocketCommandContext context)
        {
            string value = "**Kanały bez nadzoru:**\n\n";

            if (config.ChannelsWithoutSupervision?.Count > 0)
            {
                foreach (var channel in config.ChannelsWithoutSupervision)
                {
                    value += $"{context.Guild.GetTextChannel(channel.Channel)?.Mention ?? "usunięty"}\n";
                }
            }
            else
            {
                value += "*brak*";
            }

            return(new EmbedBuilder().WithColor(EMType.Bot.Color()).WithDescription(value.TrimToLength(1950)));
        }
Beispiel #16
0
        private EmbedBuilder GetModRolesConfig(GuildOptions config, SocketCommandContext context)
        {
            string value = "**Role moderatorów:**\n\n";

            if (config.ModeratorRoles?.Count > 0)
            {
                foreach (var role in config.ModeratorRoles)
                {
                    value += $"{context.Guild.GetRole(role.Role)?.Mention ?? "usunięta"}\n";
                }
            }
            else
            {
                value += "*brak*";
            }

            return(new EmbedBuilder().WithColor(EMType.Bot.Color()).WithDescription(value.TrimToLength(1950)));
        }
Beispiel #17
0
        private EmbedBuilder GetLandsConfig(GuildOptions config, SocketCommandContext context)
        {
            string value = "**Krainy:**\n\n";

            if (config.Lands?.Count > 0)
            {
                foreach (var land in config.Lands)
                {
                    value += $"*{land.Name}*: M:{context.Guild.GetRole(land.Manager)?.Mention ?? "usunięta"} U:{context.Guild.GetRole(land.Underling)?.Mention ?? "usunięta"}\n";
                }
            }
            else
            {
                value += "*brak*";
            }

            return(new EmbedBuilder().WithColor(EMType.Bot.Color()).WithDescription(value.TrimToLength(1950)));
        }
Beispiel #18
0
        private EmbedBuilder GetWaifuFightChannelsConfig(GuildOptions config, SocketCommandContext context)
        {
            string value = "**Kanały walk waifu:**\n\n";

            if (config.WaifuConfig?.FightChannels?.Count > 0)
            {
                foreach (var channel in config.WaifuConfig.FightChannels)
                {
                    value += $"{context.Guild.GetTextChannel(channel.Channel)?.Mention ?? "usunięty"}\n";
                }
            }
            else
            {
                value += "*brak*";
            }

            return(new EmbedBuilder().WithColor(EMType.Bot.Color()).WithDescription(value.TrimToLength(1950)));
        }
Beispiel #19
0
        public async Task ChangePrefix(string newPrefix)
        {
            var guildId      = Context.Guild.Id;
            var guildOptions = _discordOptions.GuildOptions.SingleOrDefault(options => options.Id == guildId);

            if (guildOptions == null)
            {
                guildOptions = new GuildOptions {
                    Id = guildId
                };
                _discordOptions.GuildOptions.Add(guildOptions);
            }

            guildOptions.CommandPrefix = newPrefix;
            await Program.UpdateOptions(_discordOptions);

            await ReplyAsync("ok");
        }
Beispiel #20
0
        private EmbedBuilder GetLevelRolesConfig(GuildOptions config, SocketCommandContext context)
        {
            string value = "**Role na poziom:**\n\n";

            if (config.RolesPerLevel?.Count > 0)
            {
                foreach (var role in config.RolesPerLevel.OrderBy(x => x.Level))
                {
                    value += $"*{role.Level}*: {context.Guild.GetRole(role.Role)?.Mention ?? "usunięta"}\n";
                }
            }
            else
            {
                value += "*brak*";
            }

            return(new EmbedBuilder().WithColor(EMType.Bot.Color()).WithDescription(value.TrimToLength(1950)));
        }
Beispiel #21
0
        public static string BuildOptionalQuery(GuildOptions realmOptions)
        {
            var query = "&fields=";
            var tmp = new List<string>();

            if ((realmOptions & GuildOptions.GetMembers) == GuildOptions.GetMembers)
                tmp.Add("members");

            if ((realmOptions & GuildOptions.GetAchievements) == GuildOptions.GetAchievements)
                tmp.Add("achievements");

            if ((realmOptions & GuildOptions.GetNews) == GuildOptions.GetNews)
                tmp.Add("news");

            if ((realmOptions & GuildOptions.GetChallenge) == GuildOptions.GetChallenge)
                tmp.Add("challenge");

            if (tmp.Count == 0)
                return string.Empty;

            query += string.Join(",", tmp.ToArray());
            return query;
        }
        private async Task UpdateProposals(
            ISocketMessageChannel channel,
            IUserMessage message,
            bool mod,
            Proposal proposal,
            GuildOptions options
            )
        {
            if (mod)
            {
                proposal.Status = ProposalStatus.Approved;
                await helper.CreateIssue(proposal, channel, message, options);
            }
            else
            {
                proposal.ApprovalVotes++;
                if (proposal.ApprovalVotes >= options.MinApprovalVotes)
                {
                    await helper.CreateIssue(proposal, channel, message, options);
                }
            }

            dataStore.SaveChanges();
        }
Beispiel #23
0
        public override async Task <PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
        {
            IGuildUser user = context.User as IGuildUser;

            if (user is null)
            {
                return(PreconditionResult.FromError("This command needs to be ran in a server"));
            }
            if (user.GuildPermissions.ManageGuild)
            {
                return(PreconditionResult.FromSuccess());
            }

            GuildOptions options = await services.GetRequiredService <BugBotDataContext>().GuildOptions.FindAsync(user.GuildId);

            if (options is null)
            {
                return(PreconditionResult.FromError("Please run `setup` before using this command"));
            }

            return(user.RoleIds.Contains(options.ModeratorRoleId)
                        ? PreconditionResult.FromSuccess()
                        : PreconditionResult.FromError($"This command requires the role `{user.Guild.GetRole(options.ModeratorRoleId).Name}`"));
        }
Beispiel #24
0
        public EmbedBuilder GetConfiguration(GuildOptions config, SocketCommandContext context, ConfigType type)
        {
            switch (type)
            {
            case ConfigType.NonExpChannels:
                return(GetNonExpChannelsConfig(config, context));

            case ConfigType.NonSupChannels:
                return(GetNonSupChannelsConfig(config, context));

            case ConfigType.WaifuCmdChannels:
                return(GetWaifuCmdChannelsConfig(config, context));

            case ConfigType.WaifuFightChannels:
                return(GetWaifuFightChannelsConfig(config, context));

            case ConfigType.CmdChannels:
                return(GetCmdChannelsConfig(config, context));

            case ConfigType.LevelRoles:
                return(GetLevelRolesConfig(config, context));

            case ConfigType.Lands:
                return(GetLandsConfig(config, context));

            case ConfigType.ModeratorRoles:
                return(GetModRolesConfig(config, context));

            case ConfigType.SelfRoles:
                return(GetSelfRolesConfig(config, context));

            default:
            case ConfigType.Global:
                return(GetFullConfiguration(config, context));
            }
        }
Beispiel #25
0
        public async Task <Guild> GetGuildAsync(string realm, string guildName, GuildOptions guildOptions = GuildOptions.None)
        {
            string query = $"/wow/guild/{realm}/{guildName}";

            return(await reader.GetAsync <Guild>(query, GuildFields.BuildOptionalFields(guildOptions)));
        }
Beispiel #26
0
 public Embed GenerateInlineIssueEmbed(Issue issue, GuildOptions options = null, IssueCategory category = null)
 {
     options ??= dataStore.GuildOptions.Find(issue.GuildId);
     return(GenerateIssueEmbed(issue, category, options, true));
 }
Beispiel #27
0
 public Guild GetGuild(string realm, string name, GuildOptions realmOptions)
 {
     return(GetGuild(Region, realm, name, realmOptions));
 }
Beispiel #28
0
        public async Task CreateIssue(Proposal proposal, ISocketMessageChannel channel, IUserMessage message, GuildOptions options, string title = null, string description = null)
        {
            var category = proposal.Category ?? await dataStore.Categories.FindAsync(proposal.CategoryId);

            var now = DateTimeOffset.Now;

            var issue = new Issue
            {
                GuildId              = proposal.GuildId,
                ChannelId            = proposal.ChannelId,
                MessageId            = proposal.MessageId,
                Category             = proposal.Category,
                Status               = IssueStatus.ToDo,
                Title                = title ?? "",
                Priority             = IssuePriority.Low,
                Assignee             = null,
                Author               = message.Author.Id,
                CreatedTimestamp     = now,
                LastUpdatedTimestamp = now,
                Description          = description ?? message.Content,
                ThumbnailUrl         = null,
                ImageUrl             = message.Attachments.FirstOrDefault()?.Url
            };

            if (options.LoggingChannelId.HasValue)
            {
                var logchannel = (ISocketMessageChannel)mainInstance.Client.GetChannel(options.LoggingChannelId.Value);
                var logmessage = await logchannel.SendMessageAsync(embed : GenerateLogIssueEmbed(issue, category));

                await logmessage.AddReactionsAsync(IssueLogHelper.IssueLogReactions);

                issue.LogMessageId = logmessage.Id;
            }

            dataStore.Add(issue);
            await dataStore.SaveChangesAsync();

            //await channel.SendMessageAsync("Approved!", embed: IssueEmbedHelper.GenerateInlineIssueEmbed(issue, options, category));
        }
Beispiel #29
0
        public async Task UpdateLogIssueEmbed(Issue issue, IssueCategory category = null, GuildOptions options = null)
        {
            options ??= dataStore.GuildOptions.Find(issue.GuildId);
            if (options?.LoggingChannelId is null)
            {
                return;
            }

            if (!(mainInstance.Client.GetChannel(options.LoggingChannelId.Value) is IMessageChannel logChannel))
            {
                return;
            }

            if (!(await logChannel.GetMessageAsync(issue.LogMessageId) is IUserMessage logMessage))
            {
                return;
            }

            Embed embed = GenerateLogIssueEmbed(issue, category);
            await logMessage.ModifyAsync(mp => mp.Embed = embed);
        }
 public GuildApplicationOptions(ApplicationOptions application, GuildOptions guild)
 {
     Guild       = guild;
     Application = application;
 }
Beispiel #31
0
 /// <summary>
 /// Gets realm from client
 /// </summary>
 /// <param name="name"></param>
 /// <param name="guildOptions"></param>
 /// <returns></returns>
 public async Task <GuildRoot> GetGuildAsync(string name, GuildOptions guildOptions)
 {
     return(await this.GetGuildAsync(name, guildOptions, this.Realm));
 }
Beispiel #32
0
        //realm in getGuildAsync does not work (404 not found), why? setting realm in apiclient constructor works.
        public async Task <GuildRoot> GetGuildAsync(string name, GuildOptions guildOptions, string realm)
        {
            var url = $"{Host}/wow/guild/{realm}/{name}?{GuildFields.BuildOptionalFields(guildOptions)}&locale={Locale}&apikey={APIKey}";

            return(await this._jsonUtility.GetDataFromURLAsync <GuildRoot>(url));
        }
Beispiel #33
0
        private EmbedBuilder GetFullConfiguration(GuildOptions config, SocketCommandContext context)
        {
            var    modsRolesCnt = config.ModeratorRoles?.Count;
            string mods         = (modsRolesCnt > 0) ? $"({modsRolesCnt}) `config mods`" : "--";

            var    wExpCnt = config.ChannelsWithoutExp?.Count;
            string wExp    = (wExpCnt > 0) ? $"({wExpCnt}) `config wexp`" : "--";

            var    wSupCnt = config.ChannelsWithoutSupervision?.Count;
            string wSup    = (wSupCnt > 0) ? $"({wSupCnt}) `config wsup`" : "--";

            var    cmdChCnt = config.CommandChannels?.Count;
            string cmdCh    = (cmdChCnt > 0) ? $"({cmdChCnt}) `config cmd`" : "--";

            var    rolPerLvlCnt = config.RolesPerLevel?.Count;
            string roles        = (rolPerLvlCnt > 0) ? $"({rolPerLvlCnt}) `config role`" : "--";

            var    selfRolesCnt = config.SelfRoles?.Count;
            string selfRoles    = (selfRolesCnt > 0) ? $"({selfRolesCnt}) `config selfrole`" : "--";

            var    landsCnt = config.Lands?.Count;
            string lands    = (landsCnt > 0) ? $"({landsCnt}) `config lands`" : "--";

            var    wCmdCnt = config.WaifuConfig?.CommandChannels?.Count;
            string wcmd    = (wCmdCnt > 0) ? $"({wCmdCnt}) `config wcmd`" : "--";

            var    wFightCnt = config.WaifuConfig?.FightChannels?.Count;
            string wfCh      = (wFightCnt > 0) ? $"({wFightCnt}) `config wfight`" : "--";

            return(new EmbedBuilder
            {
                Color = EMType.Bot.Color(),
                Description = $"**Admin:** {context.Guild.GetRole(config.AdminRole)?.Mention ?? "--"}\n"
                              + $"**User:** {context.Guild.GetRole(config.UserRole)?.Mention ?? "--"}\n"
                              + $"**Mute:** {context.Guild.GetRole(config.MuteRole)?.Mention ?? "--"}\n"
                              + $"**ModMute:** {context.Guild.GetRole(config.ModMuteRole)?.Mention ?? "--"}\n"
                              + $"**Emote:** {context.Guild.GetRole(config.GlobalEmotesRole)?.Mention ?? "--"}\n\n"

                              + $"**W Market:** {context.Guild.GetTextChannel(config.WaifuConfig?.MarketChannel ?? 0)?.Mention ?? "--"}\n"
                              + $"**W Spawn:** {context.Guild.GetTextChannel(config.WaifuConfig?.SpawnChannel ?? 0)?.Mention ?? "--"}\n"
                              + $"**W Trash Fight:** {context.Guild.GetTextChannel(config.WaifuConfig?.TrashFightChannel ?? 0)?.Mention ?? "--"}\n"
                              + $"**W Trash Spawn:** {context.Guild.GetTextChannel(config.WaifuConfig?.TrashSpawnChannel ?? 0)?.Mention ?? "--"}\n"
                              + $"**W Trash Cmd:** {context.Guild.GetTextChannel(config.WaifuConfig?.TrashCommandsChannel ?? 0)?.Mention ?? "--"}\n"
                              + $"**Powiadomienia:** {context.Guild.GetTextChannel(config.NotificationChannel)?.Mention ?? "--"}\n"
                              + $"**Przywitalnia:** {context.Guild.GetTextChannel(config.GreetingChannel)?.Mention ?? "--"}\n"
                              + $"**Raport:** {context.Guild.GetTextChannel(config.RaportChannel)?.Mention ?? "--"}\n"
                              + $"**Todos:** {context.Guild.GetTextChannel(config.ToDoChannel)?.Mention ?? "--"}\n"
                              + $"**Quiz:** {context.Guild.GetTextChannel(config.QuizChannel)?.Mention ?? "--"}\n"
                              + $"**Nsfw:** {context.Guild.GetTextChannel(config.NsfwChannel)?.Mention ?? "--"}\n"
                              + $"**Log:** {context.Guild.GetTextChannel(config.LogChannel)?.Mention ?? "--"}\n\n"

                              + $"**W Cmd**: {wcmd}\n"
                              + $"**W Fight**: {wfCh}\n"
                              + $"**Role modów**: {mods}\n"
                              + $"**Bez exp**: {wExp}\n"
                              + $"**Bez nadzoru**: {wSup}\n"
                              + $"**Polecenia**: {cmdCh}\n"
                              + $"**Role na lvl**: {roles}\n"
                              + $"**AutoRole**: {selfRoles}\n"
                              + $"**Krainy**: {lands}".TrimToLength(1950)
            });
        }
Beispiel #34
0
        //Needs testing
        #region Guild

        /// <summary>
        /// Gets realm from client
        /// </summary>
        /// <param name="name"></param>
        /// <param name="guildOptions"></param>
        /// <returns>GuildRoot object</returns>
        public GuildRoot GetGuild(string name, GuildOptions guildOptions)
        {
            return(this.GetGuild(name, guildOptions, _Realm));
        }