Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
他のライバーに対応させる際にメインの関数を触らないように、チャンネルID, アラーム音のパス, アイコン画像のパスなどの設定データを.envファイルに移動させましたぺこ。
他のライバー対応予定なければリジェクトして頂いて構いません。
変更箇所と内容
.env (new)
チャンネルID, アセットのパスがある環境ファイルです。
mikochiku_alarm.py
settings.py
をimportし、チャンネルID等をsettings
から参照するようにしています。こちらのフォーマッターが勝手に改行してしまい変更箇所増えてますが、濃くハイライトされて部分のみ変更点です。
requirements.txt
私の環境で
pip freeze
したときに自動生成されました。もし不具合等出ましたら、さいとう様の環境で
pip freeze > requirements.txt
していただくと大丈夫かと思います。settings.py (new)
起動時に
mikochiku_alarm.py
から呼ばれ、.env
のデータを読み込みます。注意点
通常
.env
ファイルはセキュアな内容を書き込むものなので、.gitignore
で弾かれることが多いのでgitignoreに登録しないように注意してくださいぺこ。