mirror of
https://github.com/thelounge/thelounge.git
synced 2026-03-14 14:35:50 +01:00
add cleartopic command
Fixes: https://github.com/thelounge/thelounge/issues/4687
This commit is contained in:
parent
3d8e96491b
commit
91fb1ee343
3 changed files with 17 additions and 1 deletions
|
|
@ -793,6 +793,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-item">
|
||||
<div class="subject">
|
||||
<code>/cleartopic</code>
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>Clear the topic in the current channel.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-item">
|
||||
<div class="subject">
|
||||
<code>/unban nick</code>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
2
server/types/modules/irc-framework.d.ts
vendored
2
server/types/modules/irc-framework.d.ts
vendored
|
|
@ -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<string>): void;
|
||||
|
||||
ctcpResponse(target: string, type: string, ...params: Array<string>): void;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue