mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 13:36:58 +01:00
add personalized welcome messages (untested SMILERS)
This commit is contained in:
@@ -5,16 +5,23 @@ import { streamerId } from "main";
|
||||
import { sendDiscordMessage } from "web/discordConnection";
|
||||
|
||||
eventSub.onStreamOnline(streamerId, async (msg) => {
|
||||
await redis.set("streamIsLive", "1");
|
||||
await sendMessage(
|
||||
`${msg.broadcasterDisplayName.toUpperCase()} IS LIVE! START DIGGING!`,
|
||||
);
|
||||
await sendDiscordMessage({ message: "live" });
|
||||
await Promise.all([
|
||||
redis.set("streamIsLive", "1"),
|
||||
sendMessage(
|
||||
`${msg.broadcasterDisplayName.toUpperCase()} IS LIVE! START DIGGING!`,
|
||||
),
|
||||
sendDiscordMessage({ message: "live" }),
|
||||
redis
|
||||
.keys("user:*:haschattedthisstream")
|
||||
.then((a) => a.map(async (b) => await redis.del(b))),
|
||||
]);
|
||||
});
|
||||
|
||||
eventSub.onStreamOffline(streamerId, async (msg) => {
|
||||
await redis.del("streamIsLive");
|
||||
await sendMessage(
|
||||
`${msg.broadcasterDisplayName.toUpperCase()} IS OFFLINE! NO MORE FREE LOOT!`,
|
||||
);
|
||||
await Promise.all([
|
||||
redis.del("streamIsLive"),
|
||||
sendMessage(
|
||||
`${msg.broadcasterDisplayName.toUpperCase()} IS OFFLINE! NO MORE FREE LOOT!`,
|
||||
),
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user