瀏覽代碼

Fix !registration on birthdays.

tags/v0.2
Ben Kurtovic 9 年之前
父節點
當前提交
1bde44b438
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      earwigbot/commands/registration.py

+ 1
- 1
earwigbot/commands/registration.py 查看文件

@@ -69,7 +69,7 @@ class Registration(Command):
msg.append("{0} {1}".format(num, unit if num == 1 else unit + "s"))

now = datetime.utcnow()
bd_passed = (now.month, now.day) < (birth.month, birth.day)
bd_passed = now.timetuple()[1:-3] < birth.timetuple()[1:-3]
years = now.year - birth.year - bd_passed
delta = now - birth.replace(year=birth.year + years)
insert("year", years)


Loading…
取消
儲存