mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-25 00:58:08 -05:00
parent
d34bff9ed6
commit
d5e21097f8
1 changed files with 14 additions and 0 deletions
14
commands.js
14
commands.js
|
@ -1,3 +1,4 @@
|
||||||
|
import * as irc from "../lib/irc.js";
|
||||||
import { SERVER_BUFFER, BufferType } from "./state.js";
|
import { SERVER_BUFFER, BufferType } from "./state.js";
|
||||||
|
|
||||||
function getActiveClient(app) {
|
function getActiveClient(app) {
|
||||||
|
@ -151,6 +152,19 @@ export default {
|
||||||
app.close({ name: SERVER_BUFFER });
|
app.close({ name: SERVER_BUFFER });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"quote": {
|
||||||
|
usage: "<command>",
|
||||||
|
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": {
|
"reconnect": {
|
||||||
description: "Reconnect to the server",
|
description: "Reconnect to the server",
|
||||||
execute: (app, args) => {
|
execute: (app, args) => {
|
||||||
|
|
Loading…
Reference in a new issue