mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 01:01:39 +01:00
add dectalk tts for 25k channel points (let the suffering begin)
This commit is contained in:
@@ -4,7 +4,7 @@ import { sendMessage } from "lib/commandUtils";
|
||||
import { redis } from "lib/redis";
|
||||
import { timeout } from "lib/timeout";
|
||||
import type User from "user";
|
||||
import { playTTS } from "web/alerts/serverFunctions";
|
||||
import { playMSTTS } from "web/alerts/serverFunctions";
|
||||
|
||||
const ANIVNAMES: anivBots[] = ["a_n_e_e_v", "a_n_i_v"];
|
||||
|
||||
@@ -44,7 +44,7 @@ export default async function handleMessage(
|
||||
user: User,
|
||||
) {
|
||||
if (ANIVNAMES.map((a) => a.toLowerCase()).includes(user.username)) {
|
||||
await playTTS({ text: msg.messageText });
|
||||
await playMSTTS({ text: msg.messageText });
|
||||
const data: anivMessageStore = await redis
|
||||
.get("anivmessages")
|
||||
.then((a) => (a === null ? {} : JSON.parse(a)));
|
||||
|
||||
15
src/pointRedeems/dectalk.ts
Normal file
15
src/pointRedeems/dectalk.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { sendMessage } from "lib/commandUtils";
|
||||
import PointRedeem from "pointRedeems";
|
||||
import { playDecTalk } from "web/alerts/serverFunctions";
|
||||
|
||||
export default new PointRedeem({
|
||||
name: "dectalk",
|
||||
cost: 25000,
|
||||
title: "Dectalk TTS",
|
||||
input: true,
|
||||
prompt: "I HECKIN LOVE DECTALK TTS!!!",
|
||||
async execution(msg) {
|
||||
await playDecTalk(msg.input);
|
||||
await sendMessage("LETSGO SUFFERING LETSGO");
|
||||
},
|
||||
});
|
||||
@@ -6,4 +6,9 @@ export type MSTTS = {
|
||||
speed: string;
|
||||
};
|
||||
|
||||
export type TTS = MSTTS;
|
||||
export type DecTalk = {
|
||||
type: "dectalk";
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type TTS = MSTTS | DecTalk;
|
||||
|
||||
@@ -12,14 +12,14 @@ export async function playAlert(alert: alert) {
|
||||
});
|
||||
}
|
||||
|
||||
type TTSOptions = {
|
||||
type MSTTSOptions = {
|
||||
text: string;
|
||||
voice?: string;
|
||||
pitch?: number;
|
||||
speed?: number;
|
||||
};
|
||||
|
||||
export async function playTTS(options: TTSOptions) {
|
||||
export async function playMSTTS(options: MSTTSOptions) {
|
||||
await sendAlertEvent({
|
||||
function: "playTTS",
|
||||
tts: {
|
||||
@@ -32,6 +32,16 @@ export async function playTTS(options: TTSOptions) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function playDecTalk(input: string) {
|
||||
await sendAlertEvent({
|
||||
function: "playTTS",
|
||||
tts: {
|
||||
type: "dectalk",
|
||||
text: input,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function stopTTS() {
|
||||
await sendAlertEvent({
|
||||
function: "cancelTTS",
|
||||
|
||||
@@ -30,6 +30,9 @@ class TTSManager {
|
||||
`https://tetyys.com/SAPI4/SAPI4?text=${tts.text}&voice=${tts.voice}&pitch=${tts.pitch}&speed=${tts.speed}`,
|
||||
);
|
||||
break;
|
||||
case "dectalk":
|
||||
await this.playAudio(`http://tts.cyzon.us/tts?text=${tts.text}`);
|
||||
break;
|
||||
}
|
||||
|
||||
const newTTS = this.ttsQueue.shift();
|
||||
|
||||
Reference in New Issue
Block a user