yarakigit / discord_send_file

Discordにファイルを送るシェルスクリプト

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discordにファイルを送るシェルスクリプト

  • 環境

    • macOS Monterey
    • zsh
  • セットアップ

    • 依存ライブラリのインストール
      • jq
        $ brew install jq
      • 本リポジトリをクローン
        • discord.shを使用
          • zshだとshoptコマンドが使えなかったので該当箇所をコメントアウトした
          $ git clone https://github.com/yarakigit/discord_send_file.git ~/.discord_send_file
      • ファイルを送りたいDicordのチャンネルのWebhook URLを取得, settings.jsonwebhook_urlの欄に記載する
        • スクリプトを任意のディレクトリに配置する際はscript_pathも変更
          {
          "webhook_url":"Your Webhook URL",
          "script_path":"$HOME/.discord_send_file"
          }
      • エイリアスを設定 (~/.zshrcに下記の1行を追加)
        • 上記のscript_pathを変更した場合は適宜読み替えてください
        alias discord_send_file='zsh $HOME/.discord_send_file/script.sh'
  • 実行

    • 第一引数 : 送信するファイル (相対パスでも可)
    • 第二引数 : 送信するファイルの説名
      $ discord_send_file README.md "README.md を添付します" 
  • Reference

About

Discordにファイルを送るシェルスクリプト

License:MIT License


Languages

Language:Shell 100.0%