mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 00:51:37 +01:00
19 lines
556 B
TypeScript
19 lines
556 B
TypeScript
import { Command, sendMessage } from "lib/commandUtils";
|
|
import { redis } from "lib/redis";
|
|
import User from "user";
|
|
|
|
export default new Command({
|
|
name: "backshot",
|
|
aliases: ["backshot"],
|
|
usertype: "chatter",
|
|
execution: async (msg, user) => {
|
|
const targets = await redis.keys(`user:*:haschatted`);
|
|
const selection = targets[Math.floor(Math.random() * targets.length)]!;
|
|
const target = await User.initUserId(selection.slice(5, -11));
|
|
await sendMessage(
|
|
`${user.displayName} backshotted ${target?.displayName}`,
|
|
msg.messageId,
|
|
);
|
|
},
|
|
});
|