Quote:
Originally Posted by casimir
ps i think this is the code [...]
|
That repository is indeed of the bot
"buttplug_bot" unless there happen to be two Telegram bots with the exact same name. This can be concluded from
HushPlugBot.java on line 294.
Quote:
Originally Posted by casimir
[...] but cant make heads or tails of it
|
I have no experience with the Lovense API or Telegram bots so I can't give you a solution. But I believe to have found a possible cause. In the first code block, the bot request confirmation of a registered e-mail address by requesting a response from the API URL:
https://apps.lovense.com/ajaxCheckEmailOrUserIdRegisted?email= plus the provided email address.
Example responses:
URL:
https://apps.lovense.com/ajaxCheckEmailOrUserIdRegisted?email=cagac27656@fa xapdf.com
or URL:
https://apps.lovense.com/ajaxCheckEmailOrUserIdRegisted?email=apitestacc gives:
Reponse:
{"result":true,"code":0,"message":""}
URL:
https://apps.lovense.com/ajaxCheckEmailOrUserIdRegisted?email=cagac38294@fa xapdf.com
or URL:
https://apps.lovense.com/ajaxCheckEmailOrUserIdRegisted?email=apitestacc382 94 gives:
Response:
{"result":false,"code":400,"message":"User does not exist"}
Whether the e-mail exists or doesn't exist, the response won't give a status code 200 which results in returning
null. And as seen in the second code block, if the email check returns
null, it throws an IllegalStateException with the message
"Bot account "+Config.email+" does not exists at Lovense!"
I hope you find something useful in this reply.
EmailUtil.java on line 29
Code:
private static final String path = "/ajaxCheckEmailOrUserIdRegisted?email=";
public static String check(String email) {
try {
final HttpGet httpGet = new HttpGet(Config.apiUrl + path + URLEncoder.encode(email, "UTF-8"));
final CloseableHttpResponse response = Util.getHttpclient().execute(httpGet);
try {
if (response.getStatusLine().getStatusCode() == 200) {
final HttpEntity entity = response.getEntity();
final String json = EntityUtils.toString(entity);
final NormalResponse normalResponse = gson.fromJson(json, NormalResponse.class);
return normalResponse.isResult() ? normalResponse.getData().toString() : null;
}
return null;
} finally {
response.close();
}
} catch (final Exception e) {
logger.warn("Failed to check email {} ", email, e);
return null;
}
}
[...]
}
SmackConnection.java on line 97
Code:
String email = EmailUtil.check(Config.email);
if (email == null) {
throw new IllegalStateException("Bot account "+Config.email+" does not exists at Lovense!");
}