Ejemplo n.º 1
0
 internal DiscordActivity(DiscordActivity other)
 {
     Name         = other.Name;
     ActivityType = other.ActivityType;
     StreamUrl    = other.StreamUrl;
     RichPresence = new DiscordRichPresence(other.RichPresence);
 }
Ejemplo n.º 2
0
        internal void UpdateWith(TransportActivity rawActivity)
        {
            this.Name = rawActivity?.Name;
            this.ActivityType = rawActivity != null ? rawActivity.ActivityType : ActivityType.Playing;
            this.StreamUrl = rawActivity?.StreamUrl;

            if (rawActivity?.IsRichPresence() == true && this.RichPresence != null)
                this.RichPresence.UpdateWith(rawActivity);
            else if (rawActivity?.IsRichPresence() == true)
                this.RichPresence = new DiscordRichPresence(rawActivity);
            else
                this.RichPresence = null;
        }
Ejemplo n.º 3
0
 internal DiscordRichPresence(DiscordRichPresence other)
 {
     this.Details          = other.Details;
     this.State            = other.State;
     this.Application      = other.Application;
     this.Instance         = other.Instance;
     this.LargeImageText   = other.LargeImageText;
     this.SmallImageText   = other.SmallImageText;
     this.LargeImage       = other.LargeImage;
     this.SmallImage       = other.SmallImage;
     this.CurrentPartySize = other.CurrentPartySize;
     this.MaximumPartySize = other.MaximumPartySize;
     this.PartyId          = other.PartyId;
     this.StartTimestamp   = other.StartTimestamp;
     this.EndTimestamp     = other.EndTimestamp;
     this.JoinSecret       = other.JoinSecret;
     this.MatchSecret      = other.MatchSecret;
     this.SpectateSecret   = other.SpectateSecret;
 }
Ejemplo n.º 4
0
 internal DiscordRichPresence(DiscordRichPresence other)
 {
     Details          = other.Details;
     State            = other.State;
     Application      = other.Application;
     Instance         = other.Instance;
     LargeImageText   = other.LargeImageText;
     SmallImageText   = other.SmallImageText;
     LargeImage       = other.LargeImage;
     SmallImage       = other.SmallImage;
     CurrentPartySize = other.CurrentPartySize;
     MaximumPartySize = other.MaximumPartySize;
     PartyId          = other.PartyId;
     StartTimestamp   = other.StartTimestamp;
     EndTimestamp     = other.EndTimestamp;
     JoinSecret       = other.JoinSecret;
     MatchSecret      = other.MatchSecret;
     SpectateSecret   = other.SpectateSecret;
 }
Ejemplo n.º 5
0
        internal void UpdateWith(TransportActivity rawActivity)
        {
            Name         = rawActivity?.Name;
            ActivityType = rawActivity != null ? rawActivity.ActivityType : ActivityType.Playing;
            StreamUrl    = rawActivity?.StreamUrl;

            if (rawActivity?.IsRichPresence() == true && RichPresence != null)
            {
                RichPresence.UpdateWith(rawActivity);
            }
            else if (rawActivity?.IsRichPresence() == true)
            {
                RichPresence = new DiscordRichPresence(rawActivity);
            }
            else
            {
                RichPresence = null;
            }
        }