Remove now un-necessary subscription functionality
This commit is contained in:
parent
cdd7cb056b
commit
33a8db54fb
|
@ -11,8 +11,6 @@
|
||||||
"youtubeMode": true,
|
"youtubeMode": true,
|
||||||
"allowSubscriptions": true,
|
"allowSubscriptions": true,
|
||||||
"userCommands": {
|
"userCommands": {
|
||||||
"subscribe": "!subscribe",
|
|
||||||
"unsubscribe": "!unsubscribe",
|
|
||||||
"help": "!help"
|
"help": "!help"
|
||||||
},
|
},
|
||||||
"developerCommands": {
|
"developerCommands": {
|
||||||
|
|
54
index.js
54
index.js
|
@ -35,18 +35,6 @@ module.exports = {
|
||||||
|
|
||||||
},
|
},
|
||||||
commands: [
|
commands: [
|
||||||
{
|
|
||||||
command: Config.userCommands.subscribe,
|
|
||||||
type: "equals",
|
|
||||||
action: (bot, user, userID, channelID, message) => { if (Config.allowSubscriptions) Subscriptions.subscribe(bot, user, userID, channelID, message); },
|
|
||||||
channelIDs: [Config.channelID]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
command: Config.userCommands.unsubscribe,
|
|
||||||
type: "equals",
|
|
||||||
action: (bot, user, userID, channelID, message) => { if (Config.allowSubscriptions) Subscriptions.unsubscribe(bot, user, userID, channelID, message); },
|
|
||||||
channelIDs: [Config.channelID]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
command: Config.userCommands.help,
|
command: Config.userCommands.help,
|
||||||
type: "equals",
|
type: "equals",
|
||||||
|
@ -121,48 +109,6 @@ var Actions = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
var Subscriptions = {
|
|
||||||
subscribe: function (bot, user, userID, channelID, message) {
|
|
||||||
bot.addToRole({
|
|
||||||
serverID: bot.channels[Config.channelID].guild_id,
|
|
||||||
userID: userID,
|
|
||||||
roleID: Config.subscribersRoleID
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
if (err) Console.log(err); //log the error if there is an error
|
|
||||||
else { //else go ahead and confirm subscription
|
|
||||||
Console.info("Subscribed user " + (user ? user + "(" + userID + ")" : userID));
|
|
||||||
|
|
||||||
bot.sendMessage({
|
|
||||||
to: channelID,
|
|
||||||
message: "You have successfully subscribed"
|
|
||||||
}, (err, response) => { setTimeout(() => { bot.deleteMessage({ channelID: channelID, messageID: response.id }); }, Config.messageDeleteDelay); }); //delete the subscription confirmation message after a delay
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
unsubscribe: function (bot, user, userID, channelID, message) {
|
|
||||||
bot.removeFromRole({
|
|
||||||
serverID: bot.channels[Config.channelID].guild_id,
|
|
||||||
userID: userID,
|
|
||||||
roleID: Config.subscribersRoleID
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
if (err) Console.log(err); //log the error if there is an error
|
|
||||||
else { //else go ahead and confirm un-subscription
|
|
||||||
Console.info("Unsubscribed user " + (user ? user + "(" + userID + ")" : userID));
|
|
||||||
|
|
||||||
bot.sendMessage({
|
|
||||||
to: channelID,
|
|
||||||
message: "You have successfully unsubscribed"
|
|
||||||
}, (err, response) => { setTimeout(() => { bot.deleteMessage({ channelID: channelID, messageID: response.id }); }, Config.messageDeleteDelay); }); //delete the un-subscription confirmation message after a delay
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var YouTube = {
|
var YouTube = {
|
||||||
url: {
|
url: {
|
||||||
share: "http://youtu.be/",
|
share: "http://youtu.be/",
|
||||||
|
|
Loading…
Reference in a new issue