From faa2ef567129d608c5b0f1a4412b3f2e777f89c7 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 May 2019 01:16:35 -0400 Subject: [PATCH] +Added mentioning capability to beanshowing --- locStrings.config | 1 + src/commands/CommandBeansShow.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/locStrings.config b/locStrings.config index b5a11cc..9034ab8 100644 --- a/locStrings.config +++ b/locStrings.config @@ -19,6 +19,7 @@ CatchInfo= [CommandBeansShow] BeansShowDisplay=You have %s beans! +BeansShowMentioned=I looked it up and %sbeans! BeansShowInfo=Displays how many beans you have [CommandGuildRoleList] diff --git a/src/commands/CommandBeansShow.java b/src/commands/CommandBeansShow.java index 16d3f62..b3e2493 100644 --- a/src/commands/CommandBeansShow.java +++ b/src/commands/CommandBeansShow.java @@ -14,6 +14,16 @@ public class CommandBeansShow extends Command @Override public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { - res.Call(String.format(LocStrings.Stub("BeansShowDisplay"), user.GetBeans())); + if(input.mentions == null) + res.Call(String.format(LocStrings.Stub("BeansShowDisplay"), user.GetBeans())); + else + { + String mentionedBeans = ""; + for(KittyUser mentioned:input.mentions) + { + mentionedBeans += mentioned.name + " has " + mentioned.GetBeans() + " "; + } + res.Call(String.format(LocStrings.Stub("BeansShowMentioned"), mentionedBeans)); + } } }