fix(bot.py, dota.py): 修复 opendota 接口返回时间太长导致 discord 报错的问题;修改 Match.party_size 为 nullable

修复 opendota 接口返回时间太长导致 discord 报错的问题;修改 Match.party_size 为 nullable

Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
Ching 2023-10-03 22:53:09 +08:00
parent a8825db196
commit 0f4f29332c
2 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@ async def send_message(channel):
@bot.command(description="获取最近战绩", name='recent_matches') # this decorator makes a slash command
async def get_friends_recent_matches(ctx, name, match_count=5): # a slash command will be created with the name "ping"
await ctx.defer()
logger.info(f"get_friends_recent_matches {name} {match_count}")
friends = dota.Friend.filter(name=name)
match_count = int(match_count)

View File

@ -49,7 +49,7 @@ class Match(BaseModel):
start_time = peewee.DateTimeField()
duration = peewee.IntegerField()
radiant_win = peewee.BooleanField()
party_size = peewee.IntegerField()
party_size = peewee.IntegerField(null=True)
def serialize_match(self):
try: