LoginSignup
3
1

More than 1 year has passed since last update.

【Twitcasting】気になるあの配信者の配信開始通知をdiscordに送信方法を考えて実装してみた。

Last updated at Posted at 2022-01-25

はじめに

趣味で推しの子がよくツイキャスするけど通知に気づけないからdiscordに投げるBotを作りました。
言語はPythonで書いてます。
記事の内容はほぼGitHubにあるものと同じです。メモ程度です。

実際の稼働してる様子はこんな感じ。
image.png
では,導入していきましょう。

実行環境

・Windows10
・Python 3.10

pytwitcastingを使用するのでインストール

pip install pytwitcasting

自動更新のためにscheduleを使うのでインストール

pip install schedule

入れ方

とりあえず,GitHubにあげてあります。
ダウンロードしてきましょう。

ツイキャスアプリケーション登録ページでAPIを発行

1.アプリケーション登録ページで登録。
2.後で使うのでClientID,ClientSecretをメモしておくか設定のconfig.pyに記載しておく。

ダウンロード出来たらconfg.pyを編集して指定された値を入力します。

#twicas
client_id = '***'
client_secret = '***'
user_id = '***'
webhookurl = '***'
calltime = 10 #ループの時間(分)

最後にmain.pyを実行すれば…
たぶん動きます。

参考資料

APIv2ドキュメント
ツイキャス-デペロッパー

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1