Completed
Branch master (77a1ce)
by Roannel Fernández
02:42
created

com.github.netkorp.simplecommand.commands.NameCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A description() 0 3 1
A execute(Update) 0 3 1
1
package com.github.netkorp.simplecommand.commands;
2
3
import com.github.netkorp.telegram.framework.commands.abstracts.AbstractCommand;
4
import org.springframework.stereotype.Component;
5
import org.telegram.telegrambots.meta.api.objects.Update;
6
7
@Component
8
public class NameCommand extends AbstractCommand {
9
10
    /**
11
     * Processes the data of the commands.
12
     *
13
     * @param update The received message.
14
     */
15
    @Override
16
    public void execute(Update update) {
17
        bot.sendMessage(update.getMessage().getChat().getFirstName(), update.getMessage().getChatId());
18
    }
19
20
    /**
21
     * Returns the description of the commands.
22
     *
23
     * @return The description.
24
     */
25
    @Override
26
    public String description() {
27
        return "It tells you what your first name is";
28
    }
29
}
30