Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle special TryAPL replies with backspaces #2

Closed
rodrigogiraoserrao opened this issue Jun 23, 2021 · 5 comments
Closed

Handle special TryAPL replies with backspaces #2

rodrigogiraoserrao opened this issue Jun 23, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@rodrigogiraoserrao
Copy link
Owner

According to https://chat.stackexchange.com/transcript/message/58424796#58424796,
if TryAPL replies with a result that starts with a backspace, then it is a "special" reply that was tagged with the backspace so that the frontend of TryAPL could act in a special way. When that is the reply we get back, then the actual result we care about is the last item of the "backspace"-separated result.

It could raise the issue of "what if the expression typed actually returns a legit, purposeful backspace as the first character", but TryAPL returns the "picture" of the result, not the true result, so no legit result will ever start with backspace.

@rodrigogiraoserrao rodrigogiraoserrao added the bug Something isn't working label Jun 23, 2021
@abrudz
Copy link

abrudz commented Jun 23, 2021

In fact, when you detect a help tag, simply respond with a tweet that has the returned URL. No need to say "Run it…" or include a picture.

@rodrigogiraoserrao
Copy link
Owner Author

Therefore, should I detect backspace-tags and then, if it is a help tag, special-case that as well?

@abrudz
Copy link

abrudz commented Jun 23, 2021

What do you mean by "as well"? There's only one thing to special case here:
If the result from the TryAPL request comes back with a text that begins with a backspace, remove the tag, and post the rest of the text as a tweet by it self, without the "Run it online" lede or adding a picture.

@rodrigogiraoserrao
Copy link
Owner Author

You are assuming, then, that the only results that will ever start with backspace are help results? Or is it a known fact that that is how it is going to work?

@abrudz
Copy link

abrudz commented Jun 23, 2021

Good point. Better to check if the response begins with BShelpBS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants