FlagMaker
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    7
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 使用 LINE Bot 聊天機器人替代 LINE Notify 服務 LINE Notify 服務在 2025 年 3 月底停止服務,由於 LINE 是台灣地區每個人都在使用的服務,在考量不需要額外安裝 App 的情況下,能夠沿用 LINE 設計類似的訊息通知服務是最好的解法。我們將帶大家改用 LINE 聊天機器人作為替代方案。 [toc] ## 基本概念 要建立 LINE 聊天機器人,必須建立 LINE 官方帳號,也就是代表該機器人的帳號。有了官方帳號後,就可以設計後端程式透過 **LINE Messaging API** 被動回應使用者訊息或是主動發送推播訊息: - **被動回覆訊息**:這是由使用者發送訊息給官方帳號,再由後端程式接收後以官方帳號身分回覆給使用者。我們必須建立能讓官方帳號與後端程式互傳資料的**通道(channel)**,才能讓訊息在兩者之間往返。 - **主動發送推播訊息**:由我們的程式以 LINE 官方帳號身分直接傳送訊息給使用者或群組,這需要透過使用者的 **LINE User Id** 或是群組的 **LINE group Id**(這跟加聯絡人時看到的 LINE Id 是不一樣的東西)指定傳傳送對象。 雖然我們**只需要主動發送推播訊息**就可以達成 LINE Notify 的**單向通知**功能,不過因為需要先取得 LINE user/group Id,這項資訊只能透過接收使用者送來的訊息得知,所以我們幫大家設計好一個後端程式,不論收到什麼訊息,都只會**回覆使用者的 LINE user/group Id**。 ### 流程 實際上的流程就如以下的循序圖所示: ```mermaid sequenceDiagram participant D as 使用者/群組 participant C as LINE App participant B as LINE 官方帳號 participant A as LINE Bot 後端程式<br>(Google Apps Script) %% 取得 LINE User/group Id rect rgba(211, 233, 255, 0.3) Note over D,C: 查詢 LINE user/group Id D->>C: 輸入訊息 C->>B: 傳送訊息 B->>A: 透過通道(channel)<br>轉送訊息 A->>B: 透過通道(channel)<br>回覆 LINE <br>User/group Id B->>C: 回覆 LINE <br>User/group Id C->>D: 顯示 LINE <br>User/group Id end ``` 以下就依照上述流程完成。 ## 建立通道與 LINE 官方帳號 首先就來建立讓 LINE 官方帳號與後端程式互傳資料的通道,建立的過程中就會連帶建立官方帳號,也就是代表聊天機器人的帳號。請依照以下步驟進行: 1. 請先連至 [LINE 開發者網站 - https://developers.line.biz/zh-hant/]( https://developers.line.biz/zh-hant/)。 ![image](https://hackmd.io/_uploads/rySdyNNNyx.png) 按網頁右上角的 **Log in**,會出現如下的畫面: ![image](https://hackmd.io/_uploads/rkTokEVVJe.png) 你可以使用原本的 LINE 帳號登入,或者是按底下的**建立帳號**建立獨立的商用帳號,請自行選擇後登入。 2. 首次登入 LINE 開發者網頁會要求填入基本資料,這裡的資料和你的 LINE 帳號是分開的,可以自由填寫: ![image](https://hackmd.io/_uploads/B1IOZ44V1g.png) 請填入後勾選同意授權條款,再按 **Create my accout** 建立帳號。 4. 登入 LINE 開發者網站後第一步就是要建立 provider,你可以把商用帳號視為一個組織,組織下可能分為不同部門或開發者,而 provider 就代表單一部門或是某位開發者。請往下捲動: ![image](https://hackmd.io/_uploads/HJRIGNE4yg.png) 按一下 **Create a new provider** 建立: ![image](https://hackmd.io/_uploads/Sk1G7VVNkx.png) 請鍵入自訂的名稱後按 **Create** 完成。 5. 建立好 provider 後會要求你建立 **Messaging API channel**,這就是建立可用於 Messaging API 讓官方帳號與後端程式互傳資料的通道,請在剛剛建立好的 provider 總覽頁面中按 **Create a Messaging API channel**: ![image](https://hackmd.io/_uploads/HJ7OQE4NJx.png) 建立 Messaging API Channel 的第一步就是建立 LINE 官方帳號: ![image](https://hackmd.io/_uploads/Hk4EVVEEkg.png) 這個步驟要在官方帳號專屬的頁面進行,請按 **Create a LINE Offici**al Account** 開啟頁面: ![image](https://hackmd.io/_uploads/SklYNEENyg.png) 按登入後繼續: ![image](https://hackmd.io/_uploads/BJAqVEE4kl.png) 首次建立 LINE 官方帳號會需要手機簡訊認證,請按**進行簡訊認證**: ![image](https://hackmd.io/_uploads/H1paNN4Nyl.png) 請輸入電話號碼後按**傳送簡訊**,這裡的電話號碼不需要是你的 LINE 帳號綁定的電話號碼,只要是可以接收簡訊即可: ![image](https://hackmd.io/_uploads/HyvMB4E41g.png) 收到簡訊後輸入認證碼按**認證**完成: ![image](https://hackmd.io/_uploads/SJhBHEVNJx.png) 再按**返回服務**即可。 接著就要設定 LINE 官方帳號的資訊,其中公司名稱可以不填,業種請自行選取,或是像我一樣都先選**其它**: ![image](https://hackmd.io/_uploads/S1JpSEEE1l.png) 確認無誤後按**確定**: ![image](https://hackmd.io/_uploads/BylM84EEJg.png) 再按**完成**即可。 7. 最後要啟用剛剛所建立官方帳號的 Messaging API 功能,這樣才能讓這個官方帳號與稍後要建立的後端程式互動: ![image](https://hackmd.io/_uploads/rJfD8VV4Je.png) 由於我們只是要利用這個官方帳號傳送訊息的功能,並沒有要用來推廣業務,可以先略過認證帳號的步驟,請直接按**稍後進行認證**: ![image](https://hackmd.io/_uploads/BJZ6IEEEkx.png) 再按**登入**: ![image](https://hackmd.io/_uploads/BkU-DEE41x.png) 因為不同意也無法繼續,請按**同意**。 ![image](https://hackmd.io/_uploads/BkwHDVV4yg.png) 如果有看到上面提醒強制雙重認證的畫面,請按**關閉**。 ![image](https://hackmd.io/_uploads/ryAOPEE4yx.png) 請按**下一步**略過加入將剛剛建立的官方帳號加入你的 LINE 好友的步驟,稍後會手動完成: ![image](https://hackmd.io/_uploads/H1Q0v4V4Je.png) 按**前往主頁**進行設定: ![image](https://hackmd.io/_uploads/HJdZu4ENyx.png) 如果想幫你的官方帳號建立頭像,可以按一下左上方的頭像: ![image](https://hackmd.io/_uploads/HJ9DdE441x.png) 你可以把設計好的頭像圖檔拖放進來,沒有設定頭像也沒有關係,並不影響功能: ![image](https://hackmd.io/_uploads/SySiO4NNkx.png) 按**儲存**關閉此交談窗。切換到**主頁**就會看到剛剛上傳的頭像: ![image](https://hackmd.io/_uploads/S1wq-VS4yg.png) 請按官方帳號的名稱進入設定頁面: ![image](https://hackmd.io/_uploads/HJylGVSEye.png) 按左側邊欄的 **Messaging API** 後再按一下右邊的**啟用 Messaging API**,這樣才能讓官方帳號與後端程式連通: ![image](https://hackmd.io/_uploads/BJNIqEVE1x.png) 選取之前建立的 provider 後按**同意**: ![image](https://hackmd.io/_uploads/Sy3K5EENJg.png) 隱私權欄位與服務條款都可以之後再補,按**確定**: ![image](https://hackmd.io/_uploads/By0a54ENJe.png) 再按**確定**完成。 7. 完成後回到 LINE 開發者頁面進一步設定剛剛建立好的 Messaging API channel: ![image](https://hackmd.io/_uploads/SJ5HsENEye.png) 按左側之前建立的 provider,就會在右側看到剛剛建立的官方帳號,請按該官方帳號進入設定頁面: ![image](https://hackmd.io/_uploads/Hke2iNEEye.png) 切換到 **Messaging API** 頁籤,可以看到這個官方帳號的 LINE ID,請利用這個 ID 將它加入你的 LINE 好友,或者也可以用手機掃底下的 QR code: ![image](https://hackmd.io/_uploads/HJ9fn4NNJe.png) 加入後會看到如下的歡迎畫面: ![image](https://hackmd.io/_uploads/BkVHhNVV1g.png) 回到 LINE 開發者網頁往下捲找到 **LINE Official Account features** 區段: ![image](https://hackmd.io/_uploads/HyPQDSEVJg.png) 按一下 **Auto-reply messages** 右側的 **Edit**,會開啟新的設定頁面: ![image](https://hackmd.io/_uploads/Bkw5DrNEJe.png) 請關閉**自動回應**功能,否則每次收到使用者的訊息時 LINE 都會自動幫我們回應不必要的罐頭訊息。完成後請關閉此設定頁面,回到 LINE 開發者頁面: ![image](https://hackmd.io/_uploads/SJ8zdBNN1g.png) 再按一下 **Allow bot to join group chats** 右側的 **Edit**,同樣會開啟新的設定頁面: ![image](https://hackmd.io/_uploads/BJ5I_HVEkl.png) 開啟加入群組的設定,否則官方帳號無法加入群組。設定後關閉頁面回到 LINE 開發者頁面,重新整理頁面: ![image](https://hackmd.io/_uploads/BJaS4NrV1g.png) 確認剛剛的設定都生效後往下捲找到 **Channel access token** 區段: ![image](https://hackmd.io/_uploads/r149n4N4kl.png) 按**Issue**產生存取令牌: ![image](https://hackmd.io/_uploads/BJP1a4NVyl.png) 這個存取令牌是稍後要建立的後端程式使用 Messaging API 發送訊息的通行證,請先把頁面留在這裡不要關閉。 這樣就建立好可以作為 LINE 聊天機器人的官方帳號了,下一步就是要建立可以和 LINE 聊天機器人連動的後端程式。 ## 使用 Google Apps Script 建立 LINE Bot 後端程式 後端程式基本上就是一個網站,每次官方帳號收到使用者送來的訊息時,就會連往後端程式,把訊息轉送過去。當後端程式需要回覆訊息時,就必須以剛剛看到的存取令牌作為通行許可證明,將訊息送到 LINE 的伺服器,由 LINE 轉送訊息給使用者。 由於後端程式必須是一個公開在網路上的網站,為了省去自行架設網站的麻煩,我們採用 Goolge 的 [Apps Script](https://script.google.com/home) 服務快速架設網站,請跟著以下步驟使用我們設計好的範本建立: 1. 開啟我們預先準備好的 [Google Apps Script 專案 - https://flagtech.pse.is/6sveez](https://script.google.com/d/1tLqIravnCHpeC5VXWs2x2gdMniPtwzzXXtGJFxBhxjOyi4L2ZmatLvaP/edit?usp=sharing) 範本: ![image](https://hackmd.io/_uploads/ryWPRE44yg.png) 請登入你的 Google 帳號: ![image](https://hackmd.io/_uploads/SJFQkBNEJx.png) 按左側的**總覽**: ![image](https://hackmd.io/_uploads/HJGdkSNEyl.png) 按右側的複製將此專案複製到你自己的 Google 帳號下: ![image](https://hackmd.io/_uploads/rJGjgrVVye.png) 按專案名稱處可以更改名稱。 2. 將存取令牌儲存到專案中,讓後端程式可以在執行時取得存取令牌: ![image](https://hackmd.io/_uploads/B1vYxS441g.png) 請按左側的**專案設定**: ![image](https://hackmd.io/_uploads/rk8UlBE4Jx.png) 往下捲找到**指令碼屬性**區段後按**新增指令碼屬性**: ![image](https://hackmd.io/_uploads/Syj-ZSVV1x.png) 在**屬性**欄位填入名稱 "line_channel_access_token",**值**欄位填入剛剛在 LINE 開發者網頁生成的存取令牌後按**儲存指令碼屬性**完成。 後端程式會在需要的時候從這裡讀取存取令牌,如此可以避免將存取令牌揭露在程式碼中。指令碼屬性是跟著帳戶,所以即使享專案給別人時,也不會把指令碼屬性一併分享,非常安全。 3. 將設定好的後端程式部署到網路上: ![image](https://hackmd.io/_uploads/ByZXMSNNye.png) 請到網頁上方按右側的**部署**後選取**新增部署作業**: ![image](https://hackmd.io/_uploads/HyXuzrE4yg.png) 確認無誤後按**部署**: ![image](https://hackmd.io/_uploads/B1eazrVNyg.png) 由於剛剛的部署設定會讓任何人都可以以你的身分執行這個專案,所以會要求你同意授權,請按**授與存取權**: ![image](https://hackmd.io/_uploads/ry617BEEJx.png) 選取剛剛專案的同一個帳戶: ![image](https://hackmd.io/_uploads/BJVf7rVVye.png) 由於這是未經 Google 驗證的專案,所以會要求你確認同意授權,請按 **Advanced**: ![image](https://hackmd.io/_uploads/B1hYmBV4Jg.png) 再按 **Go to ...(unsafe)** 完成授權: ![image](https://hackmd.io/_uploads/BJSR7HVVJe.png) 最後按 **Allow** 許可授權即可: ![image](https://hackmd.io/_uploads/rkUG4H44ye.png) 你會看到部署到網路上的公開網址,請複製此網址。 ## 設定官方帳號連動後端程式 到這裡我們已經建立好官方帳號與後端程式,最後就是要把兩者連動: 1. 回到 LINE 開發者頁面,從剛剛的 **Channel access token** 區段往上捲,找到 **Webhook settings** 區段: ![image](https://hackmd.io/_uploads/HJQcrHNVkl.png) 按一下 **Edit** ![image](https://hackmd.io/_uploads/SJSlIH4Nkx.png) 填入剛剛複製的後端程式網址後按 **Update**: ![image](https://hackmd.io/_uploads/BJnSIrV4Jg.png) 最後記得啟用 **Use webhook**。 ## 測試 現在我們已經建立好 LINE 官方帳號,也設定好後端程式,接著就來測試看看囉。 ### 查詢 LINE user id 要能讓 LINE 聊天機器人替代 LINE Notify 功能,首先得查詢你的 LINE user id。請到剛剛加入官方帳號成好友後的聊天室,隨便輸入任何訊息: ![image](https://hackmd.io/_uploads/BJ6COB4NJe.png) 就可以看到後端程式回覆的 LINE user id 了。如果你把這個帳號加入群組,那麼群組中任何人發送訊息,後端程式都會回覆該群組的 LINE group id。 :::warning 請特別留意,同一個人或是群組的 id 並不是固定的,如果聊天機器人所屬的 provider 不同,即使是同一個人或是群組,id 就會不一樣。因此,透過 provider A 下的聊天機器人查到的 id 在另一個 provider B 的聊天機器人中就會變成不存在的使用者,必須重新以 provider B 下的聊天機器人查詢才行。 ::: ### 使用瀏覽器測試發送通知訊息 剛剛設計的後端程式也可以接受特定規格的 HTTP GET 請求,幫我們發送推播訊息,對於無法直接使用 LINE Messaging API 的環境,一樣可以發送通知訊息。 請先在瀏覽器開啟新的頁面,然後如下格式輸入網址: ``` 後端程式的網址?to={你在LINE中看到的id}&t={訊息內容} ``` 其中 `{你在LINE中看到的id}` 請換成你要發送對象或是群組的 LINEuser/group id,`{訊息內容}` 請換成你要傳送的實際訊息內容,最後按下 <kbd>Enter</kbd> 即可。以下是訊息內容為 "通知來了" 的測試,我輸入的網址如下: ``` https://script.google.com/macros/s/AKfycbx2MxNbDCPb57yptMP60cQyhV3Gx5IDuoJabwcnTfLlrJB8zQP0jP4ZN1atIgcp-rxR/exec?to=U3d2299e075241e1705d3e41fdd93f67f&t=通知來了 ``` 你要換成你自己的後端程式網址,測試結果如下: ![image](https://hackmd.io/_uploads/H1Hl9HNVyx.png) 看到頁面上顯示 "OK Push message sent." 就表示成功了,這時你會在 LINE 上看到訊息: ![image](https://hackmd.io/_uploads/ryJNqrVNyx.png) ### 發送通知給群組 如果把這個官方帳號加入某個群組,例如: ![image](https://hackmd.io/_uploads/ryUchMSNkl.png) 就可以查到該群組的 id,這和剛剛看到的 LINE user id 不同: ![image](https://hackmd.io/_uploads/BJG12GrNkl.png) 只要把剛剛程式碼中的 id 換成群組的 id,就可以發送通知到群組讓所有人知道了: ![image](https://hackmd.io/_uploads/Sy0YhBWSyl.png) 群組中的任何人發訊息,都可以看到聊天機器人回覆的群組 id: ![image](https://hackmd.io/_uploads/rJ6R3HbSJx.png) ### 發送貼圖 除了傳送簡單的文字訊息外,也可以發送貼圖,可用的貼圖可以在[這裡](https://developers.line.biz/en/docs/messaging-api/sticker-list/#sticker-definitions)查看,以下就以這組貼圖為例: ![image](https://hackmd.io/_uploads/ryyexQSNyx.png) 只要在網址中加上 pid 與 sid 個別指定貼圖的套件編號(package ID)和貼圖編號即可,格式如下: ``` 後端程式的網址?to={你在LINE中看到的id}&t={訊息內容}&pid={貼圖的套件編號}&sid={貼圖編號} ``` 以下是實際測試的網址: ``` https://script.google.com/macros/s/AKfycbx2MxNbDCPb57yptMP60cQyhV3Gx5IDuoJabwcnTfLlrJB8zQP0jP4ZN1atIgcp-rxR/exec?to=U3d2299e075241e1705d3e41fdd93f67f&t=通知來了&pid=446&sid=1990 ``` 就可以看到送出貼圖了: ![image](https://hackmd.io/_uploads/rJ1e-QBNyl.png) ### 送出圖片 你也可以在訊息中送出圖片,只要是公開網址的圖片都可以利用 img 指定,格式如下: ``` 後端程式的網址?to={你在LINE中看到的id}&t={訊息內容}&pid={貼圖的套件編號}&sid={貼圖編號}&img={圖片網址} ``` 以下是實際測試的網址: ``` https://script.google.com/macros/s/AKfycbx2MxNbDCPb57yptMP60cQyhV3Gx5IDuoJabwcnTfLlrJB8zQP0jP4ZN1atIgcp-rxR/exec?to=U3d2299e075241e1705d3e41fdd93f67f&t=通知來了&pid=446&sid=1990&img=https://www.flag.com.tw/assets/img/bookpic/F4328.jpg ``` 就可以看到訊息中包含文字、貼圖以及圖片: ![image](https://hackmd.io/_uploads/B1RPRrWHke.png) ## 限制 要注意的是,Messaging API 有其限制,詳細可參考[這裡](https://tw.linebiz.com/column/budget-auto-count/),對於單純發送通知訊息來說,主要的限制就是免費帳號每個月只能發送 200 則訊息,你可以在 LINE 開發者網頁個別 Messaging API Channel 的頁面中查詢用量: ![image](https://hackmd.io/_uploads/B1BWzrHVyx.png) 切換到 **Statictis** 頁次就可以看簡易的分析,如果想看細部的統計資訊,可以按 **LINE Official Account MAnage** 到官方帳號網頁查看。 ## 結語 利用本文教導的方式,你就可以建立一個 LINE 聊天機器人來取代原本的 LINE Notify 功能。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    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

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully