示例#1
0
 public DiscordMessage(DiscordMessagePacket packet, IDiscordClient client)
 {
     this.packet = packet;
     if (this.packet.GuildId != null &&
         this.packet.Member != null)
     {
         this.packet.Member.User    = this.packet.Author;
         this.packet.Member.GuildId = this.packet.GuildId.Value;
     }
     this.client = client;
 }
        internal static IDiscordMessage ResolveMessage(IDiscordClient client, DiscordMessagePacket packet)
        {
            if (packet == null)
            {
                return(null);
            }

            if (packet.GuildId.HasValue)
            {
                return(new DiscordGuildMessage(packet, client));
            }
            return(new DiscordMessage(packet, client));
        }
示例#3
0
 public DiscordMessage(DiscordMessagePacket packet, IDiscordClient client)
 {
     _packet = packet;
     _client = client;
 }
 /// <inheritdoc />
 public DiscordGuildMessage(DiscordMessagePacket packet, IDiscordClient client)
     : base(packet, client)
 {
 }