From 43547ff05066ba662a5a57c284a89c823a47a1db Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Sat, 27 Oct 2018 18:11:43 -0400 Subject: [PATCH] Strip emoji from inbound minecraft messages --- webhook-bridge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webhook-bridge.py b/webhook-bridge.py index 2849895..3bcf447 100755 --- a/webhook-bridge.py +++ b/webhook-bridge.py @@ -265,7 +265,7 @@ def main(): player_uuid = mc_username_to_uuid(username) logging.info("Username: {} Message: {}".format(username, message)) # Ghetto fix for sanitizing chat messages until Issue #4 is resolved. - message = message.replace("@", "@\N{zero width space}") + message = remove_emoji(message.replace("@", "@\N{zero width space}")) webhook_payload = {'username': username, 'avatar_url': "https://visage.surgeplay.com/face/160/{}".format(player_uuid), 'content': '{}'.format(message)} post = requests.post(WEBHOOK_URL,json=webhook_payload)