monkeeShark/src/remote/activitypub/renderer/emoji.ts
2021-03-23 17:43:07 +09:00

14 lines
391 B
TypeScript

import config from '@/config';
import { Emoji } from '../../../models/entities/emoji';
export default (emoji: Emoji) => ({
id: `${config.url}/emojis/${emoji.name}`,
type: 'Emoji',
name: `:${emoji.name}:`,
updated: emoji.updatedAt != null ? emoji.updatedAt.toISOString() : new Date().toISOString,
icon: {
type: 'Image',
mediaType: emoji.type || 'image/png',
url: emoji.url
}
});