diff --git a/changelog.txt b/changelog.txt index 280e405..aeceb34 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,21 +1,21 @@ -DONE: -- attachment support -- Pinging and channel sharing +DONE: +- user blacklist +- "hub list" command +- **new command prefix "ish!"** IN PROGRESS: -- hub settings - - user blacklist - - global messaging user blacklist - - Server join blacklist +- Server join blacklist +- safer setting up (open invite code = no gud) DROPPED: -(- channel creator (for permission management)) +- Implement new message style + add discord invite link TODO: -- message editing -- Implement new message style + add discord invite link -- safer setting up (open invite code = no gud) -- check nsfw channels +- Server join whitelist - Telegram support -- global comamnd user blacklist -(-web interface (that frontend might run somewhere else)) \ No newline at end of file +- message editing +- check nsfw channels +- global command user blacklist +- transfer hub to new owner +(-web interface (that frontend might run somewhere else)) +(- Signal support) \ No newline at end of file diff --git a/commands/about.js b/commands/about.js index 6de7938..bff4eca 100644 --- a/commands/about.js +++ b/commands/about.js @@ -4,7 +4,7 @@ const fs = require('fs'); function postMessage(client, message, body, error) { let color = 0; if (message.channel.type !== 'dm') color = message.member.displayColor; - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, 'About: ', color, false); } @@ -13,7 +13,7 @@ function postMessage(client, message, body, error) { // TODO: make errorlogchannel in server function error(client, channel, err) { console.error('ERROR: ', err); - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, channel, 'Oh no! Something went wrong. This error has been carefully recorded and our nerd is working on it to fix it. Please try again later.', '', 16449540, false); } diff --git a/commands/eval.js b/commands/eval.js index e148442..91ae070 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -6,7 +6,7 @@ const clean = (text) => { module.exports.run = async (client, message, args, config) => { const args_eval = message.content.split(' ').slice(1); if (message.author.id !== '172031697355800577') return message.react('❌'); - if (message.content.indexOf('token') !== -1) return message.channel.send('Nice try...'); + if (message.content.indexOf('discordToken') !== -1) return message.channel.send('Nice try...'); try { const code = args_eval.join(' '); let evaled = eval(code); diff --git a/commands/hub.js b/commands/hub.js index 30c284c..b5e1cf3 100644 --- a/commands/hub.js +++ b/commands/hub.js @@ -4,27 +4,21 @@ function CommandUsage(prefix, cmdName, subcmd) { \`\`\`${prefix}${cmdName} ${subcmd}\`\`\``; } -// creates a embed messagetemplate for failed actions -function messageFail(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); -} - module.exports.run = async (client, message, args, config) => { + const currentCMD = module.exports.help; const [subcmd] = args; - const commandValues = ['register', 'delete', 'list', 'join', 'leave']; + const commandValues = currentCMD.usage.split('|'); if (commandValues.includes(subcmd)) { client.functions.get(`CMD_hub_${subcmd}`) .run(client, message, args, config); } else { - const currentCMD = module.exports.help; - messageFail(client, message, CommandUsage(config.prefix, currentCMD.name, currentCMD.usage)); + messageFail(message, CommandUsage(config.prefix, currentCMD.name, currentCMD.usage)); } }; module.exports.help = { name: 'hub', title: 'Manage hub', - usage: 'register|delete|join|leave', + usage: 'register|delete|join|leave|list|ban', desc: 'Manage hubs and links between channels.', }; diff --git a/commands/ping.js b/commands/ping.js index 3ffde7c..106f5cb 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -2,7 +2,7 @@ const { MessageEmbed } = require('discord.js'); // Ping kickoff for bot latency function kickoff(client, message) { - const sendMessage = client.functions.get('FUNC_MessageEmbedMessage'); + const sendMessage = client.functions.get('FUNC_richEmbedMessage'); return sendMessage.run(client.user, message.channel, '📤 Ping...', null, null, false); } diff --git a/config/example_config.json b/config/example_config.json index 9390be4..bab7ae9 100644 --- a/config/example_config.json +++ b/config/example_config.json @@ -1,5 +1,6 @@ { - "token": "**************************", + "discordToken": "**************************", + "telegramToken": "****************************", "production": { "username": "***", "password": "*****************", diff --git a/config/main.json b/config/main.json index b9ef37b..b870d95 100644 --- a/config/main.json +++ b/config/main.json @@ -1,6 +1,6 @@ { "name": "I-SH", - "prefix": "+", + "prefix": "ish!", "setup": { "moduleFolders": { "functionsFolder": "functions", @@ -9,7 +9,8 @@ "startupFunctions": [ "STARTUP_initCommands", "STARTUP_initFunctions", - "STARTUP_envPrep" + "STARTUP_envPrep", + "STARTUP_DBConnection" ], "setupFunctions": [ "SETUP_offlineStat", diff --git a/database/SETUP_DBConnection.js b/database/SETUP_DBConnection.js deleted file mode 100644 index c90d65e..0000000 --- a/database/SETUP_DBConnection.js +++ /dev/null @@ -1,30 +0,0 @@ -const Sequelize = require('sequelize'); - -const testToken = '../config/config.json'; - -const config = require('../config/main.json'); - -console.log('[DB] Connecting...'); -let database; -let user; -let password; -let host; -if (config.env.get('inDev')) { - const DBCredentials = require(testToken).development; - database = DBCredentials.database; - user = DBCredentials.username; - password = DBCredentials.password; - host = DBCredentials.host; -} else { - database = process.env.DBNameISH; - user = process.env.DBUsernameISH; - password = process.env.DBPasswISH; - host = process.env.DBHost; -} -const sequelize = new Sequelize( - database, user, password, { host, dialect: 'mysql', logging: config.env.get('inDev') }, -); -console.log('[DB] Connected!'); - -module.exports = sequelize; -global.sequelize = sequelize; diff --git a/database/models/bannedUser.js b/database/models/bannedUser.js new file mode 100644 index 0000000..d3cbd1e --- /dev/null +++ b/database/models/bannedUser.js @@ -0,0 +1,32 @@ +const Sequelize = require('sequelize'); + +module.exports = sequelize.define('bannedUser', { + ID: { + type: Sequelize.INTEGER(11), + primaryKey: true, + autoIncrement: true, + }, + userID: { + type: Sequelize.STRING(30), + allowNull: false, + }, + hubID: { + type: Sequelize.INTEGER(11), + allowNull: false, + references: { + model: 'hubNames', + key: 'hubID', + }, + }, + reason: { + type: Sequelize.TEXT, + allowNull: false, + }, +}, +{ + uniqueKeys: { + banUnique: { + fields: ['userID', 'hubID'], + }, + }, +}); diff --git a/functions/CMD_hub_ban.js b/functions/CMD_hub_ban.js index 2d10aa7..05adff2 100644 --- a/functions/CMD_hub_ban.js +++ b/functions/CMD_hub_ban.js @@ -1,9 +1,21 @@ -// DISABLED: not done module.exports.run = async (client, message, args, config) => { - message.reply('ban'); - // banns a channel from the hub + // get subcmd from args + const [subcmd, type] = args; + // check provided values + switch (type) { + case 'user': + client.functions.get(`CMD_${module.exports.help.parent}_${subcmd}_${type}`) + .run(client, message, args, config); + return; + + default: + return messageFail(message, + `Command usage: + \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${type || 'user'} MESSAGEID REASON\`\`\``); + } }; module.exports.help = { name: 'CMD_hub_ban', + parent: 'hub', }; diff --git a/functions/CMD_hub_ban_user.js b/functions/CMD_hub_ban_user.js new file mode 100644 index 0000000..29e20ba --- /dev/null +++ b/functions/CMD_hub_ban_user.js @@ -0,0 +1,28 @@ +module.exports.run = async (client, message, args, config) => { + // get subcmd from args + const [subcmd, type, messageID, reason] = args; + if (!messageID || !reason) { + return messageFail(message, + `Command usage: + \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${type || 'user'} ${messageID || 'MESSAGEID'} ${reason || 'REASON'}\`\`\``); + } + // get complete reason + let cutLength = 0; + [subcmd, type, messageID].map((arg) => cutLength = cutLength + arg.length + 1); + const slicedReason = await args.join(' ').slice(cutLength); + messageSuccess(message, `\`\`\`${slicedReason}\`\`\``); + // check permissions + // get messageID => parse messageInstanceID + // get messageInstanceID => get channelID + // get channel from channelID and lookup messageID + // get hubID from channelID + // get author => parse userID + // check if owner: dont ban owner + // post bannedUserEntry [hubID + userID] + // update owner +}; + +module.exports.help = { + name: 'CMD_hub_ban_user', + parent: 'hub', +}; diff --git a/functions/CMD_hub_delete.js b/functions/CMD_hub_delete.js index b4726c8..1171898 100644 --- a/functions/CMD_hub_delete.js +++ b/functions/CMD_hub_delete.js @@ -8,17 +8,10 @@ const errHander = (err) => { console.error('ERROR:', err); }; // creates a embed messagetemplate for succeded actions function messageSuccess(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, '', 4296754, false); } -// creates a embed messagetemplate for failed actions -async function messageFail(client, message, body) { - const result = client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); - return result; -} - // count channel entrys async function countChannels(hubID) { const result = await BridgedChannel.findAndCountAll({ where: { hubID } }).catch(errHander); @@ -37,7 +30,7 @@ module.exports.run = async (client, message, args, config) => { const [subcmd, hubName] = args; // check if hubname is present if (!hubName) { - return messageFail(client, message, + return messageFail(message, `Command usage: \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${hubName || 'HUBNAME'}\`\`\``); } @@ -47,13 +40,13 @@ module.exports.run = async (client, message, args, config) => { const channelAmmount = await countChannels(hubID); // check hub entry - if (!hubID) return messageFail(client, message, `There is no hub named ${hubName}. Please check your spelling and try again.`); + if (!hubID) return messageFail(message, `There is no hub named ${hubName}. Please check your spelling and try again.`); // check owner // TODO: Add managment exception - if (ownerID !== message.author.id) return messageFail(client, message, `You are not the owner of the hub ${hubName}.`); + if (ownerID !== message.author.id) return messageFail(message, `You are not the owner of the hub ${hubName}.`); // sending pre deletion message - const confirmMessage = await messageFail(client, message, `You are about to delete the hub **${hubName}** with ${channelAmmount} connected channels which can't be undone! \nAre you sure?`); + const confirmMessage = await messageFail(message, `You are about to delete the hub **${hubName}** with ${channelAmmount} connected channels which can't be undone! \nAre you sure?`); await confirmMessage.react('❌'); await confirmMessage.react('✅'); @@ -75,10 +68,10 @@ module.exports.run = async (client, message, args, config) => { // FIXME: if there are no channels connected, the bot throws an error even if it was successful // if (deletedHub && deletedChannels) messageSuccess(client, message, 'Your hub has now been deleted!'); if (deletedHub) messageSuccess(client, message, 'Your hub has now been deleted!'); - else messageFail(client, message, 'Oh no! It seems something went wrong... Please try again another time. If this error persists, feel free to contact us on our support server.'); + else messageFail(message, 'Oh no! It seems something went wrong... Please try again another time. If this error persists, feel free to contact us on our support server.'); return; default: - return messageFail(client, message, 'Please only choose one othe the two options! Try again.'); + return messageFail(message, 'Please only choose one othe the two options! Try again.'); } }); reactionCollector.on('end', () => confirmMessage.delete()); diff --git a/functions/CMD_hub_join.js b/functions/CMD_hub_join.js index 63a257b..a7faa4b 100644 --- a/functions/CMD_hub_join.js +++ b/functions/CMD_hub_join.js @@ -6,16 +6,10 @@ const errHander = (err) => { console.error('ERROR:', err); }; // creates a embed messagetemplate for succeded actions function messageSuccess(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, '', 4296754, false); } -// creates a embed messagetemplate for failed actions -function messageFail(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); -} - // gets hubID from DB async function getHubID(hubName) { const result = await HubName.findOne({ attributes: ['hubID'], where: { hubName } }).catch(errHander); @@ -40,21 +34,21 @@ async function checkPermissions(message) { module.exports.run = async (client, message, args, config) => { // check DM - if (message.channel.type === 'dm') return messageFail(client, message, 'You can\'t link a DM channel!'); + if (message.channel.type === 'dm') return messageFail(message, 'You can\'t link a DM channel!'); // check user permissions - if (!await checkPermissions(message)) return messageFail(client, message, 'Hold on! You dont have permissions to manage this channel. Try asking an admin or link another chnanel where you have permissions instead.'); + if (!await checkPermissions(message)) return messageFail(message, 'Hold on! You dont have permissions to manage this channel. Try asking an admin or link another chnanel where you have permissions instead.'); // get subcmd from args const [subcmd, hubName] = args; // check if hubname is present if (!hubName) { - return messageFail(client, message, + return messageFail(message, `Command usage: \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} HUBNAME\`\`\``); } // get hubID const hubID = await getHubID(hubName); - if (!hubID) return messageFail(client, message, `There is no hub named \`${hubName}\`! But you can create one by using \`${config.prefix}${module.exports.help.parent} register\`.`); + if (!hubID) return messageFail(message, `There is no hub named \`${hubName}\`! But you can create one by using \`${config.prefix}${module.exports.help.parent} register\`.`); // get custom channel const channelID = message.channel.id; @@ -63,7 +57,7 @@ module.exports.run = async (client, message, args, config) => { if (created) { messageSuccess(client, message, `This channel is now linked with \`${hubName}\``); } else { - messageFail(client, message, `A channel in this server is already linked with \`${hubName}\`! Try unlinking it first by using \`${config.prefix}${module.exports.help.parent} leave\`.`); + messageFail(message, `A channel in this server is already linked with \`${hubName}\`! Try unlinking it first by using \`${config.prefix}${module.exports.help.parent} leave\`.`); } }; diff --git a/functions/CMD_hub_leave.js b/functions/CMD_hub_leave.js index ed4b715..ec8b0aa 100644 --- a/functions/CMD_hub_leave.js +++ b/functions/CMD_hub_leave.js @@ -4,16 +4,10 @@ const errHander = (err) => { console.error('ERROR:', err); }; // creates a embed messagetemplate for succeded actions function messageSuccess(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, '', 4296754, false); } -// creates a embed messagetemplate for failed actions -function messageFail(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); -} - // deletes channel entry from DB async function deleteChannel(channelID) { const result = await BridgedChannel.destroy({ where: { channelID } }).catch(errHander); @@ -27,9 +21,9 @@ async function checkPermissions(message) { module.exports.run = async (client, message, args, config) => { // check DM - if (message.channel.type === 'dm') return messageFail(client, message, 'You can\'t unlink a DM channel!'); + if (message.channel.type === 'dm') return messageFail(message, 'You can\'t unlink a DM channel!'); // check user permissions - if (!await checkPermissions(message)) return messageFail(client, message, 'Hold on! You dont have permissions to manage this channel. Try asking an admin to remove the link.'); + if (!await checkPermissions(message)) return messageFail(message, 'Hold on! You dont have permissions to manage this channel. Try asking an admin to remove the link.'); // get custom channel id const channelID = message.channel.id; @@ -37,7 +31,7 @@ module.exports.run = async (client, message, args, config) => { const created = await deleteChannel(channelID); // check if channel entry is deleted and give feedback if (created) messageSuccess(client, message, 'This channel is now not longer linked!'); - else messageFail(client, message, 'This channel is not linked with any hub! You can\'t unlink it.'); + else messageFail(message, 'This channel is not linked with any hub! You can\'t unlink it.'); }; module.exports.help = { diff --git a/functions/CMD_hub_list.js b/functions/CMD_hub_list.js index 038c709..7b8e70d 100644 --- a/functions/CMD_hub_list.js +++ b/functions/CMD_hub_list.js @@ -4,16 +4,10 @@ const errHander = (err) => { console.error('ERROR:', err); }; // creates a embed messagetemplate for succeded actions function messageSuccess(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, '', 4296754, false); } -// creates a embed messagetemplate for failed actions -function messageFail(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); -} - // gets hub names from DB async function getHubNames(ownerID) { const result = await HubName.findAll({ attributes: ['hubName'], where: { ownerID } }).catch(errHander); @@ -23,7 +17,7 @@ async function getHubNames(ownerID) { module.exports.run = async (client, message, args, config) => { // check if in DM - if (message.channel.type !== 'dm') return messageFail(client, message, 'This command can only be used in DM!'); + if (message.channel.type !== 'dm') return messageFail(message, 'This command can only be used in DM!'); // get hubNames const hubNames = await getHubNames(message.author.id); let names = ''; diff --git a/functions/CMD_hub_register.js b/functions/CMD_hub_register.js index 2b80276..78c13ac 100644 --- a/functions/CMD_hub_register.js +++ b/functions/CMD_hub_register.js @@ -4,16 +4,10 @@ const errHander = (err) => { console.error('ERROR:', err); }; // creates a embed messagetemplate for succeded actions function messageSuccess(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') + client.functions.get('FUNC_richEmbedMessage') .run(client.user, message.channel, body, '', 4296754, false); } -// creates a embed messagetemplate for failed actions -function messageFail(client, message, body) { - client.functions.get('FUNC_MessageEmbedMessage') - .run(client.user, message.channel, body, '', 16449540, false); -} - // creates channel DB entry async function createHub(hubName, ownerID, maxHubs) { const result = await HubName.findAndCountAll({ where: { ownerID } }).catch(errHander); @@ -24,26 +18,26 @@ async function createHub(hubName, ownerID, maxHubs) { module.exports.run = async (client, message, args, config) => { // check if in DM - if (message.channel.type !== 'dm') return messageFail(client, message, 'This command can only be used in DM!'); + if (message.channel.type !== 'dm') return messageFail(message, 'This command can only be used in DM!'); // get subcmd from args const [subcmd, checkHubName] = args; // check if hubname is present if (!checkHubName) { - return messageFail(client, message, + return messageFail(message, `Command usage: \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${checkHubName || 'HUBNAME'}\`\`\``); } const hubName = args.join('_').slice(subcmd.length + 1); const fittedHubName = `${message.id}_${hubName}`; - if (fittedHubName.length > 50) return messageFail(client, message, 'Sorry, your hubname ist too long... Try something shorter.'); + if (fittedHubName.length > 50) return messageFail(message, 'Sorry, your hubname ist too long... Try something shorter.'); const created = await createHub(fittedHubName, message.author.id, config.maxAllowedHubs); if (created) { messageSuccess(client, message, `You created \`${hubName}\`! You can link with it by using \`${config.prefix}${module.exports.help.parent} join ${fittedHubName}\`. **Make sure you only give the hub name to servers that you want to invite.**`); - } else messageFail(client, message, `Your account already owns a maximum of ${config.maxAllowedHubs} hubs. You can't create more then that!`); + } else messageFail(message, `Your account already owns a maximum of ${config.maxAllowedHubs} hubs. You can't create more then that!`); }; module.exports.help = { diff --git a/functions/CMD_hub_rename.js b/functions/CMD_hub_rename.js index b4ecf53..3ac86ba 100644 --- a/functions/CMD_hub_rename.js +++ b/functions/CMD_hub_rename.js @@ -1,7 +1,7 @@ // DISABLED: not done module.exports.run = async (client, message, args, config) => { // check if in DM - if (message.channel.type !== 'dm') return messageFail(client, message, 'This command can only be used in DM!'); + if (message.channel.type !== 'dm') return messageFail(message, 'This command can only be used in DM!'); message.reply('rnme'); // renames the hub }; diff --git a/functions/CMD_hub_unban.js b/functions/CMD_hub_unban.js new file mode 100644 index 0000000..05adff2 --- /dev/null +++ b/functions/CMD_hub_unban.js @@ -0,0 +1,21 @@ +module.exports.run = async (client, message, args, config) => { + // get subcmd from args + const [subcmd, type] = args; + // check provided values + switch (type) { + case 'user': + client.functions.get(`CMD_${module.exports.help.parent}_${subcmd}_${type}`) + .run(client, message, args, config); + return; + + default: + return messageFail(message, + `Command usage: + \`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${type || 'user'} MESSAGEID REASON\`\`\``); + } +}; + +module.exports.help = { + name: 'CMD_hub_ban', + parent: 'hub', +}; diff --git a/functions/EVENT_guildDelete.js b/functions/EVENT_guildDelete.js index 88f5947..0d1f38b 100644 --- a/functions/EVENT_guildDelete.js +++ b/functions/EVENT_guildDelete.js @@ -6,7 +6,8 @@ const errHander = (err) => { console.error('ERROR:', err); }; // Deletes all messages in every channel, if its deleted in one module.exports.run = async (guild) => { - guild.channels.forEach(async (channel) => { + console.log(guild); + guild.channels.cache.forEach(async (channel) => { if (!channel.type !== 'text') return; const channelID = channel.id; const checkedChannel = await BridgedChannel.findOne({ attributes: ['channelID'], where: { channelID } }).catch(errHander); diff --git a/functions/FUNC_richEmbedMessage.js b/functions/FUNC_richEmbedMessage.js index 1edbfe3..7d2f01f 100644 --- a/functions/FUNC_richEmbedMessage.js +++ b/functions/FUNC_richEmbedMessage.js @@ -17,5 +17,5 @@ module.exports.run = async (user, channel, body, title, color, footer) => { }; module.exports.help = { - name: 'FUNC_MessageEmbedMessage', + name: 'FUNC_richEmbedMessage', }; diff --git a/functions/GLBLFUNC_errHandler.js b/functions/GLBLFUNC_errHandler.js new file mode 100644 index 0000000..2efcc2f --- /dev/null +++ b/functions/GLBLFUNC_errHandler.js @@ -0,0 +1,5 @@ +global.errHandler = (err) => console.error('ERROR:', err); + +module.exports.help = { + name: 'GLBLFUNC_errHandler', +}; diff --git a/functions/GLBLFUNC_messageFail.js b/functions/GLBLFUNC_messageFail.js new file mode 100644 index 0000000..b0d05ec --- /dev/null +++ b/functions/GLBLFUNC_messageFail.js @@ -0,0 +1,11 @@ +global.messageFail = async (message, body, keep) => { + const client = message.client; + const sentMessage = await client.functions.get('FUNC_richEmbedMessage') + .run(client.user, message.channel, body, '', 16449540, false); + if (!keep) sentMessage.delete({ timeout: 30000 }); + return sentMessage; +}; + +module.exports.help = { + name: 'GLBLFUNC_messageFail', +}; diff --git a/functions/GLBLFUNC_messageSuccess.js b/functions/GLBLFUNC_messageSuccess.js new file mode 100644 index 0000000..e31aebe --- /dev/null +++ b/functions/GLBLFUNC_messageSuccess.js @@ -0,0 +1,10 @@ +global.messageSuccess = async (message, body) => { + const client = message.client; + const sentMessage = await client.functions.get('FUNC_richEmbedMessage') + .run(client.user, message.channel, body, '', 4296754, false); + return sentMessage; +}; + +module.exports.help = { + name: 'GLBLFUNC_messageSuccess', +}; diff --git a/functions/SETUP_telegramBot.js b/functions/SETUP_telegramBot.js new file mode 100644 index 0000000..8d54056 --- /dev/null +++ b/functions/SETUP_telegramBot.js @@ -0,0 +1,15 @@ +const TG = require('telegram-bot-api'); + +module.exports.run = async (client, config) => { + const telegramClient = new TG({ + token: config.env.get('telegramToken'), + }); + + telegramClient.getMe() + .then(console.log) + .catch(console.err); +}; + +module.exports.help = { + name: 'SETUP_telegramBot', +}; diff --git a/functions/STARTUP_DBConnection.js b/functions/STARTUP_DBConnection.js new file mode 100644 index 0000000..8145ba6 --- /dev/null +++ b/functions/STARTUP_DBConnection.js @@ -0,0 +1,35 @@ +const Sequelize = require('sequelize'); + +const testdiscordToken = '../config/config.json'; + +const config = require('../config/main.json'); + +module.exports.run = () => { + console.log('[DB] Connecting...'); + let database; + let user; + let password; + let host; + if (config.env.get('inDev')) { + const DBCredentials = require(testdiscordToken).development; + database = DBCredentials.database; + user = DBCredentials.username; + password = DBCredentials.password; + host = DBCredentials.host; + } else { + database = process.env.DBNameISH; + user = process.env.DBUsernameISH; + password = process.env.DBPasswISH; + host = process.env.DBHost; + } + const sequelize = new Sequelize( + database, user, password, { host, dialect: 'mysql', logging: config.env.get('inDev') }, + ); + console.log('[DB] Connected!'); + + global.sequelize = sequelize; +}; + +module.exports.help = { + name: 'STARTUP_DBConnection', +}; diff --git a/functions/STARTUP_envPrep.js b/functions/STARTUP_envPrep.js index 9a70cb9..3d6a8f0 100644 --- a/functions/STARTUP_envPrep.js +++ b/functions/STARTUP_envPrep.js @@ -4,12 +4,15 @@ module.exports.run = async (client, fs, config) => { // setting inDev var console.log(`[${module.exports.help.name}] Setting environment variables...`); if (fs.existsSync(testToken)) { - const token = require(`.${testToken}`).discordToken; + const discordToken = require(`.${testToken}`).discordToken; + const telegramToken = require(`.${testToken}`).telegramToken; config.env.set('inDev', true); - config.env.set('token', token); + config.env.set('discordToken', discordToken); + config.env.set('telegramToken', telegramToken); } else { config.env.set('inDev', false); - config.env.set('token', process.env.discordToken); + config.env.set('discordToken', process.env.BotToken); + config.env.set('telegramToken', process.env.BottelegramTokenISH); } console.log(`[${module.exports.help.name}] Environment variables set!`); }; diff --git a/index.js b/index.js index 870194b..c6bbffc 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,6 @@ const Discord = require('discord.js'); // init Discord client const client = new Discord.Client({ disableMentions: 'everyone' }); -// init sequelize -const sequelize = require('sequelize'); // init filesystem const fs = require('fs'); // init config @@ -20,16 +18,19 @@ config.setup.startupFunctions.forEach((FCN) => { INIT.run(client, fs, config); }); -// create conenction to DB -require('./database/SETUP_DBConnection'); - // Login the bot -client.login(config.env.get('token')); +client.login(config.env.get('discordToken')); // trigger on bot login -client.on('ready', () => { +client.on('ready', async () => { // confirm user logged in console.log(`[${config.name}] Logged in as ${client.user.tag} serving ${client.guilds.cache.size} Servers!`); + + // setup tables + console.log('[DB] Syncing tables...'); + await sequelize.sync(); + await console.log('[DB] Done syncing!'); + // set bot player status config.setup.setupFunctions.forEach((FCN) => { client.functions.get(FCN).run(client, config); diff --git a/migrations/20210914131359-bannedusers.js b/migrations/20210914131359-bannedusers.js new file mode 100644 index 0000000..34cc10b --- /dev/null +++ b/migrations/20210914131359-bannedusers.js @@ -0,0 +1,35 @@ +module.exports = { + up: (queryInterface, Sequelize) => queryInterface.createTable('bannedUsers', { + ID: { + type: Sequelize.INTEGER(11), + primaryKey: true, + autoIncrement: true, + }, + userID: { + type: Sequelize.STRING(30), + allowNull: false, + }, + hubID: { + type: Sequelize.INTEGER(11), + allowNull: false, + references: { + model: 'hubNames', + key: 'hubID', + }, + }, + reason: { + type: Sequelize.TEXT, + allowNull: false, + }, + createdAt: Sequelize.DATE, + updatedAt: Sequelize.DATE, + }, + { + uniqueKeys: { + banUnique: { + fields: ['userID', 'hubID'], + }, + }, + }), + down: (queryInterface, Sequelize) => queryInterface.dropTable('bannedUsers'), +}; diff --git a/package-lock.json b/package-lock.json index 07c2d00..de66c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,6 +78,15 @@ "event-target-shim": "^5.0.0" } }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, "acorn": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", @@ -148,6 +157,11 @@ "sprintf-js": "~1.0.2" } }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -169,6 +183,19 @@ "es-abstract": "^1.17.0-next.1" } }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", @@ -180,17 +207,74 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -201,12 +285,22 @@ "concat-map": "0.0.1" } }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -289,6 +383,34 @@ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -310,6 +432,14 @@ } } }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -343,6 +473,16 @@ "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz", "integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, "discord.js": { "version": "12.3.1", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", @@ -372,12 +512,31 @@ "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -417,6 +576,11 @@ "is-symbol": "^1.0.2" } }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -661,11 +825,73 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -677,6 +903,11 @@ "tmp": "^0.0.33" } }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -686,8 +917,7 @@ "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", @@ -713,6 +943,35 @@ "flat-cache": "^2.0.1" } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -739,6 +998,31 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -765,6 +1049,14 @@ "is-property": "^1.0.2" } }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -803,6 +1095,38 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + } + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -830,11 +1154,39 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -964,6 +1316,11 @@ } } }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -1043,6 +1400,11 @@ "has-symbols": "^1.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1055,6 +1417,11 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1071,11 +1438,20 @@ "esprima": "^4.0.0" } }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -1083,6 +1459,11 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -1092,6 +1473,17 @@ "minimist": "^1.2.0" } }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1142,6 +1534,26 @@ "yallist": "^4.0.0" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -1265,6 +1677,11 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -1296,6 +1713,11 @@ } } }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -1343,6 +1765,14 @@ "has": "^1.0.3" } }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1428,6 +1858,11 @@ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==" }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1452,6 +1887,11 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -1461,6 +1901,11 @@ "pify": "^2.0.0" } }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1501,16 +1946,50 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } }, "read-pkg": { "version": "2.0.0", @@ -1539,6 +2018,40 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + } + } + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -1599,6 +2112,11 @@ "tslib": "^1.9.0" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1609,6 +2127,48 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, "seq-queue": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", @@ -1641,11 +2201,27 @@ "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-2.3.0.tgz", "integrity": "sha512-Ibz08vnXvkZ8LJTiUOxRcj1Ckdn7qafNZ2t59jYHMX1VIebTAOYefWdRYFt6z6+hy52WGthAHAoLc9hvk3onqA==" }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -1734,6 +2310,34 @@ "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.2.tgz", "integrity": "sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg==" }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -1851,6 +2455,28 @@ } } }, + "telegram-bot-api": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/telegram-bot-api/-/telegram-bot-api-2.0.1.tgz", + "integrity": "sha512-qOEO+c7IVJroyxq2vujLbZK8q97U9RtpzAeW//2dyWKS1dETqh0TjhzcSNydxJ1B5b8Lbg2zzjFI5i7CnyUx0A==", + "requires": { + "bluebird": "^3.4.0", + "body-parser": "^1.18.2", + "debug": "^3.1.0", + "express": "^4.17.1", + "request": "^2.88.2" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -1872,11 +2498,25 @@ "os-tmpdir": "~1.0.2" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, "toposort-class": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -1895,6 +2535,14 @@ "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -1915,15 +2563,33 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, "requires": { "punycode": "^2.1.0" } }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -1950,6 +2616,21 @@ "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index b9a040b..968ed76 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "i-sh", - "version": "1.1.1", + "version": "1.2.0", "main": "index.js", "dependencies": { "discord.js": "^12.3.1", "mysql2": "^2.2.2", "pretty-ms": "^5.1.0", - "sequelize": "^5.22.3" + "sequelize": "^5.22.3", + "telegram-bot-api": "^2.0.1" }, "devDependencies": { "eslint": "^6.8.0", diff --git a/readme.md b/readme.md index b8b48ab..399ea50 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ ##### How do I get started with you? -> Use `+help` to learn all the commands. +> Use `ish!help` to learn all the commands. ##### I need some help @@ -18,4 +18,4 @@ ##### Source Code -> Feel free to look at my [GitHub](https://github.com/FlipperLP/I-SH/)! \ No newline at end of file +> Feel free to look at my [GitHub](https://github.com/FlipperLP/I-SH/)!