I've spent the last few days trying to figure out what on earth I was doing wrong with this library, turns out that when I was using include_str! to import my bot key from a file that the file had a trailing new line, which causes the library to randomly return HTTP 400 errors. So that no one falls into the same trap I did I recommend one of two changes:
1: Run a trim() on the input inside from_bot_token
2: Return an error in from_bot_token stating that a key cannot contain whitespace.
I've spent the last few days trying to figure out what on earth I was doing wrong with this library, turns out that when I was using include_str! to import my bot key from a file that the file had a trailing new line, which causes the library to randomly return HTTP 400 errors. So that no one falls into the same trap I did I recommend one of two changes:
1: Run a trim() on the input inside from_bot_token
2: Return an error in from_bot_token stating that a key cannot contain whitespace.