RaphielGang / Telegram-Paperplane

The Paperplane userbot project - a Telegram userbot helping to improve your Telegram experience. https://t.me/tgpaperplane
Other
289 stars 1.06k forks source link

android: Fix .device and .codename commands #240

Closed yshalsager closed 4 years ago

yshalsager commented 4 years ago

https://github.com/RaphielGang/Telegram-Paperplane/issues/236

Signed-off-by: yshalsager ysh-alsager@hotmail.com

zakaryan2004 commented 4 years ago

I'll test it and merge.

zakaryan2004 commented 4 years ago

The codename command does not work,

Example: .codename Xiaomi Redmi Note 7 Returns this error: File "./userbot/modules/android.py", line 79, in codename_info results = [i for i in devices if i["name"].lower() == device.lower() or i["model"] == device.lower()] TypeError: 'NoneType' object is not iterable

zakaryan2004 commented 4 years ago

Even though the latest commit fixes issues for devices in the JSON file, there are a lot of devices missing there, including popular ones such as lavender(even though violet isn't missing). This command should use a reliable and up-to-date source for fetching data.

yshalsager commented 4 years ago

@zakaryan2004 it's using Google data. You must write the full correct info in order to get what expect.

yshalsager commented 4 years ago

If you want to improve searching method feel free.

zakaryan2004 commented 4 years ago

Well OK I get there isn't much which can be done, but this data set is really confusing. For example, lavender is in the Redmi brand as it turns out, but violet isn't. And for most of the devices in the Redmi brand, you need to actually type .codename redmi redmi note 7, which makes the commands even more confusing.