Special characters handling

* Fix README for python version
* Add discord-friendly unidecode function for channel names (avoiding
  special characted)
* Check if "items" is present before accessing in channel id request
  response
This commit is contained in:
BreadTube 2026-02-03 01:30:41 +09:00
commit d015927861
10 changed files with 315 additions and 13 deletions

14
tests/test_unidecode.py Normal file
View file

@ -0,0 +1,14 @@
from breadtube_bot.unidecode import unidecode
def test_unidecode():
test_data = [
('éêçà', 'eeca'),
('あいうえお', 'aiueo'),
('アイウエオ', 'aiueo'),
('ČŽŠčžš', 'czsczs'),
('?! .,<', '______'),
]
for data, expected in test_data:
result = unidecode(data)
assert result == expected, f'Wrong result for "{data}": got "{result}", expected "{expected}"'