diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts
index fb171874..bd1eb715 100644
--- a/src/app/hooks/useCommands.ts
+++ b/src/app/hooks/useCommands.ts
@@ -34,6 +34,8 @@ import { parsePronounsInput } from '$utils/pronouns';
import { useRoomNavigate } from './useRoomNavigate';
import { enrichWidgetUrl } from './useRoomWidgets';
import { useUserProfile } from './useUserProfile';
+import { escapeHTML } from '$utils/transformation';
+import { use } from 'i18next';
export const SHRUG = '¯\\_(ツ)_/¯';
export const TABLEFLIP = '(╯°□°)╯︵ ┻━┻';
@@ -241,6 +243,9 @@ export enum Command {
SetExt = 'setext',
DelExt = 'delext',
DiscardSession = 'discardsession',
+ // Cute Events
+ Hug = 'hug',
+ Cuddle = 'cuddle',
}
export type CommandContent = {
@@ -1295,6 +1300,41 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
}
},
},
+ // Cute Events
+ [Command.Hug]: {
+ name: Command.Hug,
+ description: 'Send a hug to someone. Example: /hug [@user:example.org]',
+ exe: async (payload) => {
+ const target = payload.trim();
+ await mx.sendMessage(room.roomId, {
+ msgtype: 'im.fluffychat.cute_event',
+ 'm.mentions': {
+ user_ids: target ? [target] : [],
+ },
+ cute_type: 'hug',
+ body: `🤗`,
+ format: 'org.matrix.custom.html',
+ formatted_body: `hugs ${escapeHTML(target) ?? 'you'}`,
+ } as any);
+ },
+ },
+ [Command.Cuddle]: {
+ name: Command.Cuddle,
+ description: 'Send a cuddle to someone. Example: /cuddle [@user:example.org]',
+ exe: async (payload) => {
+ const target = payload.trim();
+ await mx.sendMessage(room.roomId, {
+ msgtype: 'im.fluffychat.cute_event',
+ cute_type: 'cuddle',
+ 'm.mentions': {
+ user_ids: target ? [target] : [],
+ },
+ body: `😊`,
+ format: 'org.matrix.custom.html',
+ formatted_body: `cuddles ${escapeHTML(target) ?? 'you'}`,
+ } as any);
+ },
+ },
}),
[mx, navigateRoom, room, profile.displayName, profile.avatarUrl, developerTools]
);