Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.on('command', function(event) {
- var defaultConsole = "xbox"; // Change this to xbox or ps
- var command = event.getCommand();
- var args = event.getArgs();
- if(command.equalsIgnoreCase("destiny")) {
- try {
- var HttpRequest = Packages.com.gmt2001.HttpRequest;
- var HashMap = Packages.java.util.HashMap;
- var h = new HashMap(1);
- var r = HttpRequest.getData(HttpRequest.RequestType.GET, "https://2g.be/twitch/destinyv2.php?query="+ args +"&user="+ event.getSender() +"&channel="+ $.channelName +"&defaultconsole="+ defaultConsole +"&bot=quorrabot", "", h);
- if (r.success) {
- $.say(r.content);
- } else {
- if (r.httpCode == 0) {
- $.say("Failed to connect to the server, please contact Xgerhard on twitch or tweet at @gerhardoh, error code 0");
- } else {
- $.say("Failed to connect to the server, please contact Xgerhard on twitch or tweet at @gerhardoh, error code 1");
- }
- }
- } catch (e) {
- $.say("Failed to connect to the server, please contact Xgerhard on twitch or tweet at @gerhardoh, error code 2");
- }
- }
- });
- setTimeout(function(){
- if ($.moduleEnabled('./commands/XgDestinyTracker.js')) {
- $.registerChatCommand("./commands/XgDestinyTracker.js", "destiny");
- }
- },10*1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement