Пример #1
0
        internal new static RpcUserMessage Create(DiscordRpcClient discord, ulong channelId, Model model)
        {
            var entity = new RpcUserMessage(discord, model.Id,
                                            RestVirtualMessageChannel.Create(discord, channelId),
                                            RpcUser.Create(discord, model.Author.Value));

            entity.Update(model);
            return(entity);
        }
Пример #2
0
        internal new static RpcUserMessage Create(DiscordRpcClient discord, ulong channelId, Model model)
        {
            var entity = new RpcUserMessage(discord, model.Id,
                                            RestVirtualMessageChannel.Create(discord, channelId),
                                            RpcUser.Create(discord, model.Author.Value, model.WebhookId.ToNullable()),
                                            MessageHelper.GetSource(model));

            entity.Update(model);
            return(entity);
        }
Пример #3
0
 internal static RpcMessage Create(DiscordRpcClient discord, ulong channelId, Model model)
 {
     //model.ChannelId is always 0, needs to be passed from the event
     if (model.Type == MessageType.Default)
     {
         return(RpcUserMessage.Create(discord, channelId, model));
     }
     else
     {
         return(RpcSystemMessage.Create(discord, channelId, model));
     }
 }