From d330bbf25a7a9bb48eaef4f717ce243e065f85b8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 30 Mar 2018 21:13:41 -0400 Subject: whitelist --- Plugins/whitelist.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Plugins/whitelist.js (limited to 'Plugins') diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js new file mode 100644 index 0000000..4c7dd8b --- /dev/null +++ b/Plugins/whitelist.js @@ -0,0 +1,39 @@ +/** ************************************** + * + * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * *************************************/ + +const db = require('quick.db'); +exports.whitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, true); +}; + +exports.unwhitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, false); +}; + +exports.checkWhitelist = async (guildID) => { + const value = await db.fetch(`whitelist_${guildID}`); + if (value) { + return value; + } + else { + await db.set(`whitelist_${guildID}`, false); + return await db.fetch(`whitelist_${guildID}`); + } +}; -- cgit v1.2.3 From d9d41aa8a2593d9e9171af9de93c043fe96ea5e6 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 30 Mar 2018 21:17:46 -0400 Subject: whoops --- Plugins/whitelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Plugins') diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js index 4c7dd8b..ff102aa 100644 --- a/Plugins/whitelist.js +++ b/Plugins/whitelist.js @@ -27,7 +27,7 @@ exports.unwhitelist = async (guildID) => { await db.set(`whitelist_${guildID}`, false); }; -exports.checkWhitelist = async (guildID) => { +exports.isWhitelist = async (guildID) => { const value = await db.fetch(`whitelist_${guildID}`); if (value) { return value; -- cgit v1.2.3 From ac6fc04fcf61c7e8dbc13a9de15595ebbd27126d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:45:52 -0400 Subject: HUGE cleanup --- Plugins/Music.js | 13 +----- Plugins/economy.js | 13 +----- Plugins/settings.js | 13 +----- Plugins/whitelist.js | 13 +----- canvas@2.0.0-alpha.11 | 0 cd | 0 commands/Fun/8ball.js | 13 +----- commands/Fun/balance.js | 13 +----- commands/Fun/cureboredom.js | 13 +----- commands/Fun/findmyphone.js | 13 +----- commands/Fun/getcredits.js | 13 +----- commands/Fun/og151.js | 13 +----- commands/Fun/ship.js | 13 +----- commands/Fun/slots.js | 13 +----- commands/Fun/story.js | 13 +----- commands/Getting Started/contribute.js | 13 +----- commands/Getting Started/help.js | 13 +----- commands/Getting Started/ping.js | 13 +----- commands/Getting Started/start.js | 13 +----- commands/Moderation/ban.js | 13 +----- commands/Moderation/interrogate.js | 13 +----- commands/Moderation/jail.js | 13 +----- commands/Moderation/kick.js | 13 +----- commands/Moderation/lswarns.js | 13 +----- commands/Moderation/purge.js | 13 +----- commands/Moderation/setLogs.js | 13 +----- commands/Moderation/setSuggestions.js | 44 ++++++++------------- commands/Moderation/softban.js | 13 +----- commands/Moderation/timeout.js | 13 +----- commands/Moderation/warn.js | 13 +----- commands/Music/play.js | 13 +----- commands/Music/skip.js | 13 +----- commands/Owners Only/eval.js | 13 +----- commands/Owners Only/modifycredits.js | 13 +----- commands/Owners Only/poweroff.js | 13 +----- commands/Owners Only/say.js | 13 +----- commands/Owners Only/testingcredits.js | 13 +----- commands/Owners Only/triggeregg.js | 13 +----- commands/Pokemon/claim.js | 13 +----- commands/Pokemon/drop.js | 13 +----- commands/Pokemon/forcedrop.js | 13 +----- commands/Pokemon/join.js | 13 +----- commands/Pokemon/leave.js | 13 +----- commands/Pokemon/lsitem.js | 13 +----- commands/Pokemon/tradegym.js | 13 +----- commands/Utility/character.js | 15 +------ commands/Utility/git.js | 38 ++++++------------ commands/Utility/invite.js | 18 ++------- commands/Utility/nick.js | 13 +----- commands/Utility/suggest.js | 13 +----- commands/Utility/uptime.js | 13 +----- commands/Utility/userinfo.js | 13 +----- events/channelCreate.js | 13 +----- events/guildMemberAdd.js | 13 +----- events/guildMemberRemove.js | 13 +----- events/message.js | 13 +----- events/messageDelete.js | 15 +------ events/messageDeleteBulk.js | 15 +------ events/messageUpdate.js | 15 +------ events/ready.js | 13 +----- ls | 0 node-pre-gyp | 0 npm | 0 test.js | 72 ---------------------------------- 64 files changed, 91 insertions(+), 804 deletions(-) delete mode 100644 canvas@2.0.0-alpha.11 delete mode 100644 cd delete mode 100644 ls delete mode 100644 node-pre-gyp delete mode 100644 npm delete mode 100644 test.js (limited to 'Plugins') diff --git a/Plugins/Music.js b/Plugins/Music.js index 25164b7..2dbabda 100644 --- a/Plugins/Music.js +++ b/Plugins/Music.js @@ -3,18 +3,7 @@ * Music: Plugin for PokeBot that interacts with the Lavalink API. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/Plugins/economy.js b/Plugins/economy.js index aa0bb24..3658ce8 100644 --- a/Plugins/economy.js +++ b/Plugins/economy.js @@ -3,18 +3,7 @@ * Economy: Plugin for PokeBot that enables economy features. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/Plugins/settings.js b/Plugins/settings.js index d458c9c..bfa15d5 100644 --- a/Plugins/settings.js +++ b/Plugins/settings.js @@ -3,18 +3,7 @@ * Settings: Plugin for PokeBot that enables settings features. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js index ff102aa..41b4398 100644 --- a/Plugins/whitelist.js +++ b/Plugins/whitelist.js @@ -3,18 +3,7 @@ * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/canvas@2.0.0-alpha.11 b/canvas@2.0.0-alpha.11 deleted file mode 100644 index e69de29..0000000 diff --git a/cd b/cd deleted file mode 100644 index e69de29..0000000 diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 16d5d24..48f53e0 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -3,18 +3,7 @@ * 8ball: Plugin for PokeBot that allows users to use an 8ball. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/balance.js b/commands/Fun/balance.js index 6bfd2b0..afe094e 100644 --- a/commands/Fun/balance.js +++ b/commands/Fun/balance.js @@ -3,18 +3,7 @@ * Get Credits: Plugin for PokeBot that gives you credits. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/cureboredom.js b/commands/Fun/cureboredom.js index 1b7913c..4b99406 100644 --- a/commands/Fun/cureboredom.js +++ b/commands/Fun/cureboredom.js @@ -3,18 +3,7 @@ * CureBoredom: Plugin for PokeBot that "cures" your boredom. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/findmyphone.js b/commands/Fun/findmyphone.js index 1575917..135d449 100644 --- a/commands/Fun/findmyphone.js +++ b/commands/Fun/findmyphone.js @@ -3,18 +3,7 @@ * FindMyPhone: Plugin for PokeBot that "helps you find your phone". * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/getcredits.js b/commands/Fun/getcredits.js index f52ee38..1d8b79b 100644 --- a/commands/Fun/getcredits.js +++ b/commands/Fun/getcredits.js @@ -3,18 +3,7 @@ * Get Credits: Plugin for PokeBot that gives you credits. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ const commandCooldown = new Set(); diff --git a/commands/Fun/og151.js b/commands/Fun/og151.js index aa9a288..d2b3ccf 100644 --- a/commands/Fun/og151.js +++ b/commands/Fun/og151.js @@ -3,18 +3,7 @@ * og151: Plugin for PokeBot that randomly picks 1 out of the original 151 Pokemon. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/ship.js b/commands/Fun/ship.js index fdf9e3e..ba31db5 100644 --- a/commands/Fun/ship.js +++ b/commands/Fun/ship.js @@ -3,18 +3,7 @@ * Ship: Plugin for PokeBot that ships the user with someone else. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/slots.js b/commands/Fun/slots.js index b3295b4..ddd6757 100644 --- a/commands/Fun/slots.js +++ b/commands/Fun/slots.js @@ -3,18 +3,7 @@ * Slots: Plugin for PokeBot that allows you to gamble. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * TLicensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Fun/story.js b/commands/Fun/story.js index 538bade..c35e3e7 100644 --- a/commands/Fun/story.js +++ b/commands/Fun/story.js @@ -3,18 +3,7 @@ * Story: Plugin for PokeBot that tells the user a story. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Getting Started/contribute.js b/commands/Getting Started/contribute.js index 0e1ae82..2530058 100644 --- a/commands/Getting Started/contribute.js +++ b/commands/Getting Started/contribute.js @@ -3,18 +3,7 @@ * Contribute: Plugin for PokeBot that redirects users to the proper place to contribute. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js index 457e6ec..94a2128 100644 --- a/commands/Getting Started/help.js +++ b/commands/Getting Started/help.js @@ -3,18 +3,7 @@ * Help: Plugin for PokeBot that guides the user on how to use the bot. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Getting Started/ping.js b/commands/Getting Started/ping.js index 3de0479..365c9f4 100644 --- a/commands/Getting Started/ping.js +++ b/commands/Getting Started/ping.js @@ -3,18 +3,7 @@ * Ping: Plugin for PokeBot that provides diagnostic information. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Getting Started/start.js b/commands/Getting Started/start.js index c31ff1c..9da8be7 100644 --- a/commands/Getting Started/start.js +++ b/commands/Getting Started/start.js @@ -3,18 +3,7 @@ * GettingStarted: Plugin for PokeBot that guides the user on how to start a journey. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 5974c53..545618c 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -3,18 +3,7 @@ * Ban: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/interrogate.js b/commands/Moderation/interrogate.js index 8fa9708..a8fc250 100644 --- a/commands/Moderation/interrogate.js +++ b/commands/Moderation/interrogate.js @@ -3,18 +3,7 @@ * Interrogate: Plugin for PokeBot that allows the staff to investigate the fish :cod: * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/jail.js b/commands/Moderation/jail.js index 9923540..3388663 100644 --- a/commands/Moderation/jail.js +++ b/commands/Moderation/jail.js @@ -3,18 +3,7 @@ * Jail: Plugin for PokeBot that punishes bad boys.. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index c9d1d24..3a8c597 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -3,18 +3,7 @@ * Kick: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/lswarns.js b/commands/Moderation/lswarns.js index 7d03c12..0a165b3 100644 --- a/commands/Moderation/lswarns.js +++ b/commands/Moderation/lswarns.js @@ -3,18 +3,7 @@ * List Warns: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js index 256dca8..6ce557c 100644 --- a/commands/Moderation/purge.js +++ b/commands/Moderation/purge.js @@ -3,18 +3,7 @@ * Purge: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/setLogs.js b/commands/Moderation/setLogs.js index a354085..8ae50ea 100644 --- a/commands/Moderation/setLogs.js +++ b/commands/Moderation/setLogs.js @@ -3,18 +3,7 @@ * Set Log: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/setSuggestions.js b/commands/Moderation/setSuggestions.js index 2fcd880..2a9d1bd 100644 --- a/commands/Moderation/setSuggestions.js +++ b/commands/Moderation/setSuggestions.js @@ -3,35 +3,23 @@ * Set Suggestions: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.'); - bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id); - msg.reply('Alright, I have set the suggestions channel to ' + args[0]); - }; - - exports.conf = { - aliases: [], - guildOnly: true, - }; - - exports.help = { - name: 'setSuggestions', - description: 'Set\'s the Suggestions Channel.', - usage: '', - }; - \ No newline at end of file + if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.'); + bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id); + msg.reply('Alright, I have set the suggestions channel to ' + args[0]); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'setSuggestions', + description: 'Set\'s the Suggestions Channel.', + usage: '', +}; diff --git a/commands/Moderation/softban.js b/commands/Moderation/softban.js index 2db58ec..a97f8a6 100644 --- a/commands/Moderation/softban.js +++ b/commands/Moderation/softban.js @@ -3,18 +3,7 @@ * SoftBan: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/timeout.js b/commands/Moderation/timeout.js index af9c713..2e479ac 100644 --- a/commands/Moderation/timeout.js +++ b/commands/Moderation/timeout.js @@ -3,18 +3,7 @@ * Time Out: Plugin for PokeBot that punishes bad boys.. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index 2599c0f..1dd0410 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -3,18 +3,7 @@ * Warn: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Music/play.js b/commands/Music/play.js index cd22057..c494ea2 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -3,18 +3,7 @@ * Play: Plugin for PokeBot that performs music player actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 09ab165..96cecf6 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -3,18 +3,7 @@ * Skip: Plugin for PokeBot that performs music player actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/eval.js b/commands/Owners Only/eval.js index a6a6916..09aac08 100644 --- a/commands/Owners Only/eval.js +++ b/commands/Owners Only/eval.js @@ -3,18 +3,7 @@ * Eval / Exec: Plugin for PokeBot that provides diagnostic information. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/modifycredits.js b/commands/Owners Only/modifycredits.js index 69da668..6401d85 100644 --- a/commands/Owners Only/modifycredits.js +++ b/commands/Owners Only/modifycredits.js @@ -3,18 +3,7 @@ * Modify Credits: Plugin for PokeBot that modifies economy features. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/poweroff.js b/commands/Owners Only/poweroff.js index 0facc66..4bd7f75 100644 --- a/commands/Owners Only/poweroff.js +++ b/commands/Owners Only/poweroff.js @@ -3,18 +3,7 @@ * Poweroff: Plugin for PokeBot that remotely exits the process. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/say.js b/commands/Owners Only/say.js index 95f6c53..3085d53 100644 --- a/commands/Owners Only/say.js +++ b/commands/Owners Only/say.js @@ -3,18 +3,7 @@ * Say: Plugin for PokeBot that sends a message with the provided content. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/testingcredits.js b/commands/Owners Only/testingcredits.js index 01d4934..bee93b2 100644 --- a/commands/Owners Only/testingcredits.js +++ b/commands/Owners Only/testingcredits.js @@ -3,18 +3,7 @@ * Testing Credits: Plugin for PokeBot that modifies economy features. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Owners Only/triggeregg.js b/commands/Owners Only/triggeregg.js index 45da516..c65c539 100644 --- a/commands/Owners Only/triggeregg.js +++ b/commands/Owners Only/triggeregg.js @@ -3,18 +3,7 @@ * TriggerEgg: Plugin for PokeBot that manages community events. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js index 1d2f881..9bba3ec 100644 --- a/commands/Pokemon/claim.js +++ b/commands/Pokemon/claim.js @@ -3,18 +3,7 @@ * Claim: Plugin for PokeBot that powers the PokeWorld gym system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/drop.js b/commands/Pokemon/drop.js index fb58184..3b2bf97 100644 --- a/commands/Pokemon/drop.js +++ b/commands/Pokemon/drop.js @@ -3,18 +3,7 @@ * Drop: Plugin for PokeBot that powers the PokeWorld gym system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/forcedrop.js b/commands/Pokemon/forcedrop.js index 4f6003b..50a9acf 100644 --- a/commands/Pokemon/forcedrop.js +++ b/commands/Pokemon/forcedrop.js @@ -3,18 +3,7 @@ * Ban: Plugin for PokeBot that powers the PokeWorld gym system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/join.js b/commands/Pokemon/join.js index 09b5e11..91c6c7e 100644 --- a/commands/Pokemon/join.js +++ b/commands/Pokemon/join.js @@ -3,18 +3,7 @@ * Join: Plugin for PokeBot that powers the PokeWorld team system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/leave.js b/commands/Pokemon/leave.js index 24405cf..813debe 100644 --- a/commands/Pokemon/leave.js +++ b/commands/Pokemon/leave.js @@ -3,18 +3,7 @@ * Leave: Plugin for PokeBot that powers the PokeWorld team system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/lsitem.js b/commands/Pokemon/lsitem.js index fad8bb3..dd628ae 100644 --- a/commands/Pokemon/lsitem.js +++ b/commands/Pokemon/lsitem.js @@ -3,18 +3,7 @@ * LSItem: Plugin for lists an item for sale in the marketplace * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Pokemon/tradegym.js b/commands/Pokemon/tradegym.js index f38d2ab..e195b62 100644 --- a/commands/Pokemon/tradegym.js +++ b/commands/Pokemon/tradegym.js @@ -3,18 +3,7 @@ * TradeGym: Plugin for PokeBot that powers the PokeWorld gym system. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Utility/character.js b/commands/Utility/character.js index 603571b..56d9bfb 100644 --- a/commands/Utility/character.js +++ b/commands/Utility/character.js @@ -1,20 +1,9 @@ /** ************************************** * - * Suggest: Plugin for PokeBot that allows users to suggest things. + * Character: Plugin for PokeBot that examines unicode character further. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Utility/git.js b/commands/Utility/git.js index a648995..f5113a2 100644 --- a/commands/Utility/git.js +++ b/commands/Utility/git.js @@ -3,32 +3,20 @@ * Git: Plugin for PokeBot that provides gives the user information about the bot. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ exports.run = (bot, msg) => { - msg.channel.send('The GitHub page for PokeBot can be found here: https://github.com/PokeWorld/PokeBot'); - }; - - exports.conf = { - aliases: [], - guildOnly: true, - }; - - exports.help = { - name: 'git', - description: 'Gives the user a link to the git.', - }; - \ No newline at end of file + msg.channel.send('The GitHub page for PokeBot can be found here: https://github.com/PokeWorld/PokeBot'); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'git', + description: 'Gives the user a link to the git.', +}; diff --git a/commands/Utility/invite.js b/commands/Utility/invite.js index e602649..933e9ba 100644 --- a/commands/Utility/invite.js +++ b/commands/Utility/invite.js @@ -3,32 +3,20 @@ * Invite: Plugin for PokeBot that provides gives the user information about the bot. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ exports.run = (bot, msg) => { msg.channel.send('You can invite me by visiting https://discordbots.org/bot/417096530596724737.'); }; - + exports.conf = { aliases: [], guildOnly: true, }; - + exports.help = { name: 'invite', description: 'Gives the user a link to invite the bot.', }; - \ No newline at end of file diff --git a/commands/Utility/nick.js b/commands/Utility/nick.js index 9701a3c..44ab7f5 100644 --- a/commands/Utility/nick.js +++ b/commands/Utility/nick.js @@ -3,18 +3,7 @@ * Nick: Plugin for PokeBot that changes the user's display name. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Utility/suggest.js b/commands/Utility/suggest.js index fae35db..f1b4206 100644 --- a/commands/Utility/suggest.js +++ b/commands/Utility/suggest.js @@ -3,18 +3,7 @@ * Suggest: Plugin for PokeBot that allows users to suggest things. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index 86ae84d..8492df2 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -3,18 +3,7 @@ * Uptime: Plugin for PokeBot that provides diagnostic information. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Utility/userinfo.js b/commands/Utility/userinfo.js index 9716021..80844e1 100644 --- a/commands/Utility/userinfo.js +++ b/commands/Utility/userinfo.js @@ -3,18 +3,7 @@ * UserInfo: Plugin for PokeBot that gives the user information about themselves or another user. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/channelCreate.js b/events/channelCreate.js index 9dce088..339a3b5 100644 --- a/events/channelCreate.js +++ b/events/channelCreate.js @@ -3,18 +3,7 @@ * ChannelCreate: Plugin for PokeBot that setups gyms when they are created. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index 57ff757..63081b1 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -3,18 +3,7 @@ * GuildMemberAdd: Plugin for PokeBot that setups up and welcomes any new user. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/guildMemberRemove.js b/events/guildMemberRemove.js index 9d38180..001f2ec 100644 --- a/events/guildMemberRemove.js +++ b/events/guildMemberRemove.js @@ -3,18 +3,7 @@ * GuildMemberRemove: Plugin for PokeBot that waves bye to a user who leaves. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/message.js b/events/message.js index 4154536..238d95e 100644 --- a/events/message.js +++ b/events/message.js @@ -3,18 +3,7 @@ * Message/CommandHandler: Plugin for PokeBot that processes and parses command. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/messageDelete.js b/events/messageDelete.js index 2823e7f..95c3718 100644 --- a/events/messageDelete.js +++ b/events/messageDelete.js @@ -1,20 +1,9 @@ /** ************************************** * - * messageDelete: Plugin for PokeBot that handles deleted messages. + * MessageDelete: Plugin for PokeBot that handles deleted messages. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/messageDeleteBulk.js b/events/messageDeleteBulk.js index 0d0c345..3d84e4d 100644 --- a/events/messageDeleteBulk.js +++ b/events/messageDeleteBulk.js @@ -1,20 +1,9 @@ /** ************************************** * - * messagesDeleteBulk: Plugin for PokeBot that handles many messages being deleted at once. + * MessagesDeleteBulk: Plugin for PokeBot that handles many messages being deleted at once. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/messageUpdate.js b/events/messageUpdate.js index ed0565b..0baa08c 100644 --- a/events/messageUpdate.js +++ b/events/messageUpdate.js @@ -1,20 +1,9 @@ /** ************************************** * - * messageUpdate: Plugin for PokeBot that handles edited messages. + * MessageUpdate: Plugin for PokeBot that handles edited messages. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/events/ready.js b/events/ready.js index 8b7a61b..9c30717 100644 --- a/events/ready.js +++ b/events/ready.js @@ -3,18 +3,7 @@ * Ready: Plugin for PokeBot that setups up pokebot for production. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/ls b/ls deleted file mode 100644 index e69de29..0000000 diff --git a/node-pre-gyp b/node-pre-gyp deleted file mode 100644 index e69de29..0000000 diff --git a/npm b/npm deleted file mode 100644 index e69de29..0000000 diff --git a/test.js b/test.js deleted file mode 100644 index 69b8e71..0000000 --- a/test.js +++ /dev/null @@ -1,72 +0,0 @@ -const Discord = require('discord.js'); -const bot = new Discord.Client(); -const fs = require('fs'); - -bot.commands = new Discord.Collection(); -bot.aliases = new Discord.Collection(); -bot.categories = new Discord.Collection(); -bot.queue = new Discord.Collection(); -bot.plugins = { music : require('./Plugins/Music.js') }; -cmdLoader(); - -async function cmdLoader() { - const categories = await fs.readdirSync('./commands'); - console.log(`Loading ${categories.length} categories(s) into memory\n`); - categories.forEach(x => { - loadGroup(x); - }); -} -async function loadGroup(name) { - const files = await fs.readdirSync(`./commands/${name}`); - - console.log(`Loading the category '${name}' into memory with a total of ${files.length} command(s)`); - - bot.commands.set(name, new Map()); - bot.aliases.set(name, new Map()); - - const commands = []; - files.forEach(x => { - loadCmd(name, x); - commands.push(x.split('.')[0]); - }); - - bot.categories.set(name, commands); - console.log(`The category ${name} has been loaded.\n`); -} - -async function loadCmd(category, cmd) { - try { - console.log(`Loading the Command ${cmd.split('.')[0]}`); - const command = require(`./commands/${category}/${cmd}`); - bot.commands.get(category).set(command.help.name, command); - command.conf.aliases.forEach(alias => { - console.log(`Loading the alias ${alias} for the command ${command.help.name}`); - bot.aliases.get(category).set(alias, command.help.name); - }); - } - catch (err) { - console.log(`An error has occured trying to load the command '${cmd.split('.')[0]}'`); - console.log(err.stack); - } -} - - -fs.readdir('./events', (err, files) => { - if (err) console.error(err); - console.log(`Attempting to load a total of ${files.length} events into the memory.`); - files.forEach(file => { - try { - const eventName = file.split('.')[0]; - const event = require(`./events/${file}`); - console.log(`Attempting to load the event "${eventName}".`); - bot.on(eventName, event.bind(null, bot)); - delete require.cache[require.resolve(`./events/${file}`)]; - } - catch (err) { - console.log('An error has occured trying to load a event. Here is the error.'); - console.log(err.stack); - } - }); - console.log('Event Loading complete!'); - console.log('\n'); -}); -- cgit v1.2.3 From 7d2830b1934a9cddd0fac4e65642d259fc31e528 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:48:49 -0400 Subject: test --- Plugins/Music.js | 59 ---------------------------------------------------- Plugins/economy.js | 40 ----------------------------------- Plugins/settings.js | 54 ----------------------------------------------- Plugins/whitelist.js | 28 ------------------------- test/economy.js | 40 +++++++++++++++++++++++++++++++++++ test/music.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ test/settings.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++ test/whitelist.js | 28 +++++++++++++++++++++++++ 8 files changed, 181 insertions(+), 181 deletions(-) delete mode 100644 Plugins/Music.js delete mode 100644 Plugins/economy.js delete mode 100644 Plugins/settings.js delete mode 100644 Plugins/whitelist.js create mode 100644 test/economy.js create mode 100644 test/music.js create mode 100644 test/settings.js create mode 100644 test/whitelist.js (limited to 'Plugins') diff --git a/Plugins/Music.js b/Plugins/Music.js deleted file mode 100644 index 2dbabda..0000000 --- a/Plugins/Music.js +++ /dev/null @@ -1,59 +0,0 @@ -/** ************************************** - * - * Music: Plugin for PokeBot that interacts with the Lavalink API. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.resolveTrack = async (term, sc) => { - const fetch = require('snekfetch'); - let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); - if (!track.body[0]) { - const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; - track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); - } - return track.body[0]; -}; - -exports.play = async (bot, msg, track) => { - const player = await bot.player.join({ - d: { - guild_id: msg.guild.id, - channel_id: msg.member.voiceChannelID, - }, - host: 'localhost', - }); - if (!bot.queue.has(msg.guild.id)) { - bot.queue.set(msg.guild.id, []); - bot.queue.get(msg.guild.id).push(track); - player.play(bot.queue.get(msg.guild.id).shift()); - player.on('end', () => { - if (bot.queue.get(msg.guild.id)[0]) { - player.play(bot.queue.get(msg.guild.id).shift()); - } - else { - bot.player.leave(msg.guild.id); - } - }); - } - else { - bot.queue.get(msg.guild.id).push(track); - } -}; - -exports.skip = async (bot, msg) => { - const player = await bot.player.join({ - guild: msg.guild.id, - channel: msg.member.voiceChannelID, - host: 'localhost', - }); - if (bot.queue.has(msg.guild.id)) { - player.stop(); - player.emit('end'); - } - else { - return msg.channel.send('There is nothing playing.'); - } -}; diff --git a/Plugins/economy.js b/Plugins/economy.js deleted file mode 100644 index 3658ce8..0000000 --- a/Plugins/economy.js +++ /dev/null @@ -1,40 +0,0 @@ -/** ************************************** - * - * Economy: Plugin for PokeBot that enables economy features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.get = async (userid) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - return amount; - } - else { - await db.set(`money_${userid}`, 0); - return await db.fetch(`money_${userid}`); - } -}; - -exports.add = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount + money); - } - else { - await db.set(`money_${userid}`, money); - } -}; - -exports.subtract = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount - money); - } - else { - await db.set(`money_${userid}`, 0 - money); - } -}; diff --git a/Plugins/settings.js b/Plugins/settings.js deleted file mode 100644 index bfa15d5..0000000 --- a/Plugins/settings.js +++ /dev/null @@ -1,54 +0,0 @@ -/** ************************************** - * - * Settings: Plugin for PokeBot that enables settings features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.getInt = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, 0); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getStr = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, ''); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getBool = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, false); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.setInt = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, parseInt(value)); -}; - -exports.setStr = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, value); -}; - -exports.setBool = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, (value == true)); -}; diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js deleted file mode 100644 index 41b4398..0000000 --- a/Plugins/whitelist.js +++ /dev/null @@ -1,28 +0,0 @@ -/** ************************************** - * - * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.whitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, true); -}; - -exports.unwhitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, false); -}; - -exports.isWhitelist = async (guildID) => { - const value = await db.fetch(`whitelist_${guildID}`); - if (value) { - return value; - } - else { - await db.set(`whitelist_${guildID}`, false); - return await db.fetch(`whitelist_${guildID}`); - } -}; diff --git a/test/economy.js b/test/economy.js new file mode 100644 index 0000000..3658ce8 --- /dev/null +++ b/test/economy.js @@ -0,0 +1,40 @@ +/** ************************************** + * + * Economy: Plugin for PokeBot that enables economy features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.get = async (userid) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + return amount; + } + else { + await db.set(`money_${userid}`, 0); + return await db.fetch(`money_${userid}`); + } +}; + +exports.add = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount + money); + } + else { + await db.set(`money_${userid}`, money); + } +}; + +exports.subtract = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount - money); + } + else { + await db.set(`money_${userid}`, 0 - money); + } +}; diff --git a/test/music.js b/test/music.js new file mode 100644 index 0000000..2dbabda --- /dev/null +++ b/test/music.js @@ -0,0 +1,59 @@ +/** ************************************** + * + * Music: Plugin for PokeBot that interacts with the Lavalink API. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.resolveTrack = async (term, sc) => { + const fetch = require('snekfetch'); + let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); + if (!track.body[0]) { + const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; + track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); + } + return track.body[0]; +}; + +exports.play = async (bot, msg, track) => { + const player = await bot.player.join({ + d: { + guild_id: msg.guild.id, + channel_id: msg.member.voiceChannelID, + }, + host: 'localhost', + }); + if (!bot.queue.has(msg.guild.id)) { + bot.queue.set(msg.guild.id, []); + bot.queue.get(msg.guild.id).push(track); + player.play(bot.queue.get(msg.guild.id).shift()); + player.on('end', () => { + if (bot.queue.get(msg.guild.id)[0]) { + player.play(bot.queue.get(msg.guild.id).shift()); + } + else { + bot.player.leave(msg.guild.id); + } + }); + } + else { + bot.queue.get(msg.guild.id).push(track); + } +}; + +exports.skip = async (bot, msg) => { + const player = await bot.player.join({ + guild: msg.guild.id, + channel: msg.member.voiceChannelID, + host: 'localhost', + }); + if (bot.queue.has(msg.guild.id)) { + player.stop(); + player.emit('end'); + } + else { + return msg.channel.send('There is nothing playing.'); + } +}; diff --git a/test/settings.js b/test/settings.js new file mode 100644 index 0000000..bfa15d5 --- /dev/null +++ b/test/settings.js @@ -0,0 +1,54 @@ +/** ************************************** + * + * Settings: Plugin for PokeBot that enables settings features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.getInt = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, 0); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getStr = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, ''); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getBool = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, false); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.setInt = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, parseInt(value)); +}; + +exports.setStr = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, value); +}; + +exports.setBool = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, (value == true)); +}; diff --git a/test/whitelist.js b/test/whitelist.js new file mode 100644 index 0000000..41b4398 --- /dev/null +++ b/test/whitelist.js @@ -0,0 +1,28 @@ +/** ************************************** + * + * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.whitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, true); +}; + +exports.unwhitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, false); +}; + +exports.isWhitelist = async (guildID) => { + const value = await db.fetch(`whitelist_${guildID}`); + if (value) { + return value; + } + else { + await db.set(`whitelist_${guildID}`, false); + return await db.fetch(`whitelist_${guildID}`); + } +}; -- cgit v1.2.3 From bdef4a086948d9d55d672c8fdcac62d45b8e8ade Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:48:49 -0400 Subject: Revert "test" This reverts commit 7d2830b1934a9cddd0fac4e65642d259fc31e528. --- Plugins/Music.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Plugins/economy.js | 40 +++++++++++++++++++++++++++++++++++ Plugins/settings.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++ Plugins/whitelist.js | 28 +++++++++++++++++++++++++ test/economy.js | 40 ----------------------------------- test/music.js | 59 ---------------------------------------------------- test/settings.js | 54 ----------------------------------------------- test/whitelist.js | 28 ------------------------- 8 files changed, 181 insertions(+), 181 deletions(-) create mode 100644 Plugins/Music.js create mode 100644 Plugins/economy.js create mode 100644 Plugins/settings.js create mode 100644 Plugins/whitelist.js delete mode 100644 test/economy.js delete mode 100644 test/music.js delete mode 100644 test/settings.js delete mode 100644 test/whitelist.js (limited to 'Plugins') diff --git a/Plugins/Music.js b/Plugins/Music.js new file mode 100644 index 0000000..2dbabda --- /dev/null +++ b/Plugins/Music.js @@ -0,0 +1,59 @@ +/** ************************************** + * + * Music: Plugin for PokeBot that interacts with the Lavalink API. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.resolveTrack = async (term, sc) => { + const fetch = require('snekfetch'); + let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); + if (!track.body[0]) { + const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; + track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); + } + return track.body[0]; +}; + +exports.play = async (bot, msg, track) => { + const player = await bot.player.join({ + d: { + guild_id: msg.guild.id, + channel_id: msg.member.voiceChannelID, + }, + host: 'localhost', + }); + if (!bot.queue.has(msg.guild.id)) { + bot.queue.set(msg.guild.id, []); + bot.queue.get(msg.guild.id).push(track); + player.play(bot.queue.get(msg.guild.id).shift()); + player.on('end', () => { + if (bot.queue.get(msg.guild.id)[0]) { + player.play(bot.queue.get(msg.guild.id).shift()); + } + else { + bot.player.leave(msg.guild.id); + } + }); + } + else { + bot.queue.get(msg.guild.id).push(track); + } +}; + +exports.skip = async (bot, msg) => { + const player = await bot.player.join({ + guild: msg.guild.id, + channel: msg.member.voiceChannelID, + host: 'localhost', + }); + if (bot.queue.has(msg.guild.id)) { + player.stop(); + player.emit('end'); + } + else { + return msg.channel.send('There is nothing playing.'); + } +}; diff --git a/Plugins/economy.js b/Plugins/economy.js new file mode 100644 index 0000000..3658ce8 --- /dev/null +++ b/Plugins/economy.js @@ -0,0 +1,40 @@ +/** ************************************** + * + * Economy: Plugin for PokeBot that enables economy features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.get = async (userid) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + return amount; + } + else { + await db.set(`money_${userid}`, 0); + return await db.fetch(`money_${userid}`); + } +}; + +exports.add = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount + money); + } + else { + await db.set(`money_${userid}`, money); + } +}; + +exports.subtract = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount - money); + } + else { + await db.set(`money_${userid}`, 0 - money); + } +}; diff --git a/Plugins/settings.js b/Plugins/settings.js new file mode 100644 index 0000000..bfa15d5 --- /dev/null +++ b/Plugins/settings.js @@ -0,0 +1,54 @@ +/** ************************************** + * + * Settings: Plugin for PokeBot that enables settings features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.getInt = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, 0); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getStr = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, ''); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getBool = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, false); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.setInt = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, parseInt(value)); +}; + +exports.setStr = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, value); +}; + +exports.setBool = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, (value == true)); +}; diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js new file mode 100644 index 0000000..41b4398 --- /dev/null +++ b/Plugins/whitelist.js @@ -0,0 +1,28 @@ +/** ************************************** + * + * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.whitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, true); +}; + +exports.unwhitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, false); +}; + +exports.isWhitelist = async (guildID) => { + const value = await db.fetch(`whitelist_${guildID}`); + if (value) { + return value; + } + else { + await db.set(`whitelist_${guildID}`, false); + return await db.fetch(`whitelist_${guildID}`); + } +}; diff --git a/test/economy.js b/test/economy.js deleted file mode 100644 index 3658ce8..0000000 --- a/test/economy.js +++ /dev/null @@ -1,40 +0,0 @@ -/** ************************************** - * - * Economy: Plugin for PokeBot that enables economy features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.get = async (userid) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - return amount; - } - else { - await db.set(`money_${userid}`, 0); - return await db.fetch(`money_${userid}`); - } -}; - -exports.add = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount + money); - } - else { - await db.set(`money_${userid}`, money); - } -}; - -exports.subtract = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount - money); - } - else { - await db.set(`money_${userid}`, 0 - money); - } -}; diff --git a/test/music.js b/test/music.js deleted file mode 100644 index 2dbabda..0000000 --- a/test/music.js +++ /dev/null @@ -1,59 +0,0 @@ -/** ************************************** - * - * Music: Plugin for PokeBot that interacts with the Lavalink API. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.resolveTrack = async (term, sc) => { - const fetch = require('snekfetch'); - let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); - if (!track.body[0]) { - const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; - track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); - } - return track.body[0]; -}; - -exports.play = async (bot, msg, track) => { - const player = await bot.player.join({ - d: { - guild_id: msg.guild.id, - channel_id: msg.member.voiceChannelID, - }, - host: 'localhost', - }); - if (!bot.queue.has(msg.guild.id)) { - bot.queue.set(msg.guild.id, []); - bot.queue.get(msg.guild.id).push(track); - player.play(bot.queue.get(msg.guild.id).shift()); - player.on('end', () => { - if (bot.queue.get(msg.guild.id)[0]) { - player.play(bot.queue.get(msg.guild.id).shift()); - } - else { - bot.player.leave(msg.guild.id); - } - }); - } - else { - bot.queue.get(msg.guild.id).push(track); - } -}; - -exports.skip = async (bot, msg) => { - const player = await bot.player.join({ - guild: msg.guild.id, - channel: msg.member.voiceChannelID, - host: 'localhost', - }); - if (bot.queue.has(msg.guild.id)) { - player.stop(); - player.emit('end'); - } - else { - return msg.channel.send('There is nothing playing.'); - } -}; diff --git a/test/settings.js b/test/settings.js deleted file mode 100644 index bfa15d5..0000000 --- a/test/settings.js +++ /dev/null @@ -1,54 +0,0 @@ -/** ************************************** - * - * Settings: Plugin for PokeBot that enables settings features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.getInt = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, 0); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getStr = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, ''); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getBool = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, false); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.setInt = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, parseInt(value)); -}; - -exports.setStr = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, value); -}; - -exports.setBool = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, (value == true)); -}; diff --git a/test/whitelist.js b/test/whitelist.js deleted file mode 100644 index 41b4398..0000000 --- a/test/whitelist.js +++ /dev/null @@ -1,28 +0,0 @@ -/** ************************************** - * - * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.whitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, true); -}; - -exports.unwhitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, false); -}; - -exports.isWhitelist = async (guildID) => { - const value = await db.fetch(`whitelist_${guildID}`); - if (value) { - return value; - } - else { - await db.set(`whitelist_${guildID}`, false); - return await db.fetch(`whitelist_${guildID}`); - } -}; -- cgit v1.2.3 From 56f29e5b75f35722c69bb64f3f3b7c8be14cbbb8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:49:22 -0400 Subject: Auto stash before revert of "test" --- Plugins/music.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Plugins/music.js (limited to 'Plugins') diff --git a/Plugins/music.js b/Plugins/music.js new file mode 100644 index 0000000..2dbabda --- /dev/null +++ b/Plugins/music.js @@ -0,0 +1,59 @@ +/** ************************************** + * + * Music: Plugin for PokeBot that interacts with the Lavalink API. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.resolveTrack = async (term, sc) => { + const fetch = require('snekfetch'); + let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); + if (!track.body[0]) { + const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; + track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); + } + return track.body[0]; +}; + +exports.play = async (bot, msg, track) => { + const player = await bot.player.join({ + d: { + guild_id: msg.guild.id, + channel_id: msg.member.voiceChannelID, + }, + host: 'localhost', + }); + if (!bot.queue.has(msg.guild.id)) { + bot.queue.set(msg.guild.id, []); + bot.queue.get(msg.guild.id).push(track); + player.play(bot.queue.get(msg.guild.id).shift()); + player.on('end', () => { + if (bot.queue.get(msg.guild.id)[0]) { + player.play(bot.queue.get(msg.guild.id).shift()); + } + else { + bot.player.leave(msg.guild.id); + } + }); + } + else { + bot.queue.get(msg.guild.id).push(track); + } +}; + +exports.skip = async (bot, msg) => { + const player = await bot.player.join({ + guild: msg.guild.id, + channel: msg.member.voiceChannelID, + host: 'localhost', + }); + if (bot.queue.has(msg.guild.id)) { + player.stop(); + player.emit('end'); + } + else { + return msg.channel.send('There is nothing playing.'); + } +}; -- cgit v1.2.3 From 308808907e28a90747d6b218866560c7cc9986c6 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:49:29 -0400 Subject: test --- Plugins/music.js | 59 -------------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 Plugins/music.js (limited to 'Plugins') diff --git a/Plugins/music.js b/Plugins/music.js deleted file mode 100644 index 2dbabda..0000000 --- a/Plugins/music.js +++ /dev/null @@ -1,59 +0,0 @@ -/** ************************************** - * - * Music: Plugin for PokeBot that interacts with the Lavalink API. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.resolveTrack = async (term, sc) => { - const fetch = require('snekfetch'); - let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); - if (!track.body[0]) { - const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; - track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); - } - return track.body[0]; -}; - -exports.play = async (bot, msg, track) => { - const player = await bot.player.join({ - d: { - guild_id: msg.guild.id, - channel_id: msg.member.voiceChannelID, - }, - host: 'localhost', - }); - if (!bot.queue.has(msg.guild.id)) { - bot.queue.set(msg.guild.id, []); - bot.queue.get(msg.guild.id).push(track); - player.play(bot.queue.get(msg.guild.id).shift()); - player.on('end', () => { - if (bot.queue.get(msg.guild.id)[0]) { - player.play(bot.queue.get(msg.guild.id).shift()); - } - else { - bot.player.leave(msg.guild.id); - } - }); - } - else { - bot.queue.get(msg.guild.id).push(track); - } -}; - -exports.skip = async (bot, msg) => { - const player = await bot.player.join({ - guild: msg.guild.id, - channel: msg.member.voiceChannelID, - host: 'localhost', - }); - if (bot.queue.has(msg.guild.id)) { - player.stop(); - player.emit('end'); - } - else { - return msg.channel.send('There is nothing playing.'); - } -}; -- cgit v1.2.3 From f5cdce9c53e3b1b21727c987510bd5522f0d5fb1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Mar 2018 21:50:10 -0400 Subject: Auto stash before revert of "test" --- Plugins/Music.js | 59 ---------------------------------------------------- Plugins/economy.js | 40 ----------------------------------- Plugins/settings.js | 54 ----------------------------------------------- Plugins/whitelist.js | 28 ------------------------- test/economy.js | 40 +++++++++++++++++++++++++++++++++++ test/music.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ test/settings.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++ test/whitelist.js | 28 +++++++++++++++++++++++++ 8 files changed, 181 insertions(+), 181 deletions(-) delete mode 100644 Plugins/Music.js delete mode 100644 Plugins/economy.js delete mode 100644 Plugins/settings.js delete mode 100644 Plugins/whitelist.js create mode 100644 test/economy.js create mode 100644 test/music.js create mode 100644 test/settings.js create mode 100644 test/whitelist.js (limited to 'Plugins') diff --git a/Plugins/Music.js b/Plugins/Music.js deleted file mode 100644 index 2dbabda..0000000 --- a/Plugins/Music.js +++ /dev/null @@ -1,59 +0,0 @@ -/** ************************************** - * - * Music: Plugin for PokeBot that interacts with the Lavalink API. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -exports.resolveTrack = async (term, sc) => { - const fetch = require('snekfetch'); - let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); - if (!track.body[0]) { - const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; - track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); - } - return track.body[0]; -}; - -exports.play = async (bot, msg, track) => { - const player = await bot.player.join({ - d: { - guild_id: msg.guild.id, - channel_id: msg.member.voiceChannelID, - }, - host: 'localhost', - }); - if (!bot.queue.has(msg.guild.id)) { - bot.queue.set(msg.guild.id, []); - bot.queue.get(msg.guild.id).push(track); - player.play(bot.queue.get(msg.guild.id).shift()); - player.on('end', () => { - if (bot.queue.get(msg.guild.id)[0]) { - player.play(bot.queue.get(msg.guild.id).shift()); - } - else { - bot.player.leave(msg.guild.id); - } - }); - } - else { - bot.queue.get(msg.guild.id).push(track); - } -}; - -exports.skip = async (bot, msg) => { - const player = await bot.player.join({ - guild: msg.guild.id, - channel: msg.member.voiceChannelID, - host: 'localhost', - }); - if (bot.queue.has(msg.guild.id)) { - player.stop(); - player.emit('end'); - } - else { - return msg.channel.send('There is nothing playing.'); - } -}; diff --git a/Plugins/economy.js b/Plugins/economy.js deleted file mode 100644 index 3658ce8..0000000 --- a/Plugins/economy.js +++ /dev/null @@ -1,40 +0,0 @@ -/** ************************************** - * - * Economy: Plugin for PokeBot that enables economy features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.get = async (userid) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - return amount; - } - else { - await db.set(`money_${userid}`, 0); - return await db.fetch(`money_${userid}`); - } -}; - -exports.add = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount + money); - } - else { - await db.set(`money_${userid}`, money); - } -}; - -exports.subtract = async (userid, money) => { - const amount = await db.fetch(`money_${userid}`); - if (amount) { - await db.set(`money_${userid}`, amount - money); - } - else { - await db.set(`money_${userid}`, 0 - money); - } -}; diff --git a/Plugins/settings.js b/Plugins/settings.js deleted file mode 100644 index bfa15d5..0000000 --- a/Plugins/settings.js +++ /dev/null @@ -1,54 +0,0 @@ -/** ************************************** - * - * Settings: Plugin for PokeBot that enables settings features. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.getInt = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, 0); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getStr = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, ''); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.getBool = async (key, guildID) => { - const value = await db.fetch(`settings_${guildID}_${key}`); - if (value) { - return value; - } - else { - await db.set(`settings_${guildID}_${key}`, false); - return await db.fetch(`settings_${guildID}_${key}`); - } -}; - -exports.setInt = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, parseInt(value)); -}; - -exports.setStr = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, value); -}; - -exports.setBool = async (key, value, guildID) => { - await db.set(`settings_${guildID}_${key}`, (value == true)); -}; diff --git a/Plugins/whitelist.js b/Plugins/whitelist.js deleted file mode 100644 index 41b4398..0000000 --- a/Plugins/whitelist.js +++ /dev/null @@ -1,28 +0,0 @@ -/** ************************************** - * - * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. - * Copyright (C) 2018 TheEdge, jtsshieh, Alee - * - * Licensed under the Open Software License version 3.0 - * - * *************************************/ - -const db = require('quick.db'); -exports.whitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, true); -}; - -exports.unwhitelist = async (guildID) => { - await db.set(`whitelist_${guildID}`, false); -}; - -exports.isWhitelist = async (guildID) => { - const value = await db.fetch(`whitelist_${guildID}`); - if (value) { - return value; - } - else { - await db.set(`whitelist_${guildID}`, false); - return await db.fetch(`whitelist_${guildID}`); - } -}; diff --git a/test/economy.js b/test/economy.js new file mode 100644 index 0000000..3658ce8 --- /dev/null +++ b/test/economy.js @@ -0,0 +1,40 @@ +/** ************************************** + * + * Economy: Plugin for PokeBot that enables economy features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.get = async (userid) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + return amount; + } + else { + await db.set(`money_${userid}`, 0); + return await db.fetch(`money_${userid}`); + } +}; + +exports.add = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount + money); + } + else { + await db.set(`money_${userid}`, money); + } +}; + +exports.subtract = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount - money); + } + else { + await db.set(`money_${userid}`, 0 - money); + } +}; diff --git a/test/music.js b/test/music.js new file mode 100644 index 0000000..2dbabda --- /dev/null +++ b/test/music.js @@ -0,0 +1,59 @@ +/** ************************************** + * + * Music: Plugin for PokeBot that interacts with the Lavalink API. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.resolveTrack = async (term, sc) => { + const fetch = require('snekfetch'); + let track = await fetch.get('http://localhost:2344/loadtracks?identifier=' + term, { headers: { Authorization: 'iamaverysecurepassword' } }); + if (!track.body[0]) { + const search = 'http://localhost:2344/loadtracks?identifier=' + (sc ? 'scsearch:' : 'ytsearch:') + term; + track = await fetch.get(search, { headers: { Authorization: 'iamaverysecurepassword' } }); + } + return track.body[0]; +}; + +exports.play = async (bot, msg, track) => { + const player = await bot.player.join({ + d: { + guild_id: msg.guild.id, + channel_id: msg.member.voiceChannelID, + }, + host: 'localhost', + }); + if (!bot.queue.has(msg.guild.id)) { + bot.queue.set(msg.guild.id, []); + bot.queue.get(msg.guild.id).push(track); + player.play(bot.queue.get(msg.guild.id).shift()); + player.on('end', () => { + if (bot.queue.get(msg.guild.id)[0]) { + player.play(bot.queue.get(msg.guild.id).shift()); + } + else { + bot.player.leave(msg.guild.id); + } + }); + } + else { + bot.queue.get(msg.guild.id).push(track); + } +}; + +exports.skip = async (bot, msg) => { + const player = await bot.player.join({ + guild: msg.guild.id, + channel: msg.member.voiceChannelID, + host: 'localhost', + }); + if (bot.queue.has(msg.guild.id)) { + player.stop(); + player.emit('end'); + } + else { + return msg.channel.send('There is nothing playing.'); + } +}; diff --git a/test/settings.js b/test/settings.js new file mode 100644 index 0000000..bfa15d5 --- /dev/null +++ b/test/settings.js @@ -0,0 +1,54 @@ +/** ************************************** + * + * Settings: Plugin for PokeBot that enables settings features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.getInt = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, 0); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getStr = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, ''); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.getBool = async (key, guildID) => { + const value = await db.fetch(`settings_${guildID}_${key}`); + if (value) { + return value; + } + else { + await db.set(`settings_${guildID}_${key}`, false); + return await db.fetch(`settings_${guildID}_${key}`); + } +}; + +exports.setInt = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, parseInt(value)); +}; + +exports.setStr = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, value); +}; + +exports.setBool = async (key, value, guildID) => { + await db.set(`settings_${guildID}_${key}`, (value == true)); +}; diff --git a/test/whitelist.js b/test/whitelist.js new file mode 100644 index 0000000..41b4398 --- /dev/null +++ b/test/whitelist.js @@ -0,0 +1,28 @@ +/** ************************************** + * + * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.whitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, true); +}; + +exports.unwhitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, false); +}; + +exports.isWhitelist = async (guildID) => { + const value = await db.fetch(`whitelist_${guildID}`); + if (value) { + return value; + } + else { + await db.set(`whitelist_${guildID}`, false); + return await db.fetch(`whitelist_${guildID}`); + } +}; -- cgit v1.2.3