Discord 動態語音機器人
written by 莊智皓 @zhihao
壹-概述
一、介紹
本款Discord 動態語音機器人可讓使用者自行開設語音頻道,緩解伺服器內語音頻道不足的問題。
二、除錯環境
語言:Python 3.9.6 64-bit
編輯器:Visual Studio Code 1.57.1
系統:Windows 10 Pro 21H1
Pip版本:21.1.3
函式庫版本:discord.py 1.7.3
三、發布版本
版本:Release 3.0.0
資料夾大小:21.9MB
運行系統:Windows
貳-部署教學
一、創建一個Discord Bot
1.前往Discord Developer PortalLink。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
他可能會要求你登入Discord,登入後會導向Discord,需要再點擊一次連結前往。
2.點擊右上方的"New Application"創建一個新的應用。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
3.輸入名稱並按下"Create"。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
4.點擊左列的"Bot"選項。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
5.點擊右邊的"Add Bot"。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
6.點及"Yes, do it!"。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
7.在"Build-A-Bot"中可以修改Bot的名稱及頭像,Bot的Token也會在這裡。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Bot的Token非常重要,有了這串Token就相當於有了Bot的完整控制權限,請務必妥善保管,不可外流,若不慎外流可按下"Regenerate"重新產生一串新的Token。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
二、邀請Discord Bot至伺服器中
1.前往Discord Developer PortalLink。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
他可能會要求你登入Discord,登入後會導向Discord,需要再點擊一次連結前往。
2.點擊左列的"OAuth2"選項。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
3.向下滑至"OAuth2 URL Generator"
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
4.在"Scopes"中勾選"bot"選項。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
5.在下方"Bot Permissions"選取Bot所需的權限,若不知道要選什麼,則選擇"Administrator"即可。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
6.回到上方的"Scopes"中複製產生出來的網址,並於一個新的頁籤中貼上。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
7.點擊授權並通過驗證後即可在伺服器中看到Bot已加入。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
三、配置文件並啟動
1.下載並解壓縮後,資料夾中會有一個CCH Discord Dynamic Voice Channel Bot.exe
,雙擊執行。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
2.執行後會出現配置引導,依照指示輸入即可。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
3.配置完成後若欲更改設置,可修改或直接刪除資料夾內的config.json
。
※設定嵌入訊息顏色時請將HEX色碼(16進制)轉為DECIMAL色碼(10進制),如00ff40
應轉為65344
四、其他說明
1.配置說明
Token
:2-1-7所取得的Token。
頻道ID
:將"Discord個人設定>進階>開發者模式"開啟後,對著頻道按右鍵就會出現"複製ID"。
身分組ID
:將開發者模式打開後,在"伺服器設定>身分組",對著身分組按右鍵也會出現"複製ID"。
2.指令說明
在指令頻道輸入<你設定的前綴> + help
(例:!help
)會顯示所有指令。
參-下載
一、發布版下載
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
二、源代碼下載
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
肆-聯絡開發者及其他
Discord:ΥΕΕ#1899
Mail:xd0931021@gmail.com
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
請將信件標註為重要郵件我才看得到。
開發日誌:
最後編輯:2021/7/16 下午02:12莊智皓