* Various cleanup + utility methods

This commit is contained in:
Bryan Ashby 2014-11-04 23:50:42 -07:00
parent d242546458
commit f2388ceed1
6 changed files with 68 additions and 21 deletions

View file

@ -12,6 +12,7 @@ exports.getThemeInfo = getThemeInfo;
exports.getThemeArt = getThemeArt;
exports.getRandomTheme = getRandomTheme;
exports.initAvailableThemes = initAvailableThemes;
exports.displayThemeArt = displayThemeArt;
function getThemeInfo(themeID, cb) {
var path = paths.join(Config.paths.themes, themeID, 'theme_info.json');
@ -108,4 +109,16 @@ function getThemeArt(name, themeID, options, cb) {
cb(null, theArt.data);
}
});
}
function displayThemeArt(name, client, cb) {
getThemeArt(name, client.user.properties.art_theme_id, function onArt(err, theArt) {
if(err) {
cb(err);
} else {
art.display( { art : theArt, client : client }, function onDisplayed(err, mci) {
cb(err, mci);
});
}
});
}