Бот на Discord.Net не видит сообщения на сервере?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
namespace ArtBot
{
class Program
{
private DiscordSocketClient _client; // Клиент Discord для взаимодействия с API
static async Task Main(string[] args) => await new Program().RunBot();
public async Task RunBot()
{
var socketConfig = new DiscordSocketConfig
{
GatewayIntents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildPresences,
};
_client = new DiscordSocketClient();
var loggingService = new LoggingService();
_client.Log += loggingService.Log;
var botCommands = new BotCommands(_client);
_client.MessageReceived += botCommands.HandleMessage;
_client.InteractionCreated += botCommands.HandleInteraction;
var token = "";
await _client.LoginAsync(TokenType.Bot, token);
await _client.StartAsync();
_client.Ready += botCommands.OnReady;
await Task.Delay(-1);
}
}
}