示例#1
0
        internal new static RestSystemMessage Create(BaseDiscordClient discord, IMessageChannel channel, IUser author, Model model)
        {
            var entity = new RestSystemMessage(discord, model.Id, channel, author);

            entity.Update(model);
            return(entity);
        }
示例#2
0
 internal static RestMessage Create(BaseDiscordClient discord, IMessageChannel channel, IUser author, Model model)
 {
     if (model.Type == MessageType.Default)
     {
         return(RestUserMessage.Create(discord, channel, author, model));
     }
     else
     {
         return(RestSystemMessage.Create(discord, channel, author, model));
     }
 }
 internal static RestMessage Create(BaseDiscordClient discord, IMessageChannel channel, IUser author, Model model)
 {
     if (model.Type == MessageType.Default ||
         model.Type == MessageType.Reply ||
         model.Type == MessageType.ApplicationCommand ||
         model.Type == MessageType.ThreadStarterMessage)
     {
         return(RestUserMessage.Create(discord, channel, author, model));
     }
     else
     {
         return(RestSystemMessage.Create(discord, channel, author, model));
     }
 }
 /// <summary>
 /// Converts an existing <see cref="RestSystemMessage"/> to an abstracted <see cref="IRestSystemMessage"/> value.
 /// </summary>
 /// <param name="restSystemMessage">The existing <see cref="RestSystemMessage"/> to be abstracted.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restSystemMessage"/>.</exception>
 /// <returns>An <see cref="IRestSystemMessage"/> that abstracts <paramref name="restSystemMessage"/>.</returns>
 public static IRestSystemMessage Abstract(this RestSystemMessage restSystemMessage)
 => new RestSystemMessageAbstraction(restSystemMessage);
 /// <summary>
 /// Constructs a new <see cref="RestSystemMessageAbstraction"/> around an existing <see cref="Rest.RestSystemMessage"/>.
 /// </summary>
 /// <param name="restSystemMessage">The value to use for <see cref="Rest.RestSystemMessage"/>.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restSystemMessage"/>.</exception>
 public RestSystemMessageAbstraction(RestSystemMessage restSystemMessage)
     : base(restSystemMessage)
 {
 }