Ejemplo n.º 1
0
            public async Task ActivityAsync(string?type = null, [Remainder] string?name = null)
            {
                await Service.StopActivityRotationAsync();

                if (type is null || name is null)
                {
                    await RiasBot.SetPresenceAsync(null);
                    await ReplyConfirmationAsync(Localization.BotActivityRemoved);

                    return;
                }

                var activity = Service.GetActivity(name, type);

                if (activity.Type == ActivityType.Streaming)
                {
                    name = $"[{name}]({activity.Url})";
                }

                await RiasBot.SetPresenceAsync(activity);

                await ReplyConfirmationAsync(Localization.BotActivitySet, GetText(Localization.BotActivity(type.ToLower()), name.ToLowerInvariant()).ToLowerInvariant());
            }