mirror of
https://github.com/thelounge/thelounge
synced 2025-02-16 21:28:23 +00:00
30 lines
581 B
TypeScript
30 lines
581 B
TypeScript
import {PluginInputHandler} from "./index";
|
|
|
|
import Msg from "../../models/msg";
|
|
import {MessageType} from "../../../shared/types/msg";
|
|
import {ChanType} from "../../../shared/types/chan";
|
|
|
|
const commands = ["cycle", "rejoin"];
|
|
|
|
const input: PluginInputHandler = function ({irc}, chan) {
|
|
if (chan.type !== ChanType.CHANNEL) {
|
|
chan.pushMessage(
|
|
this,
|
|
new Msg({
|
|
type: MessageType.ERROR,
|
|
text: "You can only rejoin channels.",
|
|
})
|
|
);
|
|
return;
|
|
}
|
|
|
|
irc.part(chan.name, "Rejoining");
|
|
irc.join(chan.name);
|
|
|
|
return true;
|
|
};
|
|
|
|
export default {
|
|
commands,
|
|
input,
|
|
};
|