Issues (369)

framework/commands/basic/WhoAmICommand.java (5 issues)

1
package com.github.netkorp.telegram.framework.commands.basic;
0 ignored issues
show
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
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
Make this line start at column 3.
Loading history...
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
Make this line start at column 5.
Loading history...
25
        bot.sendMessage(idChat.toString(), idChat);
26
    }
27
}
28