BetterDiscordApp-rauenzi/js/emotemodule.js

31 lines
1.4 KiB
JavaScript
Raw Normal View History

2015-08-25 14:54:51 +02:00
/* BetterDiscordApp Emote Module aka TwitchCord
* See https://github.com/Jiiks/BetterDiscordApp/blob/master/js/emotemodule.js
* Version: 1.0
* Author: Jiiks | http://jiiks.net
* Date: 25/08/2015 - 09:33
* https://github.com/Jiiks/BetterDiscordApp
*/
2015-08-25 13:26:36 +02:00
2015-08-25 14:54:51 +02:00
var config = require("../config.json");
2015-08-25 13:26:36 +02:00
2015-08-25 14:54:51 +02:00
var _helper;
2015-08-25 14:43:53 +02:00
2015-08-25 14:54:51 +02:00
function EmoteModule(helper) {
_helper = helper;
_helper.log("Emotes Initialized");
2015-08-25 14:43:53 +02:00
2015-08-25 14:54:51 +02:00
_helper.execJs('var twitchEmoteUrlStart = "' + config.EmoteModule.Twitch.EmoteUrlStart + '", twitchEmoteUrlEnd = "' + config.EmoteModule.Twitch.EmoteUrlEnd + '";');
_helper.execJs('var ffzEmoteUrlStart = "' + config.EmoteModule.FrankerFaceZ.EmoteUrlStart + '", ffzEmoteUrlEnd = "' + config.EmoteModule.FrankerFaceZ.EmoteUrlEnd + '";');
_helper.execJs('var bttvEmoteUrlStart = "' + config.EmoteModule.BetterTTV.EmoteUrlStart + '", bttvEmoteUrlEnd = "' + config.EmoteModule.BetterTTV.EmoteUrlEnd + '";');
2015-08-25 14:43:53 +02:00
2015-08-25 14:54:51 +02:00
_helper.download(config.Urls.Cdn + "master/" + config.EmoteModule.Twitch.EmoteData, function(twitchEmoteData) {
_helper.execJs("var emotesTwitch = " + twitchEmoteData + ";");
2015-08-25 14:43:53 +02:00
2015-08-25 14:54:51 +02:00
_helper.download(config.Urls.Cdn + "master/" + config.EmoteModule.FrankerFaceZ.EmoteData, function(ffzEmoteData) {
_helper.execJs("var emotesFfz = " + ffzEmoteData + ";");
_helper.injectJavaScript(config.Cdn + config.js.EmoteModule);
});
2015-08-25 14:43:53 +02:00
});
}
2015-08-25 14:54:51 +02:00
exports.EmoteModule = EmoteModule;