Skip to content

Commit

Permalink
[Release] 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Feb 25, 2022
1 parent 83165fe commit 7d8db6b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -19,15 +19,15 @@
"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",
"uuid": "^8.3.2"
},
"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",
Expand Down
3 changes: 3 additions & 0 deletions src/bot/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import { loadProblems } from "../grader/problems";

import { CocoaMsg } from "./commands/message";
import { Cocoa } from "./commands/slash";
import { style } from "./shared";

loadProblems();

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}`);
});
Expand All @@ -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}`);
});
Expand Down
8 changes: 3 additions & 5 deletions src/bot/shared/cocoa.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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
Expand All @@ -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),
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7d8db6b

Please sign in to comment.