fixed current implementations

This commit is contained in:
appelemac 2016-09-10 16:00:55 +02:00
parent 9952cc3bee
commit 219380faf9
2 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ namespace NadekoBot.Modules.Searches
} }
sb.AppendLine("```"); sb.AppendLine("```");
} }
await msg.ReplyLong(sb.ToString(), "```xl", "```", "```xl"); await msg.ReplyLong(sb.ToString(),addToPartialStart : "```xl\n",addToPartialEnd: "```", breakOn: new[] { "```xl\n", "\n" });
} }
[LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias] [LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
@ -127,7 +127,7 @@ namespace NadekoBot.Modules.Searches
sb.AppendLine(string.Join(",", group.Select(x => x.Triggers.FirstOrDefault()).OrderBy(x => x))); sb.AppendLine(string.Join(",", group.Select(x => x.Triggers.FirstOrDefault()).OrderBy(x => x)));
sb.AppendLine("```"); sb.AppendLine("```");
} }
await msg.ReplyLong(sb.ToString(), "```xl", "```", "```xl"); await msg.ReplyLong(sb.ToString(), addToPartialStart: "```xl\n", addToPartialEnd: "```", breakOn: new[] { "```xl\n", "\n" });
} }
[LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias] [LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias]
public async Task Convert(IUserMessage msg, string origin, string target, decimal value) public async Task Convert(IUserMessage msg, string origin, string target, decimal value)

View File

@ -42,7 +42,7 @@ namespace NadekoBot.Extensions
public static IEnumerable<IUser> Members(this IRole role) => public static IEnumerable<IUser> Members(this IRole role) =>
NadekoBot.Client.GetGuild(role.GuildId)?.GetUsers().Where(u => u.Roles.Contains(role)) ?? Enumerable.Empty<IUser>(); NadekoBot.Client.GetGuild(role.GuildId)?.GetUsers().Where(u => u.Roles.Contains(role)) ?? Enumerable.Empty<IUser>();
public static async Task<IUserMessage[]> ReplyLong(this IUserMessage msg, string content, string[] breakOn = null, string addToEnd = "", string addToStart = "") public static async Task<IUserMessage[]> ReplyLong(this IUserMessage msg, string content, string[] breakOn = null, string addToPartialEnd = "", string addToPartialStart = "")
{ {
if (content.Length == 0) return null; if (content.Length == 0) return null;
var characterLimit = 1750; var characterLimit = 1750;
@ -88,7 +88,7 @@ namespace NadekoBot.Extensions
{ {
//first item to add //first item to add
if (!firstItem) if (!firstItem)
builder.Append(addToStart); builder.Append(addToPartialStart);
else else
firstItem = false; firstItem = false;
builder.Append(buildItems.Dequeue()); builder.Append(buildItems.Dequeue());
@ -103,9 +103,9 @@ namespace NadekoBot.Extensions
} else } else
{ {
var peeked = buildItems.Peek(); var peeked = buildItems.Peek();
if (builder.Length + peeked.Length + addToEnd.Length > characterLimit) if (builder.Length + peeked.Length + addToPartialEnd.Length > characterLimit)
{ {
builder.Append(addToEnd); builder.Append(addToPartialEnd);
list.Add(await msg.Channel.SendMessageAsync(builder.ToString())); list.Add(await msg.Channel.SendMessageAsync(builder.ToString()));
builder.Clear(); builder.Clear();
} }