commit 408939b

Vlad-Stefan Harbuz  ·  2022-09-21 09:20:07 +0000 UTC
parent 54ee468
add /shrug command

Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
2 files changed,  +12, -0
+9, -0
 1@@ -204,6 +204,10 @@ func init() {
 2 			Desc:      "searches messages in a target",
 3 			Handle:    commandDoSearch,
 4 		},
 5+		"SHRUG": {
 6+			Desc:   "send a shrug to the current channel ¯\\_(ツ)_/¯",
 7+			Handle: commandDoShrug,
 8+		},
 9 	}
10 }
11 
12@@ -767,6 +771,11 @@ func commandSendMessage(app *App, target string, content string) error {
13 	return nil
14 }
15 
16+func commandDoShrug(app *App, args []string) (err error) {
17+	_, buffer := app.win.CurrentBuffer()
18+	return commandSendMessage(app, buffer, `¯\_(ツ)_/¯`)
19+}
20+
21 func (app *App) handleInput(buffer, content string) error {
22 	if content == "" {
23 		return nil
+3, -0
 1@@ -200,6 +200,9 @@ _name_ is matched case-insensitively.  It can be one of the following:
 2 	Search messages matching the given text, in the current channel or server.
 3 	This opens a temporary list, which can be closed with the escape key.
 4 
 5+*SHRUG*
 6+	Send a shrug to the current channel. ¯\\\_(ツ)\_/¯
 7+
 8 # SEE ALSO
 9 
10 *senpai*(5)