From 9328492a556c332715de375dad43559ec8705d23 Mon Sep 17 00:00:00 2001 From: shagbag913 Date: Sat, 4 May 2019 12:22:28 -0400 Subject: [PATCH] devices: convert user specified device into lowercase When a user specifies a device with an uppercase letter (e.g., /device Mido), it'll tell the user that the device Mido isn't official, since none of our devices have uppercase letters in the json. To fix this and avoid confusion, convert the specified device to lowercase. Signed-off-by: shagbag913 --- tg_bot/modules/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tg_bot/modules/device.py b/tg_bot/modules/device.py index d6f2c93f..0ddfacba 100644 --- a/tg_bot/modules/device.py +++ b/tg_bot/modules/device.py @@ -16,7 +16,7 @@ def device(bot: Bot, update: Update): data = json.loads(url.read().decode()) message = update.effective_message - text = message.text[len('/device '):].strip() + text = message.text[len('/device '):].strip().lower() try: deviceinfo = data[text] except: