API Docs for:
Show:

TGBOT Class

Defined in: tg.js:5

物件TGBOT

Constructor

TGBOT

(
  • options
)

Defined in tg.js:5

Parameters:

  • options Object

    選項

Methods

addCmd

(
  • cmd
  • script
  • desc
  • helpMsg
)

Defined in tg.js:143

添加指令

Parameters:

  • cmd String

    指令名稱

  • script Function

    指令的內容

  • desc String

    簡短描述

  • helpMsg String

    說明文字

createToolBox

(
  • message
)
Object

Defined in tg.js:169

建構toolBox物件

Parameters:

  • message Object

    訊息

Returns:

Object:

toolBox 工具盒 sendToChat(text) 發送文字到訊息的來源 replyMsg(text) 以文字回復訊息 sendToUser(text) 發送文字給發送訊息的使用者

genHelp

(
  • Help的格式
)
String

Defined in tg.js:188

產生Help

Parameters:

  • Help的格式 Function

Returns:

String:

help help

getMe

(
  • cb
)

Defined in tg.js:121

獲取bot資訊

Parameters:

  • cb Function

    callback

sendMessage

(
  • chat_id
  • text
  • [datas]
)

Defined in tg.js:129

發送訊息

Parameters:

  • chat_id Object

    要送到哪

  • text String

    要發送的文字

  • [datas] Object optional

    其他資料

start

()

Defined in tg.js:27

啟動bot