mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 15:26:58 +01:00
add personalized welcome messages (untested SMILERS)
This commit is contained in:
26
src/pointRedeems/welcomemessageset.ts
Normal file
26
src/pointRedeems/welcomemessageset.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import PointRedeem from "pointRedeems";
|
||||
import { sendMessage } from "lib/commandUtils";
|
||||
import { redis } from "lib/redis";
|
||||
|
||||
export default new PointRedeem({
|
||||
name: "setwelcomemsg",
|
||||
cost: 15000,
|
||||
title: "Set welcome message",
|
||||
input: true,
|
||||
color: "#0099FF",
|
||||
prompt:
|
||||
"Set your welcome message (echoed once per stream). Character limit is 200",
|
||||
async execution(msg) {
|
||||
if (msg.input.length > 200) {
|
||||
await sendMessage(`Your desired welcome message is too long`);
|
||||
if (process.env.NODE_ENV === "production")
|
||||
await msg.updateStatus("CANCELED");
|
||||
}
|
||||
await Promise.all([
|
||||
sendMessage(
|
||||
`${msg.userDisplayName} successfully set their new welcome message`,
|
||||
),
|
||||
redis.set(`user:${msg.userId}:welcomemessagetext`, "1"),
|
||||
]);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user