Пример #1
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);
 }
Пример #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;
            }

            if (rawActivity?.IsCustomStatus() == true && this.CustomStatus != null)
            {
                this.CustomStatus.UpdateWith(rawActivity.State, rawActivity.Emoji);
            }
            else if (rawActivity?.IsCustomStatus() == true)
            {
                this.CustomStatus = new DiscordCustomStatus
                {
                    Name  = rawActivity.State,
                    Emoji = rawActivity.Emoji
                }
            }
            ;
            else
            {
                this.CustomStatus = null;
            }
        }
Пример #3
0
 internal DiscordCustomStatus(DiscordCustomStatus other)
 {
     this.Name  = other.Name;
     this.Emoji = other.Emoji;
 }