Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | package com.github.netkorp.severalnamescommand.commands; |
||
7 | @TelegramCommand(name = {"name", "first_name"}) |
||
8 | public class NameCommand extends AbstractSimpleCommand { |
||
9 | |||
10 | /** |
||
11 | * Processes the data sent by the users. |
||
12 | * |
||
13 | * @param update the received message. |
||
14 | * @param args the parameters passed to the command execution. |
||
15 | */ |
||
16 | @Override |
||
17 | public void execute(Update update, String[] args) { |
||
18 | bot.sendMessage(update.getMessage().getChat().getFirstName(), update.getMessage().getChatId()); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Returns the command's description, used to be displayed in help message. |
||
23 | * |
||
24 | * @return the command's description. |
||
25 | */ |
||
26 | @Override |
||
27 | public String description() { |
||
28 | return "It tells you what your first name is"; |
||
29 | } |
||
31 |