40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using DSharpPlus;
|
|
using DSharpPlus.CommandsNext;
|
|
using System.Threading.Tasks;
|
|
using System;
|
|
using DotNetEnv;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace T3k3rg0
|
|
{
|
|
public class Program
|
|
{
|
|
static async Task Main(string[] args)
|
|
{
|
|
Env.Load(); // .env fájl betöltése
|
|
|
|
var loggerFactory = Logger.CreateLoggerFactory();
|
|
|
|
var discord = new DiscordClient(new DiscordConfiguration()
|
|
{
|
|
Token = Environment.GetEnvironmentVariable("DISCORD_BOT_TOKEN"),
|
|
TokenType = TokenType.Bot,
|
|
Intents = DiscordIntents.All,
|
|
MinimumLogLevel = LogLevel.Debug,
|
|
LoggerFactory = loggerFactory,
|
|
});
|
|
var commands = discord.UseCommandsNext(new CommandsNextConfiguration()
|
|
{
|
|
StringPrefixes = new[] { "!" },
|
|
EnableDms = false,
|
|
EnableMentionPrefix = true
|
|
});
|
|
|
|
commands.RegisterCommands<Commands.Hello>();
|
|
ReactionRoleHandler.Register(discord);
|
|
|
|
await discord.ConnectAsync();
|
|
await Task.Delay(-1);
|
|
}
|
|
}
|
|
}
|