-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Wakeup WIP * Wakeup WIP - still need TTS working * Wakeup fixes, mp3/yt support * Switching bp text back to real value --------- Co-authored-by: Ed Morgan <[email protected]>
- Loading branch information
Showing
12 changed files
with
10,193 additions
and
199 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { | ||
ApplicationCommandOptionChoiceData, | ||
AutocompleteInteraction, | ||
CacheType, | ||
CommandInteraction, | ||
} from "discord.js"; | ||
import { Subcommand } from "../../shared/command/subcommand"; | ||
import { IPublicAccountService } from "../../services/bot/public-accounts.i"; | ||
import { PublicAccountsFactory } from "../../services/bot/bot-factory"; | ||
import { authorizeByMemberRoles } from "../../shared/command/util"; | ||
import { officerRoleId, knightRoleId } from "../../config"; | ||
import { redisClient } from "../../redis/client"; | ||
|
||
export enum SetSongOption { | ||
URL = "url", | ||
} | ||
export class SetSongSubcommand extends Subcommand { | ||
|
||
constructor(name: string, description: string) { | ||
super(name, description); | ||
} | ||
|
||
public async execute(interaction: CommandInteraction<CacheType>) { | ||
const URL = this.getRequiredOptionValue( | ||
SetSongOption.URL, | ||
interaction | ||
) as string; | ||
|
||
try { | ||
authorizeByMemberRoles([officerRoleId, knightRoleId], interaction); | ||
redisClient.hSet("wakeup", "song", URL); | ||
await interaction.editReply("Edited song to " + URL); | ||
} catch (error) { | ||
await interaction.editReply(`Failed to edit song: ${error}`); | ||
} | ||
} | ||
|
||
public get command() { | ||
const command = super.command.addStringOption((o) => | ||
o | ||
.setName(SetSongOption.URL) | ||
.setDescription("URL of the media to play for wake up") | ||
.setAutocomplete(false) | ||
.setRequired(true) | ||
); | ||
return command; | ||
} | ||
|
||
public getOptionAutocomplete( | ||
option: string, | ||
interaction: AutocompleteInteraction<CacheType> | ||
): Promise< | ||
ApplicationCommandOptionChoiceData<string | number>[] | undefined | ||
> { | ||
throw new Error("Method not implemented."); | ||
} | ||
} | ||
|
||
export const setSongSubCommand = new SetSongSubcommand( | ||
"setsong", | ||
"Sets the wakeup song (be nice)" | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Command } from "../../shared/command/command"; | ||
import { setSongSubCommand } from "./setsong-subcommand"; | ||
|
||
export const wakeupCommand = new Command( | ||
"wakeup", | ||
"Retrieve information about bots.", | ||
[setSongSubCommand] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
export interface IWakeupService { | ||
runWakeup(batphoneMessageId: string): void; | ||
} |
Oops, something went wrong.