aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorUnknown <jtsshieh@outlook.com>2018-04-05 20:18:43 -0400
committerUnknown <jtsshieh@outlook.com>2018-04-05 20:18:43 -0400
commitb41df418dcaa114a173b0eec234b4b71f91b7318 (patch)
treee3e54e0dd247a0057ddc3a53fcf0cf8c17559ad9 /plugins
parent777355db9cd0121fc41e554906ebaca049fe66ad (diff)
downloadPokeBot-b41df418dcaa114a173b0eec234b4b71f91b7318.tar.gz
PokeBot-b41df418dcaa114a173b0eec234b4b71f91b7318.tar.bz2
PokeBot-b41df418dcaa114a173b0eec234b4b71f91b7318.zip
gyms system
Diffstat (limited to 'plugins')
-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*';
+};