first commit
This commit is contained in:
commit
f680dd869b
6 changed files with 166 additions and 0 deletions
47
program.cs
Normal file
47
program.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
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 discord = new DiscordClient(new DiscordConfiguration()
|
||||
{
|
||||
Token = Environment.GetEnvironmentVariable("DISCORD_BOT_TOKEN"),
|
||||
TokenType = TokenType.Bot,
|
||||
Intents = DiscordIntents.All,
|
||||
MinimumLogLevel = LogLevel.Debug,
|
||||
LoggerFactory = LoggerFactory.Create(builder =>
|
||||
{
|
||||
builder.AddConsole();
|
||||
builder.SetMinimumLevel(LogLevel.Debug);
|
||||
})
|
||||
});
|
||||
var commands = discord.UseCommandsNext(new CommandsNextConfiguration()
|
||||
{
|
||||
StringPrefixes = new[] { "!" },
|
||||
EnableDms = false,
|
||||
EnableMentionPrefix = true
|
||||
});
|
||||
|
||||
commands.RegisterCommands<Commands.Hello>();
|
||||
ReactionRoleHandler.Register(discord);
|
||||
|
||||
discord.Ready += async (s, e) =>
|
||||
{
|
||||
Console.WriteLine("T3k3rg0 elindult !");
|
||||
};
|
||||
|
||||
await discord.ConnectAsync();
|
||||
await Task.Delay(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue