Skip to content

Commit 072ca87

Browse files
committed
Add Meow Command
This is a very important command that must be in the bot by decree of the feline overlords.
1 parent 5e15637 commit 072ca87

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

.changeset/lucky-papers-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"draupnir": patch
3+
---
4+
5+
Add meow command as ordered by decree from the feline overlords

apps/draupnir/src/commands/DraupnirCommands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
} from "./WatchUnwatchCommand";
5454
import { DraupnirTopLevelCommands } from "./DraupnirCommandTable";
5555
import { DraupnirSafeModeCommand } from "./SafeModeCommand";
56+
import { DraupnirMeowCommand } from "./MeowCommand";
5657
import { DraupnirProtectionsShowCommand } from "./ProtectionsShowCommand";
5758
import { DraupnirProtectionsCapabilityCommand } from "./ProtectionsCapabilitiesCommand";
5859
import { JoinWaveCommandTable } from "../protections/JoinWaveShortCircuit";
@@ -126,6 +127,7 @@ const DraupnirCommands = new StandardCommandTable("draupnir")
126127
"members",
127128
])
128129
.internCommand(DraupnirSafeModeCommand, ["safe", "mode"])
130+
.internCommand(DraupnirMeowCommand, ["meow"])
129131
.internCommand(DraupnirDisplaynameCommand, ["displayname"])
130132
.internCommand(DraupnirSetPowerLevelCommand, ["powerlevel"])
131133
.internCommand(DraupnirStatusCommand, ["status"])
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
3+
import { describeCommand } from "@the-draupnir-project/interface-manager";
4+
import { Draupnir } from "../Draupnir";
5+
import { Ok, Result } from "@gnuxie/typescript-result";
6+
import { DraupnirInterfaceAdaptor } from "./DraupnirCommandPrerequisites";
7+
8+
export const DraupnirMeowCommand = describeCommand({
9+
summary: "The bot responds with Meow.",
10+
parameters: [],
11+
async executor(draupnir: Draupnir): Promise<Result<void>> {
12+
await draupnir.client.sendMessage(draupnir.managementRoomID, {
13+
msgtype: "m.text",
14+
body: "Meow",
15+
});
16+
return Ok(undefined);
17+
},
18+
});
19+
20+
DraupnirInterfaceAdaptor.describeRenderer(DraupnirMeowCommand, {
21+
isAlwaysSupposedToUseDefaultRenderer: true,
22+
});

0 commit comments

Comments
 (0)