public static MessageSource GetSource(Model msg) { if (msg.Type != MessageType.Default) { return(MessageSource.System); } else if (msg.WebhookId.IsSpecified) { return(MessageSource.Webhook); } else if (msg.Author.GetValueOrDefault()?.Bot.GetValueOrDefault(false) == true) { return(MessageSource.Bot); } return(MessageSource.User); }
internal override void Update(ClientState state, Model model) { base.Update(state, model); Type = model.Type; }
internal new static SocketSystemMessage Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Model model) { SocketSystemMessage entity = new SocketSystemMessage(discord, model.Id, channel, author); entity.Update(state, model); return(entity); }
internal override void Update(Model model) { base.Update(model); Type = model.Type; }
internal new static RestSystemMessage Create(BaseDiscordClient discord, IMessageChannel channel, IUser author, Model model) { RestSystemMessage entity = new RestSystemMessage(discord, model.Id, channel, author); entity.Update(model); return(entity); }