--- title: "【Discord】如何推播 Twitter 推文到 Discord 特定頻道" tags: Discord description: "即時轉貼 Twitter 文章至 Discord 的特定頻道內" image: --- {%hackmd @f6bfb5/biKBG-dnSQajGm3NZj38Fg %}   - [總覽](/s/1lhI9SqjRzepld5qyOMHKw) :::danger [Updates to IFTTT free tier - IFTTT](https://ifttt.com/explore/updates-to-free-tier-2023) 20230523 起 IFTTT 免費用戶將只能新增兩個來源連結, 且無法再連結 Twitter,本文僅供留存參考用。 ::: ## [IFTTT](https://ifttt.com/) - IFTTT - If This Then That - 當某個服務有某個活動時做某件事 - [How to use Discord Webhooks](https://gist.github.com/Birdie0/78ee79402a4301b1faf412ab5f1cdcf9) - [IFTTT Guide](https://birdie0.github.io/discord-webhooks-guide/services/ifttt.html) ### 設定步驟 1. 在想要中介轉貼資訊的 Discord 頻道右方點擊 `齒輪 (設定)` 或是直接點選 `伺服器選單` 進入 `伺服器設定` ,點擊進到 `Webhooks` 分頁   2. 點擊右上角 `新增一個 Webhooks` , 選擇 `要傳送訊息的頻道`,替自動推播機器人 `命名` 與 `修改頭像` **並複製這時出現的網址,第 11 步會用到**  3. 在 ==[IFTTT](https://ifttt.com/)== 上註冊帳號 (可直接使用其他網站帳號登入)  4. 點擊右上角頭像點選 `Create`  5. 按 If This 的 `This`  6. 選擇要獲取訊息的服務,這次是要從推特拿訊息, 所以在搜尋列輸入 `Twitter` 選推特  7. 選擇要獲取的對應事件,這次例子是要拿 GBF 新推文 所以點下方的 `New tweet by a specific user` (當某位特定使用者發送推文時)  8. 輸入發送推文的帳號: `granbluefantasy`  9. 按 Then That 的 `That`  10. 輸入 Webhooks 選取 `Webhooks` , 只會出現一個功能選項,直接點選   11. 在 URL 欄位貼上 `第 2 步複製的網址`, Method 選 `POST`, Content Type 選 `application/json`, Body 複製貼上 ↓ (※ **`{` 和 `}` 也要複製**) ```json { "content":"@{{UserName}} {{CreatedAt}}: {{LinkToTweet}}" } ```  12. 按下 `Create action` 與下一頁的 `Finish`,到此才算完成 指定帳號發送推文後,就會自動轉貼到指定的 Discord 頻道上  13. 欲修改時,同樣點選頭像的 `My Applets`  即可看到目前啟用的程序,點入欲修改的程序後,點選右上角 `Settings`  便可修改獲取訊息的帳號、傳送伺服器、訊息格式...etc. 等內容 ## [pipedream](https://pipedream.com/) - 自訂性極高,可依需求進行細部設定 - 採定期執行模式,無法立即轉送推文至 Discord 頻道 ### 設定步驟 1. 註冊帳號或使用其他平台帳號快速登入 2. Select a source 選「Twitter」-> 選「User Tweets」-> 登入推特取得 API 授權 3. Screen name 輸入想轉推的帳號 -> 點「Create source」 4. 網站會自動跳到 Sources 分頁 -> 點「Create workflow」-> 點下面的「+」 5. 選「Discord webhook」-> 選「Send message to channel」 6. 登入 Discord 取得 API 授權 -> 選擇要轉發的伺服器與頻道 7. 點 params 底下的 `+message` 8. 本文以轉貼網址為例,故此處輸入 `https://twitter.com/{{steps.trigger.raw_event.user.screen_name}}/status/{{event.id_str}}` 9. 點上方的「deploy」-> 點開 steps.trigger 右邊的開關 10. 完成!
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up