execute(Update,String[])   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
package com.github.netkorp.telegram.framework.commands.basic;
0 ignored issues
show
Code Smell introduced by
It is a best practice to supply a copyright/licence header in your code. Your organisation probably has a template for that.
Loading history...
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
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
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
Coding Style introduced by
Make this line start at column 3.
Loading history...
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
24
        Long idChat = update.getMessage().getChatId();
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
25
        bot.sendMessage(idChat.toString(), idChat);
26
    }
27
}
28