Skip to content

Commit

Permalink
dont forget !!help command in khl
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Mar 5, 2022
1 parent c99335e commit 95c2be6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion chatbridge/impl/kaiheila/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from chatbridge.core.config import ClientConfig
from chatbridge.core.network.protocol import ChatPayload, CommandPayload
from chatbridge.impl import utils
from chatbridge.impl.kaiheila.helps import StatsCommandHelpMessage
from chatbridge.impl.kaiheila.helps import StatsCommandHelpMessage, CommandHelpMessageAll, CommandHelpMessage
from chatbridge.impl.tis import bot_util
from chatbridge.impl.tis.protocol import OnlineQueryResult, StatsQueryResult

Expand Down Expand Up @@ -159,6 +159,15 @@ def formatMessageToKaiHeiLa(self, message: str) -> str:
def createKaiHeiLaBot() -> KaiHeiLaBot:
bot = KaiHeiLaBot(config)

@bot.command()
async def help(msg: Msg):
if msg.ctx.channel.id in bot.config.channels_for_command:
if msg.ctx.channel.id == bot.config.channel_for_chat:
text = CommandHelpMessageAll
else:
text = CommandHelpMessage
await msg.reply(text)

@bot.command()
async def ping(msg: Msg):
if msg.ctx.channel.id in bot.config.channels_for_command:
Expand Down
2 changes: 1 addition & 1 deletion chatbridge/impl/kaiheila/helps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''.strip()

# For chat channel, with full permission
CommandHelpMessageAll = CommandHelpMessage + '''
CommandHelpMessageAll = CommandHelpMessage + '\n' + '''
`!!online`: 显示服务器玩家在线状态
'''.strip()

Expand Down

0 comments on commit 95c2be6

Please sign in to comment.