convert from sb to multiline strings

This commit is contained in:
fkndean 2016-11-12 18:50:39 -05:00
parent 870c11526f
commit 09d90e4a03

View File

@ -520,12 +520,13 @@ $@"🌍 **Weather for** 【{obj["target"]}】
var ps3 = items["ps3"]; var ps3 = items["ps3"];
var pc = items["pc"]; var pc = items["pc"];
sb.AppendLine("```css"); var response = $@"```css
sb.AppendLine($"[☕ BF3 Status: {status.ToString().ToUpper()}]"); [☕ BF3 Status: {status.ToString().ToUpper()}]
sb.AppendLine($"XBOX360: [{x360.ToString()}]"); XBOX360: [{x360.ToString()}]
sb.AppendLine($"PS3: [{ps3.ToString()}]"); PS3: [{ps3.ToString()}]
sb.Append($"PC: [{pc.ToString()}]```"); PC: [{pc.ToString()}]
await channel.SendMessageAsync(sb.ToString()); ```";
await channel.SendMessageAsync(response);
} }
else if (game.Equals("bf4", StringComparison.OrdinalIgnoreCase)) else if (game.Equals("bf4", StringComparison.OrdinalIgnoreCase))
{ {
@ -595,15 +596,16 @@ $@"🌍 **Weather for** 【{obj["target"]}】
var playerGlobal_Accuracy = Math.Round(Double.Parse(playerGlobal_Hits.ToString()) / Double.Parse(playerGlobal_Shots.ToString()), 2); var playerGlobal_Accuracy = Math.Round(Double.Parse(playerGlobal_Hits.ToString()) / Double.Parse(playerGlobal_Shots.ToString()), 2);
var playerGlobal_ELO = playerStats["global"]["elo"]; var playerGlobal_ELO = playerStats["global"]["elo"];
sb.AppendLine("```css"); var response = $@"```css
sb.AppendLine($"[☕ BF3 Player: {query}]"); [☕ BF3 Player: {query}]
sb.AppendLine($"Platform: [{platform.ToUpper()}]"); Platform: [{platform.ToUpper()}]
sb.AppendLine($"Tag: [{playerTag.ToString()}]"); Tag: [{playerTag.ToString()}]
sb.AppendLine($"K/D: [{playerGlobal_KD.ToString()}]"); K/D: [{playerGlobal_KD.ToString()}]
sb.AppendLine($"W/L: [{playerGlobal_WL.ToString()}]"); W/L: [{playerGlobal_WL.ToString()}]
sb.AppendLine($"Accuracy: %[{playerGlobal_Accuracy.ToString()}]"); Accuracy: %[{playerGlobal_Accuracy.ToString()}]
sb.Append($"ELO: [{playerGlobal_ELO.ToString()}]```"); ELO: [{playerGlobal_ELO.ToString()}]
await channel.SendMessageAsync(sb.ToString()); ```";
await channel.SendMessageAsync(response);
} else if (game.Equals("bf4", StringComparison.OrdinalIgnoreCase)) } else if (game.Equals("bf4", StringComparison.OrdinalIgnoreCase))
{ {
var res = await http.GetStringAsync($"http://api.bf4stats.com/api/playerInfo?plat={Uri.EscapeUriString(platform)}&name={Uri.EscapeUriString(query)}&output=json").ConfigureAwait(false); var res = await http.GetStringAsync($"http://api.bf4stats.com/api/playerInfo?plat={Uri.EscapeUriString(platform)}&name={Uri.EscapeUriString(query)}&output=json").ConfigureAwait(false);
@ -627,15 +629,16 @@ $@"🌍 **Weather for** 【{obj["target"]}】
var accuracy = Math.Round(Double.Parse(shotsHit.ToString()) / Double.Parse(shotsFired.ToString()), 2); var accuracy = Math.Round(Double.Parse(shotsHit.ToString()) / Double.Parse(shotsFired.ToString()), 2);
var playerELO = playerStats["elo"]; var playerELO = playerStats["elo"];
sb.AppendLine("```css"); var response = $@"```css
sb.AppendLine($"[☕ BF4 Player: {playerName.ToString()}]"); [☕ BF4 Player: {playerName.ToString()}]
sb.AppendLine($"Platform: [{playerPlatform.ToString().ToUpper()}]"); Platform: [{playerPlatform.ToString().ToUpper()}]
sb.AppendLine($"Tag: [{playerTag.ToString()}]"); Tag: [{playerTag.ToString()}]
sb.AppendLine($"K/D: [{player_KD.ToString()}]"); K/D: [{player_KD.ToString()}]
sb.AppendLine($"W/L: [{player_WL.ToString()}]"); W/L: [{player_WL.ToString()}]
sb.AppendLine($"Accuracy: %[{accuracy.ToString()}]"); Accuracy: %[{accuracy.ToString()}]
sb.Append($"ELO: [{playerELO.ToString()}]```"); ELO: [{playerELO.ToString()}]
await channel.SendMessageAsync(sb.ToString()); ```";
await channel.SendMessageAsync(response);
} }
} }
catch catch