Skip to content

Commit ccf19f5

Browse files
committed
Revert colors for now
1 parent cf5305b commit ccf19f5

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "discord-compiler-bot"
33
description = "Discord bot to compile your spaghetti code."
4-
version = "3.6.3"
4+
version = "3.6.4"
55
authors = ["Michael Flaherty"]
66
edition = "2021"
77
build = "src/build.rs"

src/utls/discordhelpers/embeds.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ impl ToEmbed for wandbox::CompilationResult {
5555
embed = embed.color(COLOR_OKAY);
5656
}
5757
if !self.compiler_all.is_empty() {
58-
let str = discordhelpers::conform_external_str(&self.compiler_all, MAX_ERROR_LEN, false);
59-
embed = embed.field("Compiler Output", format!("```ansi{}\n```", str), false);
58+
let str =
59+
discordhelpers::conform_external_str(&self.compiler_all, MAX_ERROR_LEN, true);
60+
embed = embed.field("Compiler Output", format!("```{}\n```", str), false);
6061
}
6162
if !self.program_all.is_empty() {
62-
let str = discordhelpers::conform_external_str(&self.program_all, MAX_OUTPUT_LEN, false);
63-
embed = embed.field("Program Output", format!("```ansi\n{}\n```", str), false);
63+
let str =
64+
discordhelpers::conform_external_str(&self.program_all, MAX_OUTPUT_LEN, true);
65+
embed = embed.field("Program Output", format!("```\n{}\n```", str), false);
6466
}
6567
if !self.url.is_empty() {
6668
embed = embed.field("URL", &self.url, false);
@@ -97,10 +99,11 @@ impl ToEmbed for godbolt::GodboltResponse {
9799
errs.push_str(&line);
98100
}
99101

100-
let compliant_str = discordhelpers::conform_external_str(&errs, MAX_ERROR_LEN, false);
102+
let compliant_str =
103+
discordhelpers::conform_external_str(&errs, MAX_ERROR_LEN, true);
101104
return embed.field(
102105
"Compilation Errors",
103-
format!("```ansi\n{}```", compliant_str),
106+
format!("```\n{}```", compliant_str),
104107
false,
105108
);
106109
}
@@ -172,14 +175,14 @@ impl ToEmbed for godbolt::GodboltResponse {
172175
let stderr = errs.trim();
173176
let mut output = false;
174177
if !stdout.is_empty() {
175-
let str = discordhelpers::conform_external_str(stdout, MAX_OUTPUT_LEN, false);
176-
embed = embed.field("Program Output", format!("```ansi\n{}\n```", str), false);
178+
let str = discordhelpers::conform_external_str(stdout, MAX_OUTPUT_LEN, true);
179+
embed = embed.field("Program Output", format!("```\n{}\n```", str), false);
177180
output = true;
178181
}
179182
if !stderr.is_empty() {
180183
output = true;
181-
let str = discordhelpers::conform_external_str(stderr, MAX_ERROR_LEN, false);
182-
embed = embed.field("Compiler Output", format!("```ansi\n{}\n```", str), false);
184+
let str = discordhelpers::conform_external_str(stderr, MAX_ERROR_LEN, true);
185+
embed = embed.field("Compiler Output", format!("```\n{}\n```", str), false);
183186
}
184187

185188
if !output {

src/utls/discordhelpers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pub async fn send_completion_react(
285285
//
286286
// Here we also limit the text to 1000 chars, this prevents discord from
287287
// rejecting our embeds for being to long if someone decides to spam.
288-
pub fn conform_external_str(input: &str, max_len: usize, strip_ansi : bool) -> String {
288+
pub fn conform_external_str(input: &str, max_len: usize, strip_ansi: bool) -> String {
289289
let mut str = {
290290
if strip_ansi {
291291
let strip_result = strip_ansi_escapes::strip(input);

0 commit comments

Comments
 (0)