Browse Source

Add basic changelog testing

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
b6047cf32c
  1. 18
      bot/awesomescibo.js
  2. 14
      gitlog.js
  3. 1670
      package-lock.json
  4. 1
      package.json

18
bot/awesomescibo.js

@ -9,6 +9,7 @@ const axios = require("axios");
const userScore = require("./mongooseModels/mongooseUserScoreModel.js");
const generatedRound = require("./mongooseModels/mongooseGeneratedRoundModel.js");
const mongoose = require("mongoose");
const gitlog = require("gitlog").default;
const helpMessage =
"`do be helping`: display this help message\n`do be roundgen`: send a pdf round to the channel\n`do be scoring`: start a scoring session\n > `do be scoring (a/b)(4/10)`: add points to Team A or Team B\n > `do be scoring stop`: end scoring session and post final points\n > `do be servers`: send the number of servers this bot is a part of\n > `do be iss`: show the current location of the International Space Station\n`do be training`: send a quick practice problem (you **must** react to your answer, or the bot will yell at you)\n > subject options: astro, phys, chem, math, bio, ess, energy\n`do be top`: list cross-server top 10 players\n `do be about`: List people who contributed to this bot\n Source Code: https://github.com/ADawesomeguy/AwesomeSciBo (don't forget to star!)";
@ -429,6 +430,20 @@ async function hits(message) {
message.channel.send(`Total Hits: ${totalCount}\nYour Hits: ${userCount}`);
}
async function changelog(message) {
let parentFolder = __dirname.split("/");
parentFolder.pop();
parentFolder = parentFolder.join("/");
const commits = gitlog({
repo: parentFolder,
number: 20,
fields: ["hash", "abbrevHash", "subject", "authorName", "authorDateRel"],
});
console.log(commits);
}
client.on("message", async (message) => {
if (message.author.bot) {
return;
@ -471,6 +486,9 @@ client.on("message", async (message) => {
case "dobehits":
hits(message);
break;
case "dobechangelog":
changelog(message);
break;
default:
// Do be training
otherCommands(message);

14
gitlog.js

@ -0,0 +1,14 @@
const gitlog = require("gitlog").default;
let parentFolder = __dirname.split("/");
parentFolder.pop();
parentFolder = parentFolder.join("/");
console.log(parentFolder);
const commits = gitlog({
repo: __dirname,
number: 20,
fields: ["hash", "abbrevHash", "subject", "authorName", "authorDateRel"],
});
//console.log(commits);

1670
package-lock.json

File diff suppressed because it is too large

1
package.json

@ -2,6 +2,7 @@
"dependencies": {
"axios": "^0.21.1",
"dotenv": "^8.2.0",
"gitlog": "^4.0.4",
"mongoose": "^5.12.4"
},
"devDependencies": {

Loading…
Cancel
Save