Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Log message.attachments on send #15

@CristianPQ

Description

@CristianPQ

Right now only the text is being logged on MBFEvent.BotMessage, so, if the the message contains any attachment it's not being logged any data of them.
It would be nice at least to know that it has attachments, and some indicator of each one of them.

send: (message, next) => {
    try {
        if (message.type == "message") {
            let item = {
                text: message.text,
                type: message.type
            };
            if(message.attachments) {
                item.attachments = item.attachments.map((val) => (val.contentType))
            }
            this.logEvent(message, events_1.default.BotMessage.name, item);
        }
    }
    catch (e) {
    }
    finally {
        next();
    }
}

Something like that would be enough to avoid log to much data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions