Giter Site home page Giter Site logo

discord-send-message's Introduction

Discordにログインしてメッセージを残すツール(笑)

私が関わる業務では、メッセージツールにDiscordをよく利用します。
メッセージのやり取りでは、始業or就業の挨拶をするのですが、挨拶を自動化できるかな?と思いchromedpを利用して試してみました。
私の手元環境はMacなので、他のOSでは動かないかもしれないので、その辺はご注意ください。

内容

chromedpというChromeを操作するパッケージを利用して、DiscordのWebサイトにログインして、対象のチャンネルにメッセージを残すことができるツールです。
しょうもないツールなので、遊び程度にいじってもらえればと思います(笑)

makeコマンドについて

makeコマンドに必要な操作をまとめています。
以下の順番でコマンドを実行してください。

1. setup

以下コマンドで、必要なディレクトリとファイルを作成します。
実行するとconfig.yamlファイルが生成されるので、Discordのアカウント設定などをしてください。

make setup

2. build

実行ファイルをビルドします(for Mac)
実行するとappファイルが作成されます。

make build

config.yamlについて

make setup で作成されたconfig.yamlファイルには、ログインするDisocrdのアカウント情報や、メッセージ送信のデフォルト設定を行います。

# ログインするDiscordアカウント設定
account:
  email: 'アカウントメールアドレス'
  password: 'アカウントパスワード'

# メッセージ送信の対象となるサーバーやチャンネルなどのデフォルト設定
default:
  server: 'メッセージ送信対象のサーバー名'
  channel: 'serverで指定したサーバーにある送信対象のチャンネル名'
  message: 'デフォルトメッセージ'

ビルドファイルの実行方法について

make build で作成されたappを実行することで、config.yamlに設定したアカウントでメッセージを自動的に送信します。
appを実行する際には、オプションで送信対象チャンネルやメッセージ内容を指定できます。

./app -message="メッセージ内容" -server="対象サーバー名" -channel="対象チャンネル名"

注釈! オプション設定しないければ、config.yamlのデフォルト設定が適用されます

注意

DiscordのWebアプリのレイアウトなどに変更があれば使えなくなりますので、その辺注意してください。
あと大事なことですが、Webサイトの負荷になるような使い方はしないでください。

discord-send-message's People

Contributors

hayama-kei avatar takemo101 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.