Total Complexity | 2 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | package com.github.netkorp.telegram.framework.commands.basic; |
||
12 | @TelegramCommand(name = "whoami", group = "Basic", secure = false) |
||
13 | @Conditional(ExcludeCondition.class) |
||
14 | public final class WhoAmICommand extends AbstractSimpleCommand { |
||
15 | |||
16 | /** |
||
17 | * Processes the data sent by the users. |
||
18 | * |
||
19 | * @param update the received message. |
||
20 | * @param args the parameters passed to the command execution. |
||
21 | */ |
||
22 | @Override |
||
23 | public void execute(Update update, String[] args) { |
||
24 | Long idChat = update.getMessage().getChatId(); |
||
25 | bot.sendMessage(idChat.toString(), idChat); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Returns the command's description, used to be displayed in help message. |
||
30 | * |
||
31 | * @return the command's description. |
||
32 | */ |
||
33 | @Override |
||
34 | public String description() { |
||
35 | return "Shows the ID of the current chat."; |
||
36 | } |
||
38 |