Coder Social home page Coder Social logo

discord-yt-sub-count's Introduction

YT訂閱數通知Discord機器人 (開發中,README等待Release才更新)

GitHub release (latest by date) GitHub last commit GitHub pull requests GitHub issues GitHub

hackmd-github-sync-badge

演示預覽

查看訂閱數,及設定通知頻道

訂閱數通知

當Call Youtube Data API v3 後訂閱數有更新時,會在通知頻道顯示以下訊息

目錄

安裝

Node.js v16.11 UP - https://nodejs.org/en/

Git - https://git-scm.com/downloads

安裝方法

git init
git clone https://github.com/Yue030/discord-yt-sub-count.git

OR

點選 Code -> Download ZIP

配置檔案

config.json

{
    "token": "",
    "prefix": "",
    "yt-channel-id": ""
}

token

Discord機器人token

prefix

指令前綴

yt-channel-id

欲查詢訂閱數的頻道

獲取機器人token

請開啟 Discord Developer Portal 並點選右上角的New Application

輸入Application名稱 (不影響機器人名稱),並點選Create

點選左側Bot

並按下Add Bot

進入到此頁面,你可以在這個時候更改機器人的頭貼及名稱

點選 Token 區塊的 Copy

將複製下來的token在config.json的token屬性的""中貼上

獲取Google API Key

Google Cloud Platform 建立一個專案

建立過後,打開左邊的選單

找到API和服務,並點選憑證

點選上方 建立憑證 - API金鑰

將獲取到的API金鑰複製起來

將複製下來的金鑰在config.json的google-api-key屬性的""中貼上

Prefix 自訂義

更改config.json的prefix屬性

若設置為 "!"

輸入指令時必須輸入

!count
!set #(頻道名稱)

才會有效果

若設置為 "M$"

則輸入指令格式為輸入

M$count
M$set #(頻道名稱)

欲查詢頻道設置

請打開您這個DD仔推的Vtuber的頻道

並在網址處複製頻道ID

若顯示的是頻道名稱

請點一部影片,再點頭像,才可以看到ID

將複製下來的頻道ID在config.json的yt-channel-id屬性的""中貼上

由於目前設定關係,不好意思

我們只支援單推

若您堅持DD,請另外設置機器人,並重複上述所有操作

貼心提醒: Google API Key 不可重複使用

邀請機器人

回到 Discord Developer Portal 並點選剛剛創建的Application 點擊OAuth2

到OAuth2 URL Generator區塊,並點選bot選項

並在下方的BOT PERMISSIONS開啟Adminstrator權限

複製下方連結

並在瀏覽器貼上此連結,選取伺服器後,按下繼續

按下授權

機器人將會進到指定的群組

啟動機器人

開啟命令提示字元(cmd)並切換到機器人檔案的資料夾

輸入

npm install
npm start

即可執行

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.