feature fix #28

This commit is contained in:
A.C.Sukazyo Eyre 2022-03-08 20:26:10 +08:00
parent 60bf104e94
commit 7bbe75a522
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
4 changed files with 43 additions and 4 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.5.1.1
VERSION = 0.5.2.0
# dependencies

View File

@ -4,6 +4,6 @@ package cc.sukazyo.cono.morny;
* the final field that will be updated by gradle automatically.
*/
public class GradleProjectConfigures {
public static final String VERSION = "0.5.1.1";
public static final long COMPILE_TIMESTAMP = 1644381533694L;
public static final String VERSION = "0.5.2.0";
public static final long COMPILE_TIMESTAMP = 1646742061976L;
}

View File

@ -76,7 +76,8 @@ public class MornyCommands {
new 喵呜.抱抱(),
new 喵呜.揉揉(),
new 喵呜.蹭蹭(),
new 喵呜.贴贴()
new 喵呜.贴贴(),
new 私わね()
);
}

View File

@ -0,0 +1,38 @@
package cc.sukazyo.cono.morny.bot.command;
import cc.sukazyo.cono.morny.MornyCoeur;
import cc.sukazyo.untitled.util.telegram.object.InputCommand;
import com.pengrad.telegrambot.model.Update;
import com.pengrad.telegrambot.request.SendMessage;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.concurrent.ThreadLocalRandom;
@SuppressWarnings("NonAsciiCharacters")
public class 私わね implements ISimpleCommand {
@Nonnull
@Override public String getName () { return "/me"; }
@Nullable
@Override public String[] getAliases () { return null; }
@Override
public void execute (@Nonnull InputCommand command, @Nonnull Update event) {
if (ThreadLocalRandom.current().nextInt(521) == 0) {
// 可以接入未来的心情系统如果有的话
final String text = switch (ThreadLocalRandom.current().nextInt(11)) {
case 0,7,8,9,10 -> "才不是";
case 1,2,3,6 -> "才不是!";
case 4,5 -> "才不是..";
default -> throw new IllegalStateException("Unexpected random value in 私わね command.");
};
MornyCoeur.extra().exec(new SendMessage(
event.message().chat().id(),
text
).replyToMessageId(event.message().messageId()));
}
}
}