|
|
@ -4,7 +4,6 @@ using Discord; |
|
|
|
using Discord.Commands; |
|
|
|
using Discord.Commands; |
|
|
|
using Discord.WebSocket; |
|
|
|
using Discord.WebSocket; |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
using AIMLbot; |
|
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using System.Timers; |
|
|
|
using System.Timers; |
|
|
|
using System.Net; |
|
|
|
using System.Net; |
|
|
@ -21,14 +20,12 @@ namespace Kehyeedra3 |
|
|
|
/// Star Vars |
|
|
|
/// Star Vars |
|
|
|
public static bool IsReady { get; private set; } |
|
|
|
public static bool IsReady { get; private set; } |
|
|
|
public static DiscordSocketClient _bot; |
|
|
|
public static DiscordSocketClient _bot; |
|
|
|
public static System.Timers.Timer Clockboy; |
|
|
|
//public static System.Timers.Timer Clockboy; |
|
|
|
public static AudioService AudioService; |
|
|
|
public static AudioService AudioService; |
|
|
|
public static CommandService _cmds; |
|
|
|
public static CommandService _cmds; |
|
|
|
public static IServiceProvider _dmap; |
|
|
|
public static IServiceProvider _dmap; |
|
|
|
public static CommandServiceConfig _cmdsconfig; |
|
|
|
public static CommandServiceConfig _cmdsconfig; |
|
|
|
public static Random _rnd = new Random(); |
|
|
|
public static Random _rnd = new Random(); |
|
|
|
public static AIMLbot.Bot ChatService; |
|
|
|
|
|
|
|
public static AIMLbot.User ChatUser; |
|
|
|
|
|
|
|
public static string PathToUserData; |
|
|
|
public static string PathToUserData; |
|
|
|
public static WebClient WeebClient; |
|
|
|
public static WebClient WeebClient; |
|
|
|
public static ReminderService RmService; |
|
|
|
public static ReminderService RmService; |
|
|
@ -38,8 +35,6 @@ namespace Kehyeedra3 |
|
|
|
// Environment.CurrentDirectory + @"Audio\cough1.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\cough1.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\cough2.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\cough2.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\wilhelmcough.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\wilhelmcough.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\trapcough1.wav", |
|
|
|
|
|
|
|
// Environment.CurrentDirectory + @"Audio\trapcough2.wav", |
|
|
|
|
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough1.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough1.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough2.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough2.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough3.wav", |
|
|
|
// Environment.CurrentDirectory + @"Audio\h3h3cough3.wav", |
|
|
@ -58,7 +53,7 @@ namespace Kehyeedra3 |
|
|
|
DotEnv.Config(filePath: Path.Combine(AppContext.BaseDirectory, ".env")); |
|
|
|
DotEnv.Config(filePath: Path.Combine(AppContext.BaseDirectory, ".env")); |
|
|
|
var Config = Configuration.Load(); |
|
|
|
var Config = Configuration.Load(); |
|
|
|
|
|
|
|
|
|
|
|
Clockboy = new System.Timers.Timer(); |
|
|
|
//Clockboy = new System.Timers.Timer(); |
|
|
|
|
|
|
|
|
|
|
|
WeebClient = new WebClient(); |
|
|
|
WeebClient = new WebClient(); |
|
|
|
|
|
|
|
|
|
|
@ -89,7 +84,6 @@ namespace Kehyeedra3 |
|
|
|
await CommandHandler.InstallCommands(); |
|
|
|
await CommandHandler.InstallCommands(); |
|
|
|
|
|
|
|
|
|
|
|
EventHandlers.InstallEventHandlers(); |
|
|
|
EventHandlers.InstallEventHandlers(); |
|
|
|
InstallChatService(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Clockboy.Elapsed += Clockboy_Elapsed; |
|
|
|
//Clockboy.Elapsed += Clockboy_Elapsed; |
|
|
|
//Clockboy.Interval = SRandom.Next(3600000, 14400000); |
|
|
|
//Clockboy.Interval = SRandom.Next(3600000, 14400000); |
|
|
@ -146,7 +140,7 @@ namespace Kehyeedra3 |
|
|
|
_bot.Ready += _bot_Ready; |
|
|
|
_bot.Ready += _bot_Ready; |
|
|
|
await _bot.LoginAsync(TokenType.Bot, Configuration.Load().Token); |
|
|
|
await _bot.LoginAsync(TokenType.Bot, Configuration.Load().Token); |
|
|
|
await _bot.StartAsync(); |
|
|
|
await _bot.StartAsync(); |
|
|
|
Clockboy.Start(); |
|
|
|
//Clockboy.Start(); |
|
|
|
//new Thread(async x => |
|
|
|
//new Thread(async x => |
|
|
|
//{ |
|
|
|
//{ |
|
|
|
// await Bot.RmService.Tick(); |
|
|
|
// await Bot.RmService.Tick(); |
|
|
@ -188,28 +182,6 @@ namespace Kehyeedra3 |
|
|
|
Environment.Exit(0); |
|
|
|
Environment.Exit(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public static void InstallChatService() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string path = Path.Combine(Environment.CurrentDirectory, "config", |
|
|
|
|
|
|
|
"Settings.xml"); |
|
|
|
|
|
|
|
if (File.Exists(path)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ChatService = new AIMLbot.Bot(); |
|
|
|
|
|
|
|
ChatService.loadSettings(path); |
|
|
|
|
|
|
|
ChatService.isAcceptingUserInput = false; |
|
|
|
|
|
|
|
ChatService.loadAIMLFromFiles(); |
|
|
|
|
|
|
|
ChatService.isAcceptingUserInput = true; |
|
|
|
|
|
|
|
PathToUserData = Path.Combine(Environment.CurrentDirectory, "aimlusers"); |
|
|
|
|
|
|
|
Console.WriteLine("Loaded: Chat Service"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch(Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Console.WriteLine (ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |