mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2025-04-29 09:32:04 +08:00
add support for "o" and "/o" as alias of "/on" in PRIVATE chats
This commit is contained in:
parent
4c165976b5
commit
1b95b0a917
@ -5,7 +5,7 @@ MORNY_ARCHIVE_NAME = morny-coeur
|
||||
MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono
|
||||
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
|
||||
VERSION_DELTA =
|
||||
|
@ -23,7 +23,7 @@ class MornyCommands (using coeur: MornyCoeur) {
|
||||
stash += (alias.name -> i)
|
||||
stash
|
||||
|
||||
private val $MornyHellos = MornyHellos()
|
||||
private[bot] val $MornyHellos = MornyHellos()
|
||||
private val $IP186Query = IP186Query()
|
||||
private val $MornyInformation = MornyInformation()
|
||||
private val $MornyInformationOlds = MornyInformationOlds(using $MornyInformation)
|
||||
|
@ -9,6 +9,7 @@ class MornyEventListeners (using manager: EventListenerManager) (using coeur: Mo
|
||||
manager.register(
|
||||
// ACTIVITY_RECORDER
|
||||
// KUOHUANHUAN_NEED_SLEEP
|
||||
OnOnAlias(),
|
||||
OnUniMeowTrigger(using coeur.commands),
|
||||
$OnUserRandom.RandomSelect,
|
||||
//noinspection NonAsciiCharacters
|
||||
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user