import { EventJsonDecoder } from './event-json';

export interface StickerEventJson {
  name?: string;
  file?: string;
  chat?: string;
}

export const decodeStickerEventJson: EventJsonDecoder<StickerEventJson> = (
  message: string
) => {
  const json = JSON.parse(message);

  return {
    name: json.name,
    file: json.file,
    chat: json.chat
  } as StickerEventJson;
};
