Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: message event is not being captured #715

Closed
NomadThanatos opened this issue Jun 12, 2022 · 1 comment
Closed

Bug: message event is not being captured #715

NomadThanatos opened this issue Jun 12, 2022 · 1 comment

Comments

@NomadThanatos
Copy link

Describe the bug

Message event is not being captured though 'chat/receive' is captured.

Steps to reproduce

Use below demo.

import { Context, Logger, Schema } from 'koishi'

export const name = 'demo'

export const Config: Schema<Config> = Schema.object({})

const logger = new Logger('demo')

export function apply(ctx: Context) {
  logger.info("Demo is loaded")
  logger.info(ctx)
  ctx.on('message', async(meta) => {
    logger.info("Message event")
    logger.info(meta)
  })
  ctx.on('chat/receive', async(meta) => {
    logger.info("chat/receive event")
    logger.info(meta)
  })
}

And chat in sandbox.

Expected behavior

Log line should have both demo Message event and demo chat/receive event but the first one is missing.

Screenshots

2022-06-12 15:27:16 [I] demo Demo is loaded
2022-06-12 15:27:16 [I] demo Context <demo>
2022-06-12 15:27:16 [I] watch reload plugin at plugins/demo/src/index.ts
2022-06-12 15:32:09 [D] message [@Alice] Alice: Hola
2022-06-12 15:32:09 [I] demo chat/receive event
2022-06-12 15:32:09 [I] demo {
  content: 'Hola',
  timestamp: undefined,
  messageId: undefined,
  platform: 'sandbox',
  selfId: 'koishi',
  channelId: '@Alice',
  channelName: '@Alice',
  guildId: '@Alice',
  guildName: undefined,
  userId: 'Alice',
  username: 'Alice',
  nickname: undefined,
  avatar: undefined,
  selfName: 'koishi',
  abstract: 'Hola',
  quote: undefined
}

Versions

  • OS: CentOS Stream 9
  • Platform: N/A
  • Node version: v16.14.0
  • Koishi version: Koishi/4.7.3

Additional context

No response

@shigma
Copy link
Member

shigma commented Jun 13, 2022

Fixed in 4.7.4. Thanks for your report.

Release notes will come later.

@shigma shigma closed this as completed Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants