Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoDanin committed Sep 25, 2018
1 parent 5390076 commit 8df1f96
Showing 1 changed file with 83 additions and 6 deletions.
89 changes: 83 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Telegraf Test - Simple Test ToolKit of Telegram Bots

## Features

- Telegram bot api server emulator.
- Compatible with [Telegraf](http://telegraf.js.org) <3.
- Compatible with test framework.
- Send message, inline query and callback query.
- Work in local network.

Expand Down Expand Up @@ -69,29 +71,39 @@ test.sendMessageWithText('/ping')
- **url** - String
> Webhook url of your bot.</br>
> Default value: `http://127.0.0.1:3000/secret-path`
- **axios** - Object
> Config/option of Axios.</br>
> Default value: `{headers: {'content-type': 'application/json'}, method: 'POST'}`
- **port** - Number
> Server emulator port.</br>
> Default value: `2000`
- **token** - String
> Bot token.</br>
> Default value: `ABCD:1234567890`
### API

#### Set & Get Objects

- **setBot({**[params](https://core.telegram.org/bots/api#user)**})**
- **setUser({**[params](https://core.telegram.org/bots/api#user)**})**

- **setChat({**[params](https://core.telegram.org/bots/api#chat)**})**

- **setMessage({**[params](https://core.telegram.org/bots/api#message)**})**

- **setInlineQuery({**[params](https://core.telegram.org/bots/api#inlinequery)**})**

- **setCallbackQuery({**[params](https://core.telegram.org/bots/api#callbackquery)**})**

- **setUpdateId(id: Number)**
> Update id.</br>
> Default value: Start in `0`
### Get Objects

- **getUser()**
- **getChat()**
- **getMessage()**
- **getInlineQuery()**
- **getCallbackQuery()**
- **getUpdateId()**

#### Send Requests

Return request of [axios](https://github.com/axios/axios).
Expand All @@ -103,6 +115,71 @@ Return request of [axios](https://github.com/axios/axios).
- **sendCallbackQuery({**[params](https://core.telegram.org/bots/api#callbackquery)**})**
- **sendCallbackQueryWithData(data: String, {**[params](https://core.telegram.org/bots/api#callbackquery)**})**

#### [WIP] Web Server

Telegram Bot Api Server Emulator. Start with `startServer()`.

- [ ] [getMe](https://core.telegram.org/bots/api#getme)

<!--
- [ ] [getMe](https://core.telegram.org/bots/api#getme)
- [ ] [getUpdates](https://core.telegram.org/bots/api#getupdates)
- [ ] [setWebhook](https://core.telegram.org/bots/api#setwebhook)
- [ ] [sendMessage](https://core.telegram.org/bots/api#sendmessage)
- [ ] [forwardMessage](https://core.telegram.org/bots/api#forwardmessage)
- [ ] [sendPhoto](https://core.telegram.org/bots/api#sendphoto)
- [ ] [sendAudio](https://core.telegram.org/bots/api#sendaudio)
- [ ] [sendDocument](https://core.telegram.org/bots/api#senddocument)
- [ ] [sendVideo](https://core.telegram.org/bots/api#sendvideo)
- [ ] [sendVoice](https://core.telegram.org/bots/api#sendvoice)
- [ ] [sendVideoNote](https://core.telegram.org/bots/api#sendvideonote)
- [ ] [sendMediaGroup](https://core.telegram.org/bots/api#sendmediagroup)
- [ ] [sendLocation](https://core.telegram.org/bots/api#sendlocation)
- [ ] [editMessageLiveLocation](https://core.telegram.org/bots/api#editmessagelivelocation)
- [ ] [stopMessageLiveLocation](https://core.telegram.org/bots/api#stopmessagelivelocation)
- [ ] [sendVenue](https://core.telegram.org/bots/api#sendvenue)
- [ ] [sendContact](https://core.telegram.org/bots/api#sendcontact)
- [ ] [getUserProfilePhotos](https://core.telegram.org/bots/api#getuserprofilephotos)
- [ ] [getFile](https://core.telegram.org/bots/api#getfile)
- [ ] [kickChatMember](https://core.telegram.org/bots/api#kickchatmember)
- [ ] [unbanChatMember](https://core.telegram.org/bots/api#unbanchatmember)
- [ ] [restrictChatMember](https://core.telegram.org/bots/api#restrictchatmember)
- [ ] [promoteChatMember](https://core.telegram.org/bots/api#promotechatmember)
- [ ] [exportChatInviteLink](https://core.telegram.org/bots/api#exportchatinvitelink)
- [ ] [setChatPhoto](https://core.telegram.org/bots/api#setchatphoto)
- [ ] [deleteChatPhoto](https://core.telegram.org/bots/api#deletechatphoto)
- [ ] [setChatTitle](https://core.telegram.org/bots/api#setchattitle)
- [ ] [setChatDescription](https://core.telegram.org/bots/api#setchatdescription)
- [ ] [pinChatMessage](https://core.telegram.org/bots/api#pinchatmessage)
- [ ] [unpinChatMessage](https://core.telegram.org/bots/api#unpinchatmessage)
- [ ] [leaveChat](https://core.telegram.org/bots/api#leavechat)
- [ ] [getChat](https://core.telegram.org/bots/api#getchat)
- [ ] [getChatAdministrators](https://core.telegram.org/bots/api#getchatadministrators)
- [ ] [getChatMembersCount](https://core.telegram.org/bots/api#getchatmemberscount)
- [ ] [getChatMember](https://core.telegram.org/bots/api#getchatmember)
- [ ] [setChatStickerSet](https://core.telegram.org/bots/api#setchatstickerset)
- [ ] [deleteChatStickerSet](https://core.telegram.org/bots/api#deletechatstickerset)
- [ ] [answerCallbackQuery](https://core.telegram.org/bots/api#answercallbackquery)
- [ ] [editMessageText](https://core.telegram.org/bots/api#editmessagetext)
- [ ] [editMessageCaption](https://core.telegram.org/bots/api#editmessagecaption)
- [ ] [editMessageReplyMarkup](https://core.telegram.org/bots/api#editmessagereplymarkup)
- [ ] [deleteMessage](https://core.telegram.org/bots/api#deletemessage)
- [ ] [sendSticker](https://core.telegram.org/bots/api#sendsticker)
- [ ] [getStickerSet](https://core.telegram.org/bots/api#getstickerset)
- [ ] [uploadStickerFile](https://core.telegram.org/bots/api#uploadstickerfile)
- [ ] [createNewStickerSet](https://core.telegram.org/bots/api#createnewstickerset)
- [ ] [addStickerToSet](https://core.telegram.org/bots/api#addstickertoset)
- [ ] [setStickerPositionInSet](https://core.telegram.org/bots/api#setstickerpositioninset)
- [ ] [deleteStickerFromSet](https://core.telegram.org/bots/api#deletestickerfromset)
- [ ] [answerInlineQuery](https://core.telegram.org/bots/api#answerinlinequery)
- [ ] [sendInvoice](https://core.telegram.org/bots/api#sendinvoice)
- [ ] [answerShippingQuery](https://core.telegram.org/bots/api#answershippingquery)
- [ ] [answerPreCheckoutQuery](https://core.telegram.org/bots/api#answerprecheckoutquery)
- [ ] [sendGame](https://core.telegram.org/bots/api#sendgame)
- [ ] [setGameScore](https://core.telegram.org/bots/api#setgamescore)
- [ ] [getGameHighScores](https://core.telegram.org/bots/api#getgamehighscores)
-->

### Using with a Test Framework

You create a test suite with
Expand Down

0 comments on commit 8df1f96

Please sign in to comment.