if (message.value[0] == "/" or message.value[0] == "\"): do stuff.
I'm sure it's a simple syntax error, but something is wrong with this if statement.
Backslashes are used for escaping, so to display a backslash in a string literal you need to escape the backslash with another backslash.
The backslash (\) character is used to escape characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character. Follow this answer to receive notifications.
In Python strings, the backslash "\" is a special character, also called the "escape" character. It is used in representing certain whitespace characters: "\t" is a tab, "\n" is a newline, and "\r" is a carriage return.
When you only need to check for equality, you can also simply use the in
operator to do a membership test in a sequence of accepted elements:
if message.value[0] in ('/', '\\'): do_stuff()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With