wechaty/docusaurus

Error applying config in EventLogger plugin

Open

#960 opened on Jun 18, 2021

View on GitHub
 (0 comments) (0 reactions) (0 assignees)MDX (342 forks)auto 404
GSoD 2021bughelp wantedtutorials

Repository metrics

Stars
 (119 stars)
PR merge metrics
 (PR metrics pending)

Description

The EventLogger code snippet present on this page shows the config can be applied like this:

import { EventLogger } from 'wechaty-plugin-contrib'
const config = ['login', 'ready', 'message']
wechaty.use(EventLogger(config))

But while adding the EventLogger plugin to a bot, it doesn't take the config like that and produces an error:

Code snippet of the bot I am trying to build:

import { Wechaty } from 'wechaty'
import { EventLogger } from 'wechaty-plugin-contrib'

const config = ['login', 'ready', 'message']

const bot = new Wechaty({
    name: 'event-logger-bot',
})

bot.use(EventLogger(config))
bot.start()

Let me know how can I apply the config to the EventLogger.

Contributor guide