diff --git a/CHANGELOG.md b/CHANGELOG.md index 580d9e9..49aacbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to Kawaii Cocoa Grader will be documented here Changelog before 0.2.2 will not be noted here +## [1.0.4] - 2022-02-24 + +- Implemented features in Cocoa Discord Utils 1.0.0 *(forgot to do that in previous version)* + ## [1.0.3] - 2022-02-23 - Upgrade to Cocoa Discord Utils 1.0.0 and use its new feature diff --git a/README.md b/README.md index db492de..f9d8403 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ A Discord Bot Grader, more specifically, '*Waifu Discord Bot*' - Use some powerful devices (don't use Raspberry Pi that I use 😖) +### Known Issues + +- Raspberry Pi cannot handle grader tasks 😢😭 + - JavaScript do not work (Will be reported as Runtime Error) + - Unexpected Time Limit + ## 🍫 Behind this Bot This Discord Bot use [Cocoa Discord Utils](https://github.com/Leomotors/cocoa-discord-utils), diff --git a/package.json b/package.json index 80551b4..27fc24f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cocoa-grader", - "version": "1.0.3", + "version": "1.0.4", "description": "Discord Bot Grader", "main": "dist/bot/client.js", "repository": "https://github.com/Leomotors/cocoa-grader", @@ -19,7 +19,7 @@ "dependencies": { "@discordjs/builders": "^0.12.0", "chalk": "^5.0.0", - "cocoa-discord-utils": "^1.0.0", + "cocoa-discord-utils": "^1.1.0-rc.1", "discord.js": "^13.6.0", "dotenv": "^16.0.0", "node-fetch": "^3.2.0", @@ -27,7 +27,7 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^3.2.0", - "@types/node": "^17.0.19", + "@types/node": "^17.0.21", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", diff --git a/src/bot/client.ts b/src/bot/client.ts index 3bfd033..1117146 100644 --- a/src/bot/client.ts +++ b/src/bot/client.ts @@ -18,6 +18,7 @@ import { loadProblems } from "../grader/problems"; import { CocoaMsg } from "./commands/message"; import { Cocoa } from "./commands/slash"; +import { style } from "./shared"; loadProblems(); @@ -25,6 +26,7 @@ const client = new Client(CocoaOptions); const msgcenter = new MessageCenter(client, { mention: true }); msgcenter.addCog(CocoaMsg); +msgcenter.useHelpCommand(style); msgcenter.on("error", async (name, err, msg) => { await msg.reply(`あら?, Error Occured: ${err}`); }); @@ -34,6 +36,7 @@ const slashcenter = new SlashCenter( process.env.GUILD_IDS?.split(",") ?? [] ); slashcenter.addCog(Cocoa); +slashcenter.useHelpCommand(style); slashcenter.on("error", async (name, err, ctx) => { await ctx.reply(`あら?, Error Occured: ${err}`); }); diff --git a/src/bot/shared/cocoa.ts b/src/bot/shared/cocoa.ts index 5e9603d..7d3c6de 100644 --- a/src/bot/shared/cocoa.ts +++ b/src/bot/shared/cocoa.ts @@ -1,8 +1,6 @@ -import { createEmbedStyle } from "cocoa-discord-utils"; +import { Context, EmbedStyle } from "cocoa-discord-utils"; import { getElapsed } from "cocoa-discord-utils/meta"; -import { CommandInteraction, Message } from "discord.js"; - export namespace Cocoa { export const Color = 0xe0beab; @@ -19,7 +17,7 @@ export namespace Cocoa { "https://c.tenor.com/O46FOm38idkAAAAC/thumbs-up-cocoa.gif"; } - export function Footer(ctx: CommandInteraction | Message) { + export function Footer(ctx: Context) { return { text: `Action took ${getElapsed( ctx.createdAt @@ -28,7 +26,7 @@ export namespace Cocoa { } } -export const style = createEmbedStyle({ +export const style = new EmbedStyle({ author: "invoker", color: Cocoa.Color, footer: (ctx) => Cocoa.Footer(ctx), diff --git a/yarn.lock b/yarn.lock index 9a2795b..79551a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -347,10 +347,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" integrity sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog== -"@types/node@^17.0.19": - version "17.0.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.19.tgz#726171367f404bfbe8512ba608a09ebad810c7e6" - integrity sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA== +"@types/node@^17.0.21": + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== "@types/uuid@^8.3.4": version "8.3.4" @@ -561,10 +561,10 @@ chalk@^5.0.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.0.tgz#bd96c6bb8e02b96e08c0c3ee2a9d90e050c7b832" integrity sha512-/duVOqst+luxCQRKEo4bNxinsOQtMP80ZYm7mMqzuh5PociNL0PvmHFvREJ9ueYL2TxlHjBcmLCdmocx9Vg+IQ== -cocoa-discord-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cocoa-discord-utils/-/cocoa-discord-utils-1.0.0.tgz#b49f69e406ed0b71daaad73aa6fefc7aa77f7cb2" - integrity sha512-5obDl1G2PWoEpCGJyoMiBtgrN/iX9CHznyT/znSMcFl3IMgB9oa2FTNPpekpcCP/z5kFT+O1vwiUl16lZ8XhXw== +cocoa-discord-utils@^1.1.0-rc.1: + version "1.1.0-rc.1" + resolved "https://registry.yarnpkg.com/cocoa-discord-utils/-/cocoa-discord-utils-1.1.0-rc.1.tgz#f2871f4e4eb3e31bc5074e43c1c7b965caa4b360" + integrity sha512-suWLc9HYgItxUaVHNpuc+q2kt3CJXQW7MDHGJXpjoE6xQSY01VC8iGrBkczrhZDAVZ6Y8e5fmrerN2KunjEF8w== dependencies: "@discordjs/builders" "^0.12.0" chalk "4.1.2"