feat: add gaokao days remain command
This commit is contained in:
2 files changed
+47
-33
No files matched your search
@@ -102,37 +102,21 @@ val tasks = mapOf(
|
|||||||
)
|
)
|
||||||
|
|
||||||
val commands = listOf(
|
val commands = listOf(
|
||||||
EchoCommand(), JrrpCommand(),
|
EchoCommand(), JrrpCommand(), NiuziRedeemCommand(), HitokotoCommand(),
|
||||||
NiuziRedeemCommand(), HitokotoCommand(),
|
KFCCommand(), GenerateQRCodeCommand(), AntiRevokeCommand(), MCPingCommand(),
|
||||||
KFCCommand(), GenerateQRCodeCommand(),
|
WeatherCommand(), CigaretteCommand(), RemakeCommand(), PixivCommand(),
|
||||||
AntiRevokeCommand(), MCPingCommand(),
|
RUACommand(), NslookupCommand(), CompilerCommand(), AICommand(),
|
||||||
WeatherCommand(), CigaretteCommand(),
|
GithubUserCommand(), AboutCommand(), MusicPlayUrlCommand(), DomainPriceCommand(),
|
||||||
RemakeCommand(), PixivCommand(),
|
SendMailCommand(), ZiBiCommand(), UnsetZiBiCommand(), WikipediaCommand(),
|
||||||
RUACommand(), NslookupCommand(),
|
AsciiArtCommand(), StatusCommand(), JueCommand(), ShortLinkCommand(),
|
||||||
CompilerCommand(), AICommand(),
|
ShotOtherCommand(), ReverseGIFCommand(), HelpCommand(), MusicCommand(),
|
||||||
GithubUserCommand(), AboutCommand(),
|
SendLikeCommand(), NiuziTransferCommand(), NiuziSignCommand(), NiuziJiJianCommand(),
|
||||||
MusicPlayUrlCommand(), DomainPriceCommand(),
|
NiuziQueryCommand(), MyNiuziCommand(), NiuziBankCommand(), WithdrawCommand(),
|
||||||
SendMailCommand(), ZiBiCommand(),
|
BankTransferCommand(), CreateBankAccountCommand(), BankBalanceCommand(), DepositCommand(),
|
||||||
UnsetZiBiCommand(), WikipediaCommand(),
|
AnimeSearchCommand(), LlamaCommand(), QQMusicCommand(), BullShitGenerateCommand(),
|
||||||
AsciiArtCommand(), StatusCommand(),
|
NiuziRankCommand(), NiuziBankRankCommand(), ShotSelfCommand(), TenSetuCommand(),
|
||||||
JueCommand(), ShortLinkCommand(),
|
ReactionCommand(), MCSkinCommand(), GithubLatestCommitCommand(), RandomMusicCommand(),
|
||||||
ShotOtherCommand(), ReverseGIFCommand(),
|
ZDJDCommand(), ScanQRCodeCommand(), TTSCommand(), SlimeChunkHelperCommand(),
|
||||||
HelpCommand(), MusicCommand(),
|
SupportMeCommand(), TheCatCommand(), TheHistoryOfTodayCommand(), MCVersionCommand(),
|
||||||
SendLikeCommand(), NiuziTransferCommand(),
|
MinecraftWikiCommand(), GaoKaoDaysRemainCommand()
|
||||||
NiuziSignCommand(), NiuziJiJianCommand(),
|
|
||||||
NiuziQueryCommand(), MyNiuziCommand(),
|
|
||||||
NiuziBankCommand(), WithdrawCommand(),
|
|
||||||
BankTransferCommand(), CreateBankAccountCommand(),
|
|
||||||
BankBalanceCommand(), DepositCommand(),
|
|
||||||
AnimeSearchCommand(), LlamaCommand(),
|
|
||||||
QQMusicCommand(), BullShitGenerateCommand(),
|
|
||||||
NiuziRankCommand(), NiuziBankRankCommand(),
|
|
||||||
ShotSelfCommand(), TenSetuCommand(),
|
|
||||||
ReactionCommand(), MCSkinCommand(),
|
|
||||||
GithubLatestCommitCommand(), RandomMusicCommand(),
|
|
||||||
ZDJDCommand(), ScanQRCodeCommand(),
|
|
||||||
TTSCommand(), SlimeChunkHelperCommand(),
|
|
||||||
SupportMeCommand(), TheCatCommand(),
|
|
||||||
TheHistoryOfTodayCommand(), MCVersionCommand(),
|
|
||||||
MinecraftWikiCommand()
|
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2024 RTAkland
|
||||||
|
* Author: RTAkland
|
||||||
|
* Date: 2024/10/9
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package cn.rtast.fancybot.commands.misc
|
||||||
|
|
||||||
|
import cn.rtast.fancybot.annotations.CommandDescription
|
||||||
|
import cn.rtast.rob.entity.GroupMessage
|
||||||
|
import cn.rtast.rob.util.BaseCommand
|
||||||
|
import cn.rtast.rob.util.ob.OneBotListener
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.temporal.ChronoUnit
|
||||||
|
|
||||||
|
@CommandDescription("高考倒计时")
|
||||||
|
class GaoKaoDaysRemainCommand : BaseCommand() {
|
||||||
|
override val commandNames = listOf("高考倒计时")
|
||||||
|
|
||||||
|
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||||
|
val gaoKaoDate = LocalDate.of(LocalDate.now().year, 6, 7)
|
||||||
|
val currentDate = LocalDate.now()
|
||||||
|
val adjustedGaoKaoDate = if (currentDate.isAfter(gaoKaoDate)) {
|
||||||
|
gaoKaoDate.plusYears(1)
|
||||||
|
} else gaoKaoDate
|
||||||
|
val daysBetween = ChronoUnit.DAYS.between(currentDate, adjustedGaoKaoDate)
|
||||||
|
message.reply("高考倒计时: ${daysBetween}天")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user