add support for "o" and "/o" as alias of "/on" in PRIVATE chats

This commit is contained in:
A.C.Sukazyo Eyre 2025-04-09 15:08:13 +08:00
parent 4c165976b5
commit 1b95b0a917
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
4 changed files with 22 additions and 2 deletions

View File

@ -5,7 +5,7 @@ MORNY_ARCHIVE_NAME = morny-coeur
MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono
MORNY_COMMIT_PATH = https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s MORNY_COMMIT_PATH = https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s
VERSION = 1.5.0-alpha.1 VERSION = 1.5.0-alpha.2
USE_DELTA = false USE_DELTA = false
VERSION_DELTA = VERSION_DELTA =

View File

@ -23,7 +23,7 @@ class MornyCommands (using coeur: MornyCoeur) {
stash += (alias.name -> i) stash += (alias.name -> i)
stash stash
private val $MornyHellos = MornyHellos() private[bot] val $MornyHellos = MornyHellos()
private val $IP186Query = IP186Query() private val $IP186Query = IP186Query()
private val $MornyInformation = MornyInformation() private val $MornyInformation = MornyInformation()
private val $MornyInformationOlds = MornyInformationOlds(using $MornyInformation) private val $MornyInformationOlds = MornyInformationOlds(using $MornyInformation)

View File

@ -9,6 +9,7 @@ class MornyEventListeners (using manager: EventListenerManager) (using coeur: Mo
manager.register( manager.register(
// ACTIVITY_RECORDER // ACTIVITY_RECORDER
// KUOHUANHUAN_NEED_SLEEP // KUOHUANHUAN_NEED_SLEEP
OnOnAlias(),
OnUniMeowTrigger(using coeur.commands), OnUniMeowTrigger(using coeur.commands),
$OnUserRandom.RandomSelect, $OnUserRandom.RandomSelect,
//noinspection NonAsciiCharacters //noinspection NonAsciiCharacters

View File

@ -0,0 +1,19 @@
package cc.sukazyo.cono.morny.bot.event
import cc.sukazyo.cono.morny.bot.api.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.MornyCoeur
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import com.pengrad.telegrambot.model.Chat
class OnOnAlias (using coeur: MornyCoeur) extends EventListener {
override def onMessage (using event: EventEnv): Unit = {
if (event.update.message.chat.`type` != Chat.Type.Private) return;
if !(List("o", "/o") contains event.update.message.text) then return;
coeur.commands.$MornyHellos.On.execute(using InputCommand(""), event.update)
}
}