diff options
| -rw-r--r-- | commands/addquote.js | 58 | ||||
| -rw-r--r-- | commands/git.js | 7 | ||||
| -rw-r--r-- | package-lock.json | 5 | ||||
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | storage/settings.json | 2 |
5 files changed, 71 insertions, 2 deletions
diff --git a/commands/addquote.js b/commands/addquote.js new file mode 100644 index 0000000..ddb7b5a --- /dev/null +++ b/commands/addquote.js @@ -0,0 +1,58 @@ +/**************************************** + * + * AddQuote: Command for AleeBot + * Copyright (C) 2018 AleeCorp + * + * 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 <http://www.gnu.org/licenses/>. + * + * *************************************/ +module.exports.run = async (client, message, args) => { + /* + const moment = require('moment'); + const log = message => { + + console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${message}`); + + }; + const fs = require('fs'); + if(!args[0]) return message.reply(`Usage: ab:addquote [author] [authorImage] [quote]`) + + let quotes = JSON.parse(fs.readFileSync("./storage/quotes.json", "utf8")); + + quotes = { + author: args[0], + authorImage: args[1], + quote: args[2], + year: args[3] + }; + + fs.writeFile("./storage/quotes.json", JSON.stringify(quotes), (err) =>{ + if (err) log(err) + }) + + message.reply(`You just added a new quote!`); + log(`[i] A quote has been added to quotes.json...`) */ + }; + + exports.conf = { + aliases: [], + guildOnly: true, + }; + exports.help = { + name: 'addquote', + description: 'Sets the guild prefix.', + usage: 'addquote [author] [authorImage] [quote] [year]', + category: '- General Commands', + }; +
\ No newline at end of file diff --git a/commands/git.js b/commands/git.js index 7d0c454..48cf070 100644 --- a/commands/git.js +++ b/commands/git.js @@ -19,12 +19,17 @@ * *************************************/
module.exports.run = async (client, message) => {
const Discord = require('discord.js');
+ const git = require('git-last-commit');
+ git.getLastCommit(function(err, commit) {
const embed = new Discord.RichEmbed()
.setTitle('GitHub Information')
.addField('**Repository:**', 'https://github.com/AleeCorp/AleeBot')
- .addField('**Last Commit:**', '*Working Progress*')
+ .addField('**Last Commit:**', commit.subject)
.setColor('#1fd619')
message.channel.send({ embed });
+ console.log(commit)
+ console.log(err)
+ })
};
exports.conf = {
diff --git a/package-lock.json b/package-lock.json index 82225ce..b0bd3c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,11 @@ "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" }, + "git-last-commit": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/git-last-commit/-/git-last-commit-0.3.0.tgz", + "integrity": "sha1-zHcBrcYpt0f9OzOuXddTp0as6d8=" + }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", diff --git a/package.json b/package.json index d3991d7..a0d8baa 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "discord-eco": "0.0.10", "discord.js": "^11.3.1", "fs": "0.0.1-security", + "git-last-commit": "^0.3.0", "moment": "^2.21.0", "os": "^0.1.1" }, diff --git a/storage/settings.json b/storage/settings.json index 104ab83..58a4a1e 100644 --- a/storage/settings.json +++ b/storage/settings.json @@ -1,4 +1,4 @@ { "abVersion": "2.8.3", - "prefix": "ab:" + "prefix": "abb:" } |
