Skip to content

Commit

Permalink
feat: 🎸 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HighError committed Oct 28, 2024
1 parent 3c4ae5e commit 2f70193
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)

---

## [**5.0.1**] - 28.10.2024

- Added: Support **halloween** holiday
- Auto enable from 25.10 to 6.11
- Change temp voice name
- DEV: Support any holiday in `/src/utils/holiday.ts`

## [**5.0.0**] - 18.10.2024

- Added: support to multiple lavalink nodes
Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "evilbot",
"version": "5.0.0",
"version": "5.0.1",
"description": "Official discord bot for Eviloma discord server",
"homepage": "https://github.com/Eviloma/evilbot",
"bugs": {
Expand Down Expand Up @@ -43,6 +43,7 @@
"trustedDependencies": ["@biomejs/biome"],
"dependencies": {
"canvacord": "^6.0.2",
"dayjs": "^1.11.13",
"discord.js": "^14.16.3",
"easy-discord-components": "^1.1.2",
"envalid": "^8.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/events/VoiceStateUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Event } from "@/types/Event";
import env from "@/utils/env";
import { getTempVoiceName } from "@/utils/holiday";
import {
type CategoryChannel,
ChannelType,
Expand All @@ -13,7 +14,7 @@ import {
async function CreateVoiceChannel(member: GuildMember, channel: VoiceBasedChannel, parent: CategoryChannel) {
const voiceChannel = await member.guild.channels
.create({
name: `🔊${member.displayName}`,
name: getTempVoiceName(member.displayName),
type: ChannelType.GuildVoice,
reason: `Create temp voice chat for ${member.displayName}`,
permissionOverwrites: [
Expand Down
22 changes: 22 additions & 0 deletions src/utils/holiday.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import dayjs from "dayjs";

type Holiday = "halloween" | null;

export function getHolidayStatus(): Holiday {
const now = dayjs().set("year", 2000);

if (now.isAfter("2000-10-25") && now.isBefore("2000-11-6")) {
return "halloween";
}

return null;
}

export function getTempVoiceName(displayName: string): string {
switch (getHolidayStatus()) {
case "halloween":
return `🦇${displayName}`;
default:
return `🔊${displayName}`;
}
}

0 comments on commit 2f70193

Please sign in to comment.