From 117c2aa3996990039f2372e421e50f25b422d1ad Mon Sep 17 00:00:00 2001 From: Misha133 Date: Fri, 16 Sep 2022 21:11:21 +0300 Subject: [PATCH] bump d.net version in samples & add `MessageContent` intent` --- samples/BasicBot/Program.cs | 9 ++++++++- samples/BasicBot/_BasicBot.csproj | 4 ++-- .../InteractionFramework/_InteractionFramework.csproj | 2 +- samples/ShardedClient/Program.cs | 3 ++- samples/ShardedClient/_ShardedClient.csproj | 2 +- samples/TextCommandFramework/Program.cs | 4 ++++ .../TextCommandFramework/_TextCommandFramework.csproj | 4 ++-- samples/WebhookClient/_WebhookClient.csproj | 2 +- 8 files changed, 21 insertions(+), 9 deletions(-) diff --git a/samples/BasicBot/Program.cs b/samples/BasicBot/Program.cs index 179dfce05..a71de9fc8 100644 --- a/samples/BasicBot/Program.cs +++ b/samples/BasicBot/Program.cs @@ -34,9 +34,16 @@ namespace BasicBot public Program() { + // Config used by DiscordSocketClient + // Define intents for the client + var config = new DiscordSocketConfig + { + GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.MessageContent + }; + // It is recommended to Dispose of a client when you are finished // using it, at the end of your app's lifetime. - _client = new DiscordSocketClient(); + _client = new DiscordSocketClient(config); // Subscribing to client events, so that we may receive them whenever they're invoked. _client.Log += LogAsync; diff --git a/samples/BasicBot/_BasicBot.csproj b/samples/BasicBot/_BasicBot.csproj index e6245d340..7d3004ad9 100644 --- a/samples/BasicBot/_BasicBot.csproj +++ b/samples/BasicBot/_BasicBot.csproj @@ -1,4 +1,4 @@ - + Exe @@ -6,7 +6,7 @@ - + diff --git a/samples/InteractionFramework/_InteractionFramework.csproj b/samples/InteractionFramework/_InteractionFramework.csproj index 8892a65b7..a0fa14d74 100644 --- a/samples/InteractionFramework/_InteractionFramework.csproj +++ b/samples/InteractionFramework/_InteractionFramework.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/ShardedClient/Program.cs b/samples/ShardedClient/Program.cs index 2b8f49edb..cb7b0dbb3 100644 --- a/samples/ShardedClient/Program.cs +++ b/samples/ShardedClient/Program.cs @@ -28,7 +28,8 @@ namespace ShardedClient // have 1 shard per 1500-2000 guilds your bot is in. var config = new DiscordSocketConfig { - TotalShards = 2 + TotalShards = 2, + GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.MessageContent }; // You should dispose a service provider created using ASP.NET diff --git a/samples/ShardedClient/_ShardedClient.csproj b/samples/ShardedClient/_ShardedClient.csproj index 68a43c7cd..5c1c6a20c 100644 --- a/samples/ShardedClient/_ShardedClient.csproj +++ b/samples/ShardedClient/_ShardedClient.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/TextCommandFramework/Program.cs b/samples/TextCommandFramework/Program.cs index 8a18daf72..ccd23436e 100644 --- a/samples/TextCommandFramework/Program.cs +++ b/samples/TextCommandFramework/Program.cs @@ -60,6 +60,10 @@ namespace TextCommandFramework private ServiceProvider ConfigureServices() { return new ServiceCollection() + .AddSingleton(new DiscordSocketConfig + { + GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.MessageContent + }) .AddSingleton() .AddSingleton() .AddSingleton() diff --git a/samples/TextCommandFramework/_TextCommandFramework.csproj b/samples/TextCommandFramework/_TextCommandFramework.csproj index 6e00625e8..5307303ce 100644 --- a/samples/TextCommandFramework/_TextCommandFramework.csproj +++ b/samples/TextCommandFramework/_TextCommandFramework.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/WebhookClient/_WebhookClient.csproj b/samples/WebhookClient/_WebhookClient.csproj index 515fcf3a4..acea75d2c 100644 --- a/samples/WebhookClient/_WebhookClient.csproj +++ b/samples/WebhookClient/_WebhookClient.csproj @@ -7,7 +7,7 @@ - +