mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-01-13 13:50:10 +08:00
数据库头像URL类型改成VARCHAR
This commit is contained in:
parent
c66a47c3e5
commit
3808609963
16
api/chat.py
16
api/chat.py
@ -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] = {}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user