diff --git a/client/components/Windows/Help.vue b/client/components/Windows/Help.vue index d0715a2e..e10adf41 100644 --- a/client/components/Windows/Help.vue +++ b/client/components/Windows/Help.vue @@ -793,6 +793,15 @@ +
+
+ /cleartopic +
+
+

Clear the topic in the current channel.

+
+
+
/unban nick diff --git a/server/plugins/inputs/topic.ts b/server/plugins/inputs/topic.ts index 15a1be4e..9b890ac2 100644 --- a/server/plugins/inputs/topic.ts +++ b/server/plugins/inputs/topic.ts @@ -4,7 +4,7 @@ import Msg from "../../models/msg"; import {MessageType} from "../../../shared/types/msg"; import {ChanType} from "../../../shared/types/chan"; -const commands = ["topic"]; +const commands = ["topic", "cleartopic"]; const input: PluginInputHandler = function ({irc}, chan, cmd, args) { if (chan.type !== ChanType.CHANNEL) { @@ -19,6 +19,11 @@ const input: PluginInputHandler = function ({irc}, chan, cmd, args) { return; } + if (cmd === "cleartopic") { + irc.clearTopic(chan.name); + return; + } + const cleanArgs = args.map((s) => s.trim()).filter((s) => s !== ""); if (cleanArgs.length === 0) { diff --git a/server/types/modules/irc-framework.d.ts b/server/types/modules/irc-framework.d.ts index ef9f82df..2e8062af 100644 --- a/server/types/modules/irc-framework.d.ts +++ b/server/types/modules/irc-framework.d.ts @@ -206,6 +206,8 @@ declare module "irc-framework" { setTopic(channel: string, newTopic: string): void; + clearTopic(channel: string): void; + ctcpRequest(target: string, type: string, ...params: Array): void; ctcpResponse(target: string, type: string, ...params: Array): void;