Skip to content

Commit

Permalink
Small cleanup and workaround codegen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonne Haß authored and jhass committed Feb 8, 2017
1 parent e733566 commit e5d1bfe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bot/settings.json.example
Expand Up @@ -28,7 +28,7 @@
//"realname": "CeBot",

"channels": [
"#cebot"
"##cebot"
],

// Valid levels: debug, info, warn, error, fatal
Expand All @@ -39,8 +39,8 @@

"plugins": {
"Admin": {
"superadmins": ["jhass"],
//"admins": ["asterite"]
//"admins": ["asterite"],
"superadmins": ["jhass"]
},

"Memo": {
Expand Down
2 changes: 0 additions & 2 deletions bot/src/main.cr
Expand Up @@ -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"
Expand All @@ -38,7 +37,6 @@ bot = Framework::Bot.create do
add_plugin WtiStatus
add_plugin Hangman
add_plugin ProgrammingExcuses
add_plugin Debugging
end

bot.start
6 changes: 3 additions & 3 deletions framework/src/framework/bot.cr
Expand Up @@ -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)

Expand Down
10 changes: 9 additions & 1 deletion 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)
Expand Down

0 comments on commit e5d1bfe

Please sign in to comment.