unit tests, insert videos
This commit is contained in:
parent
aee04b5a13
commit
225faa948d
|
@ -87,15 +87,11 @@ public class TelegramAPI implements Runnable {
|
|||
* @param apikey
|
||||
*/
|
||||
public TelegramAPI(String apikey) {
|
||||
botname = "";
|
||||
if (!apikey.matches(TOKENREGEX) ) {
|
||||
throw new IllegalArgumentException("Invalid API key: " + apikey);
|
||||
}
|
||||
this.apikey = apikey;
|
||||
this(apikey, "");
|
||||
}
|
||||
|
||||
public TelegramAPI(String apikey, String botname) {
|
||||
this.botname = botname;
|
||||
this.botname = botname != null ? botname : "";
|
||||
|
||||
if (!apikey.matches(TOKENREGEX) ) {
|
||||
throw new IllegalArgumentException("Invalid API key: " + apikey);
|
||||
|
@ -505,8 +501,10 @@ public class TelegramAPI implements Runnable {
|
|||
} else {
|
||||
e = new UserSendMessageEvent(getMsg());
|
||||
//call feedback cmd first
|
||||
if(feedbackCmd.onMsg((UserSendMessageEvent) e)) {
|
||||
e = null;
|
||||
if(!disableFeedback) {
|
||||
if (feedbackCmd.onMsg((UserSendMessageEvent) e)) {
|
||||
e = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
getEventManager().callEvent(e);
|
||||
|
@ -520,8 +518,12 @@ public class TelegramAPI implements Runnable {
|
|||
TMessage msg = new TMessage(cbq.getJSONObject("message"), api);
|
||||
UserCallbackEvent event = new UserCallbackEvent(from, data, id, msg);
|
||||
|
||||
if(!feedbackCmd.onCallback(event))
|
||||
if(!disableFeedback) {
|
||||
if (!feedbackCmd.onCallback(event))
|
||||
getEventManager().callEvent(event);
|
||||
} else {
|
||||
getEventManager().callEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue