C#C
C#2y ago
.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();



};
Was this page helpful?