import WuZeiNiangImage from '@fiora/assets/images/wuzeiniang.gif' ; function convertSystemMessage ( message ) { if ( message . type === 'system' ) { message . from . _id = 'system' ; message . from . originUsername = message . from . username ; message . from . username = '乌贼娘殿下' ; message . from . avatar = WuZeiNiangImage ; message . from . tag = 'system' ; const content = JSON . parse ( message . content ) ; switch ( content . command ) { case 'roll' : { message . content = `掷出了${ content . value }点 (上限${ content . top }点)` ; break ; } case 'rps' : { message . content = `使出了 ${ content . value }` ; break ; } default : { message . content = '不支持的指令' ; } } } else if ( message . deleted ) { message . type = 'system' ; message . from . _id = 'system' ; message . from . originUsername = message . from . username ; message . from . username = '乌贼娘殿下' ; message . from . avatar = WuZeiNiangImage ; message . from . tag = 'system' ; message . content = `撤回了消息` ; } } export default function convertMessage ( message ) { convertSystemMessage ( message ) ; return message ; }