From 59747c496f0866f1942c8f5911b14a0595116ec2 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Wed, 31 May 2023 16:47:52 +0500 Subject: [PATCH] Add temporary presence Signed-off-by: Octol1ttle --- Boyfriend.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Boyfriend.cs b/Boyfriend.cs index 3824fa6..0d42939 100644 --- a/Boyfriend.cs +++ b/Boyfriend.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Remora.Discord.API.Abstractions.Gateway.Commands; using Remora.Discord.API.Abstractions.Objects; +using Remora.Discord.API.Gateway.Commands; using Remora.Discord.API.Objects; using Remora.Discord.Caching.Extensions; using Remora.Discord.Caching.Services; @@ -40,9 +41,14 @@ public class Boyfriend { ).ConfigureServices( (_, services) => { services.Configure( - options => options.Intents |= GatewayIntents.MessageContents - | GatewayIntents.GuildMembers - | GatewayIntents.GuildScheduledEvents); + options => { + options.Intents |= GatewayIntents.MessageContents + | GatewayIntents.GuildMembers + | GatewayIntents.GuildScheduledEvents; + options.Presence = new UpdatePresence( + UserStatus.Online, false, DateTimeOffset.UtcNow, + new[] { new Activity("with Remora.Discord", ActivityType.Game) }); + }); services.Configure( settings => { settings.SetDefaultAbsoluteExpiration(TimeSpan.FromHours(1));