From 34923ddabea4833edc0f24ebc4cb455a2d8efee0 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Fri, 26 Feb 2021 06:45:50 +0100 Subject: [PATCH] MEONLY: fix and simplify --- commands.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commands.sh b/commands.sh index f6d45a0..e390cd6 100644 --- a/commands.sh +++ b/commands.sh @@ -15,7 +15,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v1.45-dev-9-g62b6b61 +#### $$VERSION$$ v1.45-dev-49-g2131911 # # bashbot locale defaults to c.UTF-8, adjust locale in mycommands.sh if needed @@ -96,10 +96,9 @@ if [ -z "$1" ] || [[ "$1" == *"debug"* ]];then ################### # if is bashbot is group admin it get commands sent to other bots # set MEONLY=1 to ignore commands for other bots - if [[ "${MEONLY}" != "0" && "${MESSAGE}" == "/"* && "${MESSAGE%% *}" == *"@"* ]]; then + if [[ "${MEONLY}" != "0" && "${MESSAGE}" == "/"*"@"* ]]; then # here we have a command with @xyz_bot added, check if it's our bot - MYCHECK="${MESSAGE%% *}" - [ "${MYCHECK}" != "${MYCHECK%%@${ME}}" ] && return + [ "${MESSAGE%%@*}" != "${MESSAGE%%@${ME}}" ] && return fi ###################