Skip to content

Commit

Permalink
feat: 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 22, 2023
1 parent 3243e76 commit cd52df9
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Previous changelog before 4.0.605 may not be noted here.

## [5.x.x] - 2023-??-??
## [5.0.800] - 2023-09-22

- refactor(bot): remove /lyrics (kashi module), /quality, /kitakita, /speak(TTS Module)
- feat: updated cocoa-discord to v3
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Nominated and image selected by @Qwenty228

![](./images/kaede.webp)

**Current Version**: 4.1
**Current Version**: 5.0
**Been SIMPing since**: 4.1.700

## 📚 Tech Stack
Expand Down Expand Up @@ -84,6 +84,7 @@ Version 1 -> Python Skittle-chan Era
Version 2 -> Python Harunon Era
Version 3 -> JavaScript
Version 4 -> Full Stack Waifu with T U R B O R E P O
Version 5 -> Only Bot (will add website in Version 6)

## Utility Library behind this Bot!

Expand Down
2 changes: 1 addition & 1 deletion apps/bot/.prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = require("@leomotors/config/prettier").withSortImports({
importOrder: [
"^@waifu-bot",
"^cocoa-discord",
"^@leomotors",
"^@cocoa-discord",
"^discord.js",
"^@discordjs",
"<THIRD_PARTY_MODULES>",
Expand Down
3 changes: 2 additions & 1 deletion apps/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"cb": "pnpm clean && pnpm build",
"start": "node dist/bot.js",
"format": "eslint src --fix",
"lint": "eslint src"
"lint": "eslint src",
"postinstall": "node patch.js"
},
"devDependencies": {
"@types/uuid": "9.0.4",
Expand Down
3 changes: 3 additions & 0 deletions apps/bot/patch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { patchPlayDl } from "@cocoa-discord/music-module";

await patchPlayDl();
9 changes: 8 additions & 1 deletion apps/bot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { MessageCenter } from "cocoa-discord/message";
import { SlashCenter } from "cocoa-discord/slash";
import { CocoaIntent } from "cocoa-discord/template";

import { TTS } from "@cocoa-discord/music-module";

import { Client } from "discord.js";

import chalk from "chalk";
Expand Down Expand Up @@ -44,7 +46,12 @@ mcenter.on("error", async (name, err, msg) => {
});

const scenter = new SlashCenter(client, GuildIds);
scenter.addModules(new MainSlash(), new Shitpost(), new Music(client));
scenter.addModules(
new MainSlash(),
new Shitpost(),
new Music(client),
new TTS(environment.SPEECH_KEY, environment.SPEECH_REGION, style),
);
scenter.useHelpCommand(style);
scenter.on("error", async (name, err, ctx) => {
Cocoa.log(
Expand Down
4 changes: 2 additions & 2 deletions apps/bot/src/commands/main.slash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
} from "cocoa-discord/slash/class";
import { getStatusFields } from "cocoa-discord/template";

import { TextChannel } from "discord.js";

import { Version as MusicVersion } from "@cocoa-discord/music-module";

import { TextChannel } from "discord.js";

import { environment } from "../environment.js";

import { HelixError, formatTime, makeHelix } from "./main.service.js";
Expand Down
11 changes: 8 additions & 3 deletions apps/bot/src/commands/music.slash.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Param, SlashCommand } from "cocoa-discord/slash/class";

import { ChannelType, Client, VoiceChannel } from "discord.js";

import {
Music as MusicBase,
addMusicToQueue,
joinVoiceChannel,
} from "@cocoa-discord/music-module";

import { ChannelType, Client, VoiceChannel } from "discord.js";

import { style } from "./styles.js";

// * Note: Extending Class Cog is not what you should do unless you know
Expand All @@ -22,6 +22,11 @@ export class Music extends MusicBase {
ctx: SlashCommand.Context,
@Param.Channel("Channel to surprise!") channel: Param.Channel.Type,
) {
if (!ctx.guildId) {
await ctx.reply("This command is only available in server!");
return;
}

if (channel.type !== ChannelType.GuildVoice) {
await ctx.reply("Can only rick roll normal voice channel");
return;
Expand All @@ -31,7 +36,7 @@ export class Music extends MusicBase {

await joinVoiceChannel(channel as VoiceChannel);
await addMusicToQueue(
ctx.guildId!,
ctx.guildId,
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
ctx.user.id,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// * Data such as App Version, Waifu Specific Information and common consts
// * will be in this package

export const AppVersion = "4.1.710";
export const AppVersion = "5.0.800";

export const ShortNameEN = "Kaede";
export const ShortNameJA = "かえで";
Expand Down

0 comments on commit cd52df9

Please sign in to comment.