예제 #1
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
            {
                this.RichPresence = rawActivity?.IsRichPresence() == true ? new DiscordRichPresence(rawActivity) : null;
            }

            if (rawActivity?.IsCustomStatus() == true && this.CustomStatus != null)
            {
                this.CustomStatus.UpdateWith(rawActivity.State, rawActivity.Emoji);
            }
            else
            {
                this.CustomStatus = rawActivity?.IsCustomStatus() == true
                ? new DiscordCustomStatus
                {
                    Name  = rawActivity.State,
                    Emoji = rawActivity.Emoji
                }
            }
            : null;
        }
    }
예제 #2
0
 internal DiscordActivity(DiscordActivity other)
 {
     this.Name         = other.Name;
     this.ActivityType = other.ActivityType;
     this.StreamUrl    = other.StreamUrl;
     this.RichPresence = new DiscordRichPresence(other.RichPresence);
     this.CustomStatus = new DiscordCustomStatus(other.CustomStatus);
 }
예제 #3
0
 internal DiscordCustomStatus(DiscordCustomStatus other)
 {
     this.Name  = other.Name;
     this.Emoji = other.Emoji;
 }