wechaty/docusaurus

Error applying config in EventLogger plugin

Open

#960 geöffnet am 18. Juni 2021

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)MDX (342 Forks)auto 404
GSoD 2021bughelp wantedtutorials

Repository-Metriken

Stars
 (119 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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