.Dja8x~
Discord.net
is this code correct ?
using System;
using Discord;
using Discord.Webhook;
using Discord.WebSocket;
using Discord.Commands;
using Events;
using System.Reflection;
public class Program {
public DiscordSocketClient? Client;
private DiscordSocketConfig GetSerpentConfig() {
return new DiscordSocketConfig() {GatewayIntents = GatewayIntents.All};
}
public async Task MainAsync() {
string Token = "MY_ACTUAL_BOT_TOKEN";
Client = new DiscordSocketClient(GetSerpentConfig());
Client.Log += Events.Logging.Log;
Client.Ready += Events.Logging.Ready;
Client.MessageReceived += Events.Messaging.MessageReceive;
Client.InteractionCreated += Events.Logging.HandleInteractions;
await Client.LoginAsync(TokenType.Bot,Token);
await Client.StartAsync();
await Task.Delay(-1);
}
public static Task Main() => new Program().MainAsync();
};
using System;
using Discord;
using Discord.Webhook;
using Discord.WebSocket;
using Discord.Commands;
using Events;
using System.Reflection;
public class Program {
public DiscordSocketClient? Client;
private DiscordSocketConfig GetSerpentConfig() {
return new DiscordSocketConfig() {GatewayIntents = GatewayIntents.All};
}
public async Task MainAsync() {
string Token = "MY_ACTUAL_BOT_TOKEN";
Client = new DiscordSocketClient(GetSerpentConfig());
Client.Log += Events.Logging.Log;
Client.Ready += Events.Logging.Ready;
Client.MessageReceived += Events.Messaging.MessageReceive;
Client.InteractionCreated += Events.Logging.HandleInteractions;
await Client.LoginAsync(TokenType.Bot,Token);
await Client.StartAsync();
await Task.Delay(-1);
}
public static Task Main() => new Program().MainAsync();
};
18 replies