feat(shell): logger: logiriMessageCreated() adapt fm

This commit is contained in:
Il Harper 2024-04-26 14:43:09 +08:00
parent 60fa49ae01
commit a52427bd27
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC

View File

@ -6,8 +6,9 @@ import { blue, cyan, grey } from '../../utils/colors'
export const logiriMessageCreated = async (data: object) => { export const logiriMessageCreated = async (data: object) => {
const d = data as Event const d = data as Event
if (d.type !== 'message-created') return if (d.type !== 'message-created') return
const messages = await new LogiriMessager().send(d.message?.content) const rawMessage = await new LogiriMessager().send(d.message?.content)
return messages.map( const message = rawMessage.join('').replace(/\r/g, '').replace(/\n/g, ' ')
return [message].map(
(x) => (x) =>
`${blue( `${blue(
link( link(