数据库头像URL类型改成VARCHAR

This commit is contained in:
John Smith 2020-09-12 11:33:11 +08:00
parent c66a47c3e5
commit 3808609963
2 changed files with 12 additions and 6 deletions

View File

@ -246,13 +246,10 @@ class Room(blivedm.BLiveClient):
return
self.send_message_if(
lambda client: client.auto_translate,
Command.UPDATE_TRANSLATION,
[
# 0: id
Command.UPDATE_TRANSLATION, make_translation_message(
msg_id,
# 1: translation
translation
]
)
)
@ -289,6 +286,15 @@ def make_text_message(avatar_url, timestamp, author_name, author_type, content,
]
def make_translation_message(msg_id, translation):
return [
# 0: id
msg_id,
# 1: translation
translation
]
class RoomManager:
def __init__(self):
self._rooms: Dict[int, Room] = {}

View File

@ -200,5 +200,5 @@ def _update_avatar_cache_in_database(user_id, avatar_url):
class BilibiliUser(models.database.OrmBase):
__tablename__ = 'bilibili_users'
uid = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
avatar_url = sqlalchemy.Column(sqlalchemy.Text)
avatar_url = sqlalchemy.Column(sqlalchemy.String(100))
update_time = sqlalchemy.Column(sqlalchemy.DateTime)