瀏覽代碼

Merge pull request #16 from legoktm/patch-2

!stars: Fix plural if repository only has one stargazer
pull/10/merge
Ben Kurtovic 9 年之前
父節點
當前提交
d82a7bd377
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. +4
    -2
      commands/stars.py

+ 4
- 2
commands/stars.py 查看文件

@@ -43,9 +43,11 @@ class Stars(Command):
if info is None:
self.reply(data, "Repository not found. Is it private?")
else:
msg = "\x0303{0}\x0F has \x02{1}\x0F stargazers: {2}"
count = int(info["stargazers_count"])
plural = "" if count == 1 else "s"
msg = "\x0303{0}\x0F has \x02{1}\x0F stargazer{2}: {3}"
self.reply(data, msg.format(
info["full_name"], info["stargazers_count"], info["html_url"]))
info["full_name"], count, plural, info["html_url"]))

def get_repo(self, repo):
"""Return the API JSON dump for a given repository.


Loading…
取消
儲存