From f00be486b00fba4c339b6a8a40ab0fdf1025eccd Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sun, 22 Nov 2015 21:51:36 +0000 Subject: [PATCH] Add .whoami command --- spades.awk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spades.awk b/spades.awk index d605075..1818bbd 100644 --- a/spades.awk +++ b/spades.awk @@ -663,6 +663,15 @@ match($0, /^\.newgame ?([1-9][0-9]*) *- *([1-9][0-9]*)$/, _arr) { } } +/^\.whoami/ { + if (!(sp_from in sp_players)) + reply("You are not playing") + else if (sp_from == FROM) + say(FROM " has an existential crisis") + else + reply("You are playing for " sp_from); +} + /^\.notify$/ { if (sp_from in sp_notify) reply("Your address is " sp_notify[sp_from]) -- 2.43.2