GuildScheduledEvent.from constructor

GuildScheduledEvent.from({
  1. required ChannelManager channelManager,
  2. required MemberManager memberManager,
  3. required dynamic payload,
})

Implementation

factory GuildScheduledEvent.from({ required ChannelManager channelManager, required MemberManager memberManager, required payload }) {
  return GuildScheduledEvent(
    payload['id'],
    payload['guild_id'],
    payload['channel_id'] != null ? channelManager.cache.get(payload['channel_id']) : null,
    payload['creator_id'] != null ? memberManager.cache.get(payload['creator_id']) : null,
    payload['name'],
    payload['description'],
    payload['scheduled_start_time'],
    payload['scheduled_end_time'],
    payload['status'],
    payload['entity_type'],
    payload['entity_id'],
    payload['image'],
    payload['entity_metadata'] != null && payload['entity_metadata']['location'] != null ? payload['entity_metadata']['location'] : null
  );
}