From d5e21097f8781bdc1f8e57b943265a752a5db7ef Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 27 May 2021 11:22:34 +0200 Subject: [PATCH] Add /quote command Closes: https://todo.sr.ht/~emersion/gamja/22 --- commands.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/commands.js b/commands.js index 5359f69..ba6b4c6 100644 --- a/commands.js +++ b/commands.js @@ -1,3 +1,4 @@ +import * as irc from "../lib/irc.js"; import { SERVER_BUFFER, BufferType } from "./state.js"; function getActiveClient(app) { @@ -151,6 +152,19 @@ export default { app.close({ name: SERVER_BUFFER }); }, }, + "quote": { + usage: "", + description: "Send a raw IRC command to the server", + execute: (app, args) => { + var msg; + try { + msg = irc.parseMessage(args.join(" ")); + } catch (err) { + throw new Error("failed to parse IRC command: " + err.message); + } + getActiveClient(app).send(msg); + }, + }, "reconnect": { description: "Reconnect to the server", execute: (app, args) => {