You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It forces the username to be the bot's username, so we don't clean other bot's commands or weird texts, this is done to avoid false positives with commands. You can see the username being used here on the match (^username)
It just cleans the username from the command, the text received could be something like /test@bot with other @user, that would be transformed to /test with other @user, but the bot can receive /test with other @user directly, and just doing the split with @ would return weird things
https://github.com/rockneurotiko/ex_gram/blob/master/lib/ex_gram/middleware/ignore_username.ex#L28
Another way to write this is :
This handles both the cases of
text
being/command@username
and "/command"we are not even using
username
Am I missing any case?
The text was updated successfully, but these errors were encountered: