Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.4%) to scientific vocabulary
Keywords
Repository
愛嬌のあるbotです。
Basic Info
Statistics
- Stars: 14
- Watchers: 6
- Forks: 3
- Open Issues: 35
- Releases: 25
Topics
Metadata Files
README.md
鳩bot - 愛嬌のあるBot
鳩botでは主に次のことができます。
- 雨雲情報 ...
amesh [text]で指定した地名・住所[text]の雨雲情報を画像で表示します。 - 最新の地震情報 ...
eqで最新の地震情報を3件表示します。 - パワーワードの登録、表示 ...
textで登録したパワーワードを表示します。 - 突然の死吹き出しで整形 ...
>< [text]で文字列[text]を「突然の死」吹き出しで整形します。

鳩botを動かす
鳩botは自分のPC上で動かすことができます。
必要なもの
鳩botを使うには以下が必要です。
- Dockerが動作するPC
- Slack API Token (Slack API Tokenの取得手順) (Slackで動かす場合のみ)
- Discord Bot Token (Discord Bot Tokenの取得手順) (Discordで動かす場合のみ)
- Misskeyアクセストークン (Misskeyアクセストークンの取得手順) (Misskeyで動かす場合のみ)
- Yahoo API Token (Yahoo API Tokenの取得手順)
- OpenAI API Key (OpenAI API Keyの取得手順)
fly.io上で動かす
- 事前にSlack API TokenとYahoo API Tokenを取得します。
- Launch a demo app · Fly Docsに記載されている手順で
flyコマンドをインストールします。 - Launch a demo app · Fly Docsに記載されている手順でfly.ioへの登録・ログインを行います。
- Dashboard · Fly内の
Billingからクレジットカードを登録します (無料枠で使用する場合も必須)。 yqコマンドのGitHubに記載されている手順でyqコマンドをインストールします。- このリポジトリをcloneします。
安定版を使う場合は -b master を指定します。最新の開発版を使う場合は指定不要です。
sh
git clone -b master https://github.com/dev-hato/hato-bot.git
cd hato-bot
.envファイルを作成しSlack API Token、PostgreSQLの認証情報、Yahoo API Tokenなどを記述します。
.env.example をコピーして使うとよいでしょう。
MODEに discord を指定すると、DiscordのBotとして動作します。
MODEに misskey を指定すると、自分のいるサーバーからのメンションに限って反応するMisskeyのBotとして動作します。
fly.tomlファイルを作成します。
fly.template.toml をコピーし、TODOコメントに従って編集すると良いでしょう。
- 次のコマンドを実行してfly.ioへのデプロイを行います。
sh ./flyio_deploy.sh
自分のPC上で動かす
自分のPCで動かすこともできます。
- 事前にSlack API TokenとYahoo API Tokenを取得します。
hadolintをインストールします。
このリポジトリをcloneします。
安定版を使う場合は -b master を指定します。最新の開発版を使う場合は指定不要です。
sh
git clone -b master https://github.com/dev-hato/hato-bot.git
cd hato-bot
または Release から最新の安定版をダウンロードして解凍します。
- 必要に応じてパッケージをインストールします。
sh
uv python install
uv sync
npm install
.envファイルを作成しSlack API Token、PostgreSQLの認証情報、Yahoo API Tokenなどを記述します。
.env.example をコピーして使うとよいでしょう
MODEに discord を指定すると、DiscordのBotとして動作します。
MODEに misskey を指定すると、自分のいるサーバーからのメンションに限って反応するMisskeyのBotとして動作します。
- Docker composeで鳩botとPostgreSQLを起動します。
sh
export TAG_NAME=$(git symbolic-ref --short HEAD | sed -e "s:/:-:g")
docker compose up -d --wait
開発時は代わりに次のコマンドを実行します。
sh
export TAG_NAME=$(git symbolic-ref --short HEAD | sed -e "s:/:-:g")
docker compose -f docker-compose.yml -f dev.base.docker-compose.yml -f dev.docker-compose.yml build
docker compose -f docker-compose.yml -f dev.base.docker-compose.yml -f dev.docker-compose.yml watch
- コードの変更はDocker composeの再起動で適用できます。
sh
export TAG_NAME=$(git symbolic-ref --short HEAD | sed -e "s:/:-:g")
docker compose restart
開発時は自動的にDockerイメージの再ビルドが行われ反映されます。
lintをかける方法
sh
npm run lint
コマンドの実行方法
- 鳩botに対しコマンドを実行したいときは
post_command.pyを使うと便利です。
sh
uv run post_command.py --channel {投稿先のチャンネルのchannel id} \
--user {自分のuser_id} \
"{hato-botのコマンド}"
- またはngrokを使うこともできます。
sh
./ngrok http 3000
コミットする前に行うこと
開発に必要なパッケージと pre-commit のインストールを行います。
sh
uv python install
uv sync --dev
uv tool run pre-commit install
補足
- コードを整形する場合は
uv tool run autopep8 --in-place --recursive .を実行します。
鳩botコマンド一覧
- 鳩botで使用可能なコマンドは次の通りです。
text
amesh ... 東京のamesh(雨雲情報)を表示する。
amesh [text] ... 指定した地名・住所・郵便番号[text]のamesh(雨雲情報)を表示する。
amesh [緯度 (float)] [経度 (float)] ... 指定した座標([緯度 (float)], [経度 (float)])のamesh(雨雲情報)を表示する。
amedas ... 東京のamedas(気象情報)を表示する。
amedas [text] ... 指定した地名・住所・郵便番号[text]のamedas(気象情報)を表示する。
amedas [緯度 (float)] [経度 (float)] ... 指定した座標([緯度 (float)], [経度 (float)])のamedas(気象情報)を表示する。
電力 ... 東京電力管内の電力使用率を表示する。
標高 ... 東京の標高を表示する。
標高 [text] ... 指定した地名・住所・郵便番号[text]の標高を表示する。
標高 [緯度 (float)] [経度 (float)] ... 指定した座標([緯度 (float)], [経度 (float)])の標高を表示する。
eq ... 最新の地震情報を3件表示する。
textlint [text] ... 文字列[text]を校正する。
text list ... パワーワード一覧を表示する。
text random ... パワーワードをひとつ、ランダムで表示する。
text show [int] ... 指定した番号[int]のパワーワードを表示する。
text add [text] ... パワーワードに[text]を登録する。
text delete [int] ... 指定した番号[int]のパワーワードを削除する。
>< [text] ... 文字列[text]を吹き出しで表示する。
にゃーん ... 「よしよし」と返す。
おみくじ ... おみくじを引いて返す。
version ... バージョン情報を表示する。
chat [text] ... ChatGPTで文章生成する。
画像生成 [text] ... openAIのImage generationで画像生成する。[text]は英語での入力推奨。
ping ... 「ping」したら「PONG」と返す。
バージョンアップによる変更点
- バージョンアップによる変更点についてはCHANGELOG を参照してください。
バグ報告や機能の要望について
バグ報告や機能追加の要望がある場合は Issues の
New Issueから報告をお願いします。プルリクエストも大歓迎です。
クレジット
Botで利用しているサービスのクレジットを記載します。
Owner
- Name: dev-hato
- Login: dev-hato
- Kind: organization
- Repositories: 15
- Profile: https://github.com/dev-hato
Citation (CITATION.cff)
authors: - given-names: "dev-hato" cff-version: "1.1.0" date-released: 2021-06-17 license: MIT message: "愛嬌のあるSlack用bot" repository-code: "https://github.com/dev-hato/hato-bot" title: "hato-bot" version: "2.1.1"
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 30
- Total pull requests: 1,931
- Average time to close issues: 10 months
- Average time to close pull requests: 1 day
- Total issue authors: 6
- Total pull request authors: 9
- Average comments per issue: 0.8
- Average comments per pull request: 0.11
- Merged pull requests: 1,224
- Bot issues: 13
- Bot pull requests: 1,761
Past Year
- Issues: 11
- Pull requests: 1,256
- Average time to close issues: about 10 hours
- Average time to close pull requests: about 20 hours
- Issue authors: 4
- Pull request authors: 8
- Average comments per issue: 0.09
- Average comments per pull request: 0.11
- Merged pull requests: 723
- Bot issues: 10
- Bot pull requests: 1,178
Top Authors
Issue Authors
- nakkaa (15)
- renovate[bot] (8)
- github-actions[bot] (3)
- dependabot[bot] (2)
- massongit (1)
- fono09 (1)
Pull Request Authors
- renovate[bot] (898)
- dev-hato-app[bot] (361)
- github-actions[bot] (316)
- dependabot[bot] (186)
- massongit (153)
- nakkaa (7)
- Goryudyuma (6)
- fono09 (3)
- Konyx (1)