Skip to content

Commit

Permalink
Update README to show updated bot implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
aNNiMON committed Jul 6, 2024
1 parent 763245e commit 30a8d3f
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Enhanced Java telegram bots runner built on top of the [Telegram Bots](https://g
public class TestBot implements BotModule {
@Override
public BotHandler botHandler(Config config) {
super(config.getToken());
return new TestBotHandler();
}
}
Expand Down Expand Up @@ -83,7 +82,8 @@ Enhanced Java telegram bots runner built on top of the [Telegram Bots](https://g
final var configLoader = new YamlConfigLoaderService();
final var configFile = configLoader.configFile("testbot", config.getProfile());
final var botConfig = configLoader.loadFile(configFile, BotConfig.class);
return new TestBotHandler(botConfig);
final var botModuleOptions = BotModuleOptions.createDefault(botConfig.getToken());
return new TestBotHandler(botModuleOptions, botConfig);
}
}
```
Expand All @@ -110,21 +110,16 @@ Enhanced Java telegram bots runner built on top of the [Telegram Bots](https://g
private final BotConfig botConfig;
public TestBotHandler(BotConfig botConfig) {
super(botConfig.getToken());
public TestBotHandler(BotModuleOptions botModuleOptions, BotConfig botConfig) {
super(botModuleOptions);
this.botConfig = botConfig;
}
@Override
public BotApiMethod onUpdate(Update update) {
public BotApiMethod<?> onUpdate(@NotNull Update update) {
// your code here
return null;
}
@Override
public String getBotUsername() {
return botConfig.getUsername();
}
}
```
Expand Down

0 comments on commit 30a8d3f

Please sign in to comment.