aboutsummaryrefslogtreecommitdiff
path: root/plugins/gyms.js
diff options
context:
space:
mode:
authorTrey <trey6979@gmail.com>2018-04-06 13:37:22 -0400
committerTrey <trey6979@gmail.com>2018-04-06 13:37:22 -0400
commit20b860bb2299d4a45aa9899fcab2b340cbe9a0b5 (patch)
tree4022b84287f9df17854947a6f6ae98665719f209 /plugins/gyms.js
parentb85b686829798f29f5f19fe919ae8807ef9ad69c (diff)
parente39d116465334ce84ee06267e8defb6007dddf22 (diff)
downloadPokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.tar.gz
PokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.tar.bz2
PokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.zip
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
Diffstat (limited to 'plugins/gyms.js')
-rw-r--r--plugins/gyms.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/gyms.js b/plugins/gyms.js
new file mode 100644
index 0000000..d4b1afe
--- /dev/null
+++ b/plugins/gyms.js
@@ -0,0 +1,34 @@
+/** **************************************
+ *
+ * Gyms: Plugin for PokeBot that enables gym features.
+ * Copyright (C) 2018 TheEdge, jtsshieh, Alee
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * *************************************/
+
+exports.isTeam = (member) => {
+ let team;
+ if (member.roles.find('name', 'Skull')) team = 'Skull';
+ if (member.roles.find('name', 'Flare')) team = 'Flare';
+ return team ? true : false;
+};
+
+exports.getTeam = (member) => {
+ let team;
+ if (member.roles.find('name', 'Skull')) team = 'Skull';
+ if (member.roles.find('name', 'Flare')) team = 'Flare';
+ return team;
+};
+
+exports.getOwnerId = (title) => {
+ return title.slice(15).substring(0, 18);
+};
+
+exports.getGymString = (bot, member) => {
+ return 'Current Owner: ' + member.id + '/' + member.user.tag + '/' + bot.plugins.gyms.getTeam(member);
+};
+
+exports.isOwned = (title) => {
+ return title != 'Current Owner: *none*';
+};