Completed
Push — master ( dbd5a1...2daf05 )
by Roannel Fernández
03:23
created

com.github.netkorp.severalnamescommand.commands.NameCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute(Update,String[]) 0 3 1
A description() 0 3 1
1
package com.github.netkorp.severalnamescommand.commands;
2
3
import com.github.netkorp.telegram.framework.annotations.TelegramCommand;
4
import com.github.netkorp.telegram.framework.commands.abstracts.AbstractSimpleCommand;
5
import org.telegram.telegrambots.meta.api.objects.Update;
6
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
    }
30
}
31