| Total Complexity | 3 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.github.netkorp.telegram.framework.commands.interfaces; |
||
| 6 | public interface Command { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Returns the command's description key, used to retrieve the help message. |
||
| 10 | * |
||
| 11 | * @return the command's description key. |
||
| 12 | */ |
||
| 13 | default String descriptionKey() { |
||
| 14 | String className = this.getClass().getSimpleName().toLowerCase(); |
||
| 15 | if (!"command".equals(className) && className.endsWith("command")) { |
||
| 16 | className = className.substring(0, className.length() - 7); |
||
| 17 | } |
||
| 18 | |||
| 19 | return "commands.description." + className; |
||
| 20 | } |
||
| 22 |