Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4267 連合先からのメンションに対応 #4274

Merged
merged 7 commits into from
Sep 10, 2024
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ DATABASE_URL=postgres://postgres:password@postgres:5432/?sslmode=require
DISCORD_API_TOKEN=
MISSKEY_API_TOKEN=
MISSKEY_DOMAIN=
MISSKEY_FEDERATION=false
MODE=
OPENAI_API_KEY=
SLACK_API_TOKEN=
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
- `Removed` 削除された機能について。
- `Fixed` バグ修正について。

## Unrelease

### Added

- Misskeyモード時に、連合先からのメンションに応答するかを選べるようになりました。(#4267)

## v3.0.4

### Note
Expand Down
5 changes: 4 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ async def misskey_runner():
note = data["body"]["body"]
host = note["user"].get("host")
mentions = note.get("mentions")
# FEDERATIONがtrueならばリモートからのメンションにも応答する。
# falseならばローカルのメンションのみに応答する。
if (
host is None or host == conf.MISSKEY_DOMAIN
(conf.MISSKEY_FEDERATION == "true")
or (host is None or host == conf.MISSKEY_DOMAIN)
) and mentions:
cred = None

Expand Down
1 change: 1 addition & 0 deletions slackbot_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# Misskey用の設定
MISSKEY_DOMAIN = str(os.environ["MISSKEY_DOMAIN"])
MISSKEY_API_TOKEN = str(os.environ["MISSKEY_API_TOKEN"])
MISSKEY_FEDERATION = str(os.environ.get("MISSKEY_FEDERATION", "false"))

MODE = str(os.environ["MODE"])

Expand Down