internal new static SocketSystemMessage Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Model model)
        {
            var entity = new SocketSystemMessage(discord, model.Id, channel, author);

            entity.Update(state, model);
            return(entity);
        }
Beispiel #2
0
 internal static SocketMessage Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Model model)
 {
     if (model.Type == MessageType.Default)
     {
         return(SocketUserMessage.Create(discord, state, author, channel, model));
     }
     else
     {
         return(SocketSystemMessage.Create(discord, state, author, channel, model));
     }
 }
 internal static SocketMessage Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Model model)
 {
     if (model.Type == MessageType.Default ||
         model.Type == MessageType.Reply ||
         model.Type == MessageType.ApplicationCommand ||
         model.Type == MessageType.ThreadStarterMessage)
     {
         return(SocketUserMessage.Create(discord, state, author, channel, model));
     }
     else
     {
         return(SocketSystemMessage.Create(discord, state, author, channel, model));
     }
 }
 /// <summary>
 /// Converts an existing <see cref="SocketSystemMessage"/> to an abstracted <see cref="ISocketSystemMessage"/> value.
 /// </summary>
 /// <param name="socketSystemMessage">The existing <see cref="SocketSystemMessage"/> to be abstracted.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="socketSystemMessage"/>.</exception>
 /// <returns>An <see cref="ISocketSystemMessage"/> that abstracts <paramref name="socketSystemMessage"/>.</returns>
 public static ISocketSystemMessage Abstract(this SocketSystemMessage socketSystemMessage)
 => new SocketSystemMessageAbstraction(socketSystemMessage);
 /// <summary>
 /// Constructs a new <see cref="SocketSystemMessageAbstraction"/> around an existing <see cref="WebSocket.SocketSystemMessage"/>.
 /// </summary>
 /// <param name="socketSystemMessage">The value to use for <see cref="WebSocket.SocketSystemMessage"/>.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="socketSystemMessage"/>.</exception>
 public SocketSystemMessageAbstraction(SocketSystemMessage socketSystemMessage)
     : base(socketSystemMessage)
 {
 }