1 | package com.github.netkorp.telegram.framework.commands.basic; |
||
0 ignored issues
–
show
Code Smell
introduced
by
![]() |
|||
2 | |||
3 | import com.github.netkorp.telegram.framework.annotations.TelegramCommand; |
||
4 | import com.github.netkorp.telegram.framework.commands.abstracts.AbstractSimpleCommand; |
||
5 | import com.github.netkorp.telegram.framework.condition.ExcludeCondition; |
||
6 | import org.springframework.context.annotation.Conditional; |
||
7 | import org.telegram.telegrambots.meta.api.objects.Update; |
||
8 | |||
9 | /** |
||
10 | * Shows the chat identification for user who invoked the command. |
||
11 | */ |
||
12 | @TelegramCommand(name = "whoami", group = "commands.groups.whoami", secure = false) |
||
13 | @Conditional(ExcludeCondition.class) |
||
14 | public final class WhoAmICommand extends AbstractSimpleCommand { |
||
0 ignored issues
–
show
|
|||
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) { |
||
0 ignored issues
–
show
|
|||
24 | Long idChat = update.getMessage().getChatId(); |
||
0 ignored issues
–
show
|
|||
25 | bot.sendMessage(idChat.toString(), idChat); |
||
26 | } |
||
27 | } |
||
28 |