Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Threading.Tasks;
- using Discord;
- using Discord.WebSocket;
- using Discord.Commands;
- using DiscordBOT.Core;
- using System.IO;
- namespace DiscordBOT
- {
- class Program
- {
- DiscordSocketClient _client;
- CommandHandler _handler;
- static void Main(string[] args)
- => new Program().StartAsync().GetAwaiter().GetResult();
- /*{
- if (args.Any() && args[0] == "-ver") Console.WriteLine(Utilities.GetAlert("VERSION"));
- }*/
- public async Task StartAsync()
- {
- if (Config.bot.token == "" || Config.bot.token == null) return;
- _client = new DiscordSocketClient(new DiscordSocketConfig
- {
- LogLevel = LogSeverity.Verbose
- });
- _client.Log += Log;
- _client.Ready += onInput.reqInput;
- await _client.LoginAsync(TokenType.Bot, Config.bot.token);
- await _client.StartAsync();
- Global.Client = _client;
- _handler = new CommandHandler();
- await _handler.InitializeAsync(_client);
- await Task.Delay(-1);
- }
- private async Task Log(LogMessage msg)
- {
- Console.WriteLine(msg.Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement