Merge pull request #851 from samdivaio/dev

Better formating of some output
This commit is contained in:
Master Kwoth 2016-12-05 12:07:56 +01:00 committed by GitHub
commit 46cf6807fe
3 changed files with 26 additions and 26 deletions

View File

@ -99,19 +99,19 @@ namespace NadekoBot.Modules.Help
await channel.EmbedAsync(erro.Build()); await channel.EmbedAsync(erro.Build());
return; return;
} }
var str = $"{com.Text}"; var str = $"**`{com.Text}`**";
var alias = com.Aliases.Skip(1).FirstOrDefault(); var alias = com.Aliases.Skip(1).FirstOrDefault();
if (alias != null) if (alias != null)
str += $" / `{alias}`"; str += $" **/** **`{alias}`**";
var embed = new EmbedBuilder() var embed = new EmbedBuilder()
.WithAuthor(eau => eau.WithName("Help") .WithAuthor(eau => eau.WithName("Command")
.WithUrl("http://nadekobot.readthedocs.io/en/latest/Commands%20List/") .WithUrl("http://nadekobot.readthedocs.io/en/latest/Commands%20List/")
.WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl)) .WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl))
//.WithTitle(str) //.WithTitle(str)
//.WithDescription($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}") //.WithDescription($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}")
.AddField(fb => fb.WithIndex(1).WithName("**Command**").WithValue(str).WithIsInline(true)) .AddField(fb => fb.WithIndex(1).WithName(str).WithValue($"{ string.Format(com.Summary, com.Module.Prefix)} { GetCommandRequirements(com)}").WithIsInline(true))
.AddField(fb => fb.WithIndex(2).WithName("**Usage**").WithValue($"{string.Format(com.Remarks, com.Module.Prefix)}").WithIsInline(true)) .AddField(fb => fb.WithIndex(2).WithName("**Usage**").WithValue($"{string.Format(com.Remarks, com.Module.Prefix)}").WithIsInline(false))
.AddField(fb => fb.WithIndex(3).WithName("Description").WithValue($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}").WithIsInline(false)) //.AddField(fb => fb.WithIndex(3).WithName("**Description**").WithValue($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}").WithIsInline(true))
.WithColor(NadekoBot.OkColor); .WithColor(NadekoBot.OkColor);
if (com != null) if (com != null)
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false); await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);

View File

@ -44,15 +44,15 @@ namespace NadekoBot.Modules.Searches
var obj = JObject.Parse(response)["weather"]; var obj = JObject.Parse(response)["weather"];
var embed = new EmbedBuilder() var embed = new EmbedBuilder()
.AddField(fb => fb.WithName("🌍 Location").WithValue($"{obj["target"]}").WithIsInline(true)) .AddField(fb => fb.WithName("🌍 **Location**").WithValue($"{obj["target"]}").WithIsInline(true))
.AddField(fb => fb.WithName("📏 Lat,Long").WithValue($"{obj["latitude"]}, {obj["longitude"]}").WithIsInline(true)) .AddField(fb => fb.WithName("📏 **Lat,Long**").WithValue($"{obj["latitude"]}, {obj["longitude"]}").WithIsInline(true))
.AddField(fb => fb.WithName("☁ Condition").WithValue($"{obj["condition"]}").WithIsInline(true)) .AddField(fb => fb.WithName("☁ **Condition**").WithValue($"{obj["condition"]}").WithIsInline(true))
.AddField(fb => fb.WithName("😓 Humidity").WithValue($"{obj["humidity"]}%").WithIsInline(true)) .AddField(fb => fb.WithName("😓 **Humidity**").WithValue($"{obj["humidity"]}%").WithIsInline(true))
.AddField(fb => fb.WithName("💨 Wind Speed").WithValue($"{obj["windspeedk"]}km/h ({obj["windspeedm"]}mph)").WithIsInline(true)) .AddField(fb => fb.WithName("💨 **Wind Speed**").WithValue($"{obj["windspeedk"]}km/h ({obj["windspeedm"]}mph)").WithIsInline(true))
.AddField(fb => fb.WithName("🌡 Temperature").WithValue($"{obj["centigrade"]}°C ({obj["fahrenheit"]}°F)").WithIsInline(true)) .AddField(fb => fb.WithName("🌡 **Temperature**").WithValue($"{obj["centigrade"]}°C ({obj["fahrenheit"]}°F)").WithIsInline(true))
.AddField(fb => fb.WithName("🔆 Feels like").WithValue($"{obj["feelscentigrade"]}°C ({obj["feelsfahrenheit"]}°F)").WithIsInline(true)) .AddField(fb => fb.WithName("🔆 **Feels like**").WithValue($"{obj["feelscentigrade"]}°C ({obj["feelsfahrenheit"]}°F)").WithIsInline(true))
.AddField(fb => fb.WithName("🌄 Sunrise").WithValue($"{obj["sunrise"]}").WithIsInline(true)) .AddField(fb => fb.WithName("🌄 **Sunrise**").WithValue($"{obj["sunrise"]}").WithIsInline(true))
.AddField(fb => fb.WithName("🌇 Sunset").WithValue($"{obj["sunset"]}").WithIsInline(true)) .AddField(fb => fb.WithName("🌇 **Sunset**").WithValue($"{obj["sunset"]}").WithIsInline(true))
.WithColor(NadekoBot.OkColor); .WithColor(NadekoBot.OkColor);
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false); await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
} }

View File

@ -176,48 +176,48 @@ namespace NadekoBot.Modules.Utility
}, },
Fields = new[] { Fields = new[] {
new EmbedField() { new EmbedField() {
Name = "Author", Name = Format.Bold("Author"),
Value = stats.Author, Value = stats.Author,
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Library", Name = Format.Bold("Library"),
Value = stats.Library, Value = stats.Library,
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Bot ID", Name = Format.Bold("Bot ID"),
Value = NadekoBot.Client.GetCurrentUser().Id.ToString(), Value = NadekoBot.Client.GetCurrentUser().Id.ToString(),
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Commands Ran", Name = Format.Bold("Commands Ran"),
Value = stats.CommandsRan.ToString(), Value = stats.CommandsRan.ToString(),
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Messages", Name = Format.Bold("Messages"),
Value = $"{stats.MessageCounter} [{stats.MessagesPerSecond:F2}/sec]", Value = $"{stats.MessageCounter} ({stats.MessagesPerSecond:F2}/sec)",
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Memory", Name = Format.Bold("Memory"),
Value = $"{stats.Heap} MB", Value = $"{stats.Heap} MB",
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Owner ID(s)", Name = Format.Bold("Owner ID(s)"),
Value = stats.OwnerIds, Value = stats.OwnerIds,
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Uptime", Name = Format.Bold("Uptime"),
Value = stats.GetUptimeString("\n"), Value = stats.GetUptimeString("\n"),
Inline = true Inline = true
}, },
new EmbedField() { new EmbedField() {
Name = "Presence", Name = Format.Bold("Presence"),
Value = $"{NadekoBot.Client.GetGuilds().Count} servers\n{stats.TextChannels} Text Channels\n{stats.VoiceChannels} Voice Channels", Value = $"{NadekoBot.Client.GetGuilds().Count} Servers\n{stats.TextChannels} Text Channels\n{stats.VoiceChannels} Voice Channels",
Inline = true Inline = true
}, },