Skip to content

Commit a3a2c9f

Browse files
authored
Merge pull request #336 from Aras14HD/allow-escaped-underscore-commands
Allow escaped underscore in commands
2 parents c810038 + 2cc9865 commit a3a2c9f

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

factorion-bot-discord/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "factorion-bot-discord"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
edition = "2024"
55
description = "factorion-bot (for factorials and related) on Discord"
66
license = "MIT"
@@ -10,7 +10,7 @@ keywords = ["factorial", "termial", "bot", "math", "discord"]
1010
categories = ["mathematics", "web-programming", "parser-implementations"]
1111

1212
[dependencies]
13-
factorion-lib = { path = "../factorion-lib", version = "6.0.0", features = ["serde", "influxdb"] }
13+
factorion-lib = { path = "../factorion-lib", version = "6.0.1", features = ["serde", "influxdb"] }
1414
serenity = { version = "0.12", default-features = false, features = ["client", "gateway", "rustls_backend", "model", "cache"] }
1515
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread", "time"] }
1616
dotenvy = "^0.15.7"

factorion-bot-reddit/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "factorion-bot-reddit"
3-
version = "6.0.0"
3+
version = "6.0.1"
44
edition = "2024"
55
description = "factorion-bot (for factorials and related) on Reddit"
66
license = "MIT"
@@ -10,7 +10,7 @@ keywords = ["factorial", "termial", "bot", "math"]
1010
categories = ["mathematics", "web-programming", "parser-implementations"]
1111

1212
[dependencies]
13-
factorion-lib = {path = "../factorion-lib", version = "6.0.0", features = ["serde", "influxdb"]}
13+
factorion-lib = {path = "../factorion-lib", version = "6.0.1", features = ["serde", "influxdb"]}
1414
reqwest = { version = "0.12.28", features = ["json", "native-tls"], default-features = false }
1515
serde = { version = "1.0.219", default-features = false, features = ["derive"] }
1616
serde_json = "1.0.140"

factorion-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "factorion-lib"
3-
version = "6.0.0"
3+
version = "6.0.1"
44
edition = "2024"
55
description = "A library used to create bots to recognize and calculate factorials and related concepts"
66
license = "MIT"

factorion-lib/src/comment.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,31 @@ impl Commands {
221221
termial: Self::contains_command_format(text, "termial")
222222
|| Self::contains_command_format(text, "triangle"),
223223
no_note: Self::contains_command_format(text, "no note")
224+
|| Self::contains_command_format(text, "no\\_note")
224225
|| Self::contains_command_format(text, "no_note"),
225226
write_out: Self::contains_command_format(text, "write_out")
226-
|| Self::contains_command_format(text, "write_num"),
227+
|| Self::contains_command_format(text, "write\\_out")
228+
|| Self::contains_command_format(text, "write_num")
229+
|| Self::contains_command_format(text, "write\\_num"),
227230
}
228231
}
229232
pub fn overrides_from_comment_text(text: &str) -> Self {
230233
Self {
231234
shorten: !Self::contains_command_format(text, "long"),
232235
steps: !(Self::contains_command_format(text, "no steps")
233-
|| Self::contains_command_format(text, "no_steps")),
236+
|| Self::contains_command_format(text, "no_steps")
237+
|| Self::contains_command_format(text, "no\\_steps")),
234238
nested: !(Self::contains_command_format(text, "no_nest")
239+
|| Self::contains_command_format(text, "no\\_nest")
235240
|| Self::contains_command_format(text, "multi")),
236241
termial: !(Self::contains_command_format(text, "no termial")
237-
|| Self::contains_command_format(text, "no_termial")),
242+
|| Self::contains_command_format(text, "no_termial")
243+
|| Self::contains_command_format(text, "no\\_termial")),
238244
no_note: !Self::contains_command_format(text, "note"),
239245
write_out: !(Self::contains_command_format(text, "dont_write_out")
240-
|| Self::contains_command_format(text, "normal_num")),
246+
|| Self::contains_command_format(text, "dont\\_write\\_out")
247+
|| Self::contains_command_format(text, "normal\\_num")
248+
|| Self::contains_command_format(text, "normal\\_num")),
241249
}
242250
}
243251
}

0 commit comments

Comments
 (0)