diff --git a/README.md b/README.md
index 3b32d99..5888987 100644
--- a/README.md
+++ b/README.md
@@ -30,8 +30,8 @@ You need a Telegram bot token, create a Telegram bot with
URL", "Content Type" (must be `application/json`) and "Secret". You can also
do this after start running the project.
2. Copy `config_sample.json` to `config.json` to configure it. `chat_id` can be
- user/group/channel id (integer) or username (string), make sure the bot is
- `/start`ed or member of the chat with permission to send messages
+ user id or group/channel id/username, make sure the bot is `/start`ed or
+ member of the chat with permission to send messages
3. Configure reverse proxy for this app, corresponding configuration for Nginx
looks like this
```
diff --git a/utils/github_webhook.py b/utils/github_webhook.py
index 7de7206..82889a0 100644
--- a/utils/github_webhook.py
+++ b/utils/github_webhook.py
@@ -130,12 +130,8 @@ async def _format_issues(payload: dict) -> str:
)
-async def _format_ping(payload: dict) -> str:
- repository = payload['repository']
- return "\u2192 {name}".format(
- url=repository['html_url'],
- name=repository['full_name']
- )
+async def _format_ping(_: dict) -> None:
+ return None
async def _format_public(payload: dict) -> str:
@@ -181,15 +177,14 @@ async def _format_star(payload: dict) -> str:
async def _get_event_title(event: str, payload: dict) -> str:
+ name = (payload.get('repository', {}).get('full_name')
+ or payload.get('organization', {}).get('login'))
summary = [payload['sender']['login']]
# if action := payload.get('action'): summary.append(action)
action = payload.get('action')
summary.append(action) if action else []
summary.append(event)
- return "{name} | {summary}".format(
- name=payload['repository']['full_name'],
- summary=" ".join(summary)
- )
+ return f"{name} | {' '.join(summary)}"
async def _get_repo_star_and_fork(repo: dict) -> str: