diff --git a/bot/settings.json.example b/bot/settings.json.example index 664cd61..99efc01 100644 --- a/bot/settings.json.example +++ b/bot/settings.json.example @@ -28,7 +28,7 @@ //"realname": "CeBot", "channels": [ - "#cebot" + "##cebot" ], // Valid levels: debug, info, warn, error, fatal @@ -39,8 +39,8 @@ "plugins": { "Admin": { - "superadmins": ["jhass"], - //"admins": ["asterite"] + //"admins": ["asterite"], + "superadmins": ["jhass"] }, "Memo": { diff --git a/bot/src/main.cr b/bot/src/main.cr index cf62990..f6402eb 100644 --- a/bot/src/main.cr +++ b/bot/src/main.cr @@ -16,7 +16,6 @@ require "./plugins/memo" require "./plugins/wti_status" require "./plugins/hangman" require "./plugins/programming_excuses" -require "./plugins/debugging" bot = Framework::Bot.create do config.from_file "settings.json" @@ -38,7 +37,6 @@ bot = Framework::Bot.create do add_plugin WtiStatus add_plugin Hangman add_plugin ProgrammingExcuses - add_plugin Debugging end bot.start diff --git a/framework/src/framework/bot.cr b/framework/src/framework/bot.cr index f04eaff..b63fb55 100644 --- a/framework/src/framework/bot.cr +++ b/framework/src/framework/bot.cr @@ -13,9 +13,9 @@ require "./plugin" module Framework class Bot - getter config : Configuration # TODO: compiler bug requiring the annotation - getter! connection : IRC::Connection - property! user : User + getter config : Configuration + getter! connection : IRC::Connection + getter! user : User delegate channels, logger, to: config @filters : Array(Filter::Item) diff --git a/framework/src/framework/user.cr b/framework/src/framework/user.cr index 17555a7..42c8464 100644 --- a/framework/src/framework/user.cr +++ b/framework/src/framework/user.cr @@ -1,7 +1,15 @@ require "./bot" module Framework - record User, irc_user : IRC::User, context : Bot do + class User + getter irc_user + getter context + + def initialize(irc_user : IRC::User, context : Bot) + @irc_user = irc_user + @context = context + end + delegate mask, realname, nick, user, host, modes, to: irc_user def self.from_nick(nick : String, context : Bot)