Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
natanimn committed Jul 4, 2024
1 parent a8fb154 commit 8d4b8b9
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,11 @@ bot.onMessage(filter -> filter.state("name") && filter.TEXT, (context, message)
Example for using reply markup

```java
import et.telebof.types.ReplyKeyboardMarkup;
import et.telebof.types.KeyboardButton;

ReplyKeyboardMarkup markup = new ReplyKeyboardMarkup()
.resizeKeyboard(true) // resize keyboard
.resizeKeyboard(true); // resize keyboard

markup.add("A", "B", "C"); // You can add String or
markup.add("D", "E");
Expand All @@ -444,6 +447,9 @@ context.sendMssage("Hello, World!").replyMarkup(markup).exec();
example for using InlineKeyboardMarkup

```java
import et.telebof.types.InlineKeyboardButton;
import et.telebof.types.InlineKeyboardMarkup;

InlineKeybaordMarkup inlineMarkup = new InlineKeybaordMarkup();

inlineMarkup.addKeybaord(
Expand Down Expand Up @@ -475,13 +481,17 @@ context.sendMessage("Press one button").replyMarkup(inlineMarkup).exec();

### ForceReply
```java
import et.telebof.types.ForceReply;

context.sendMessage("Can you tell me your name please?")
.replyMarkup(new ForceReply())
.exec();
```

### RemoveReplyKeyboard
```java
import et.telebof.types.ReplyKeyboardMarkup;

context.sendMessage("There is no reply keyboard now")
.replyMarkup(new RemoveReplyKeybaord())
.exec();
Expand All @@ -494,21 +504,15 @@ import et.telebof.types.InlineQueryResult;
import et.telebof.types.InlineQueryResultArticle;
import et.telebof.types.InputTextMessageContent;

public class InlineBot {
public static void main(String[] args) {
//...

bot.onInline(filter -> filter.ZERO_INLINE_QUERY, (context, query) -> {
InlineQueryResultArticle article = new InlineQueryResultArticle("1")
.title("Write something")
.description("click here")
.inputTextMessageContent(new InputTextMessageContent("Please write something"));

context.answerInline(new InlineQueryResult[]{article}).exec();
});
bot.onInline(filter -> filter.ZERO_INLINE_QUERY, (context, query) -> {
InlineQueryResultArticle article = new InlineQueryResultArticle("1")
.title("Write something")
.description("click here")
.inputTextMessageContent(new InputTextMessageContent("Please write something"));

}
}
context.answerInline(new InlineQueryResult[]{article}).exec();
});
```

## Using Webhook
Expand Down Expand Up @@ -559,7 +563,6 @@ BotClient bot = new BotClient.Builder(TOKEN)

```java
import et.telebof.BotClient;

import java.net.InetSocketAddress;
import java.net.Proxy;

Expand Down

0 comments on commit 8d4b8b9

Please sign in to comment.