--- title: Discord bot with HackMD description: The Discord bot with HackMD-API tags: HackMD-Theme, HackMD-API, Discord-API author: Mirai --- # Discord Integration | Discord 整合 |Suggested by|Description|HackMD Profile |--|--|--| 未來|Discord| [@Mirai1129](https://hackmd.io/@Mirai1129) ## Introduce 把 Discord bot 結合 HackMD API,藉由 Discord bot 查詢自己的使用者資料,在未來希望能夠直接利用機器人寫筆記。 ## Requirements - Requests 套件 ```bash python -m pip install requests ``` - Discord package 1. [Pycord](https://docs.pycord.dev/en/stable/) or 2. [Nextcord](https://docs.nextcord.dev/en/stable/) 範例機器人:[我用 Nextcord 簡單做的機器人](https://github.com/Mirai1129/DIscord-bot)。 ## Usage 建立一個 `.env` 檔,範例如下: ```env DISCIRD_TOKEN = YOUR DISCORD TOKEN HACKMD_TOKEN = YOUR HACKMD TOKEN ``` 建議把機器人指令部分改為 ***Slash command***,以便跟上 Discord 的整合化。 ## 參考資料 - [HackMD API Documentation](https://hackmd.io/@hackmd-api/developer-portal) - [HackMD OpenAPI](https://documenter.getpostman.com/view/68277/UVeNmhpT#363df43e-f4c8-4c88-82ed-0ac9ec4b85cd) - [Disocrd API Documentation](https://discord.com/developers) - [Nextcord API Documentation](https://docs.nextcord.dev)
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.