From e04324d824a2e427c7229bd6b58006a26e16202f Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Sat, 24 Feb 2024 14:02:20 -0800 Subject: crystal/tcpsocket: provide more command matching options in config --- crystal/lib/bungmobott/src/bungmobott.cr | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crystal/lib/bungmobott/src') diff --git a/crystal/lib/bungmobott/src/bungmobott.cr b/crystal/lib/bungmobott/src/bungmobott.cr index 4fdb9d2..3df034f 100644 --- a/crystal/lib/bungmobott/src/bungmobott.cr +++ b/crystal/lib/bungmobott/src/bungmobott.cr @@ -13,11 +13,15 @@ #chat_user: # twitch: bungmonkey # gamesurge: bungmoBott +#match: +# '^gamesurge|twitch$' +# '^#bungmonkey$' +# '^!help$': [ { perm: [ any ], func: say, arg: ['| https://bungmonkey.omgwallhack.org/txt/commands.txt'] } ] module BungmoBott EXE = "bungmobott" - + class ChatUser include YAML::Serializable include YAML::Serializable::Unmapped @@ -49,7 +53,7 @@ module BungmoBott property twitch : Array(String)? property gamesurge : Array(String)? end - + class Config include YAML::Serializable include YAML::Serializable::Unmapped @@ -74,7 +78,10 @@ module BungmoBott property obs_connect : String? = nil property chat_user : ChatUser? = ChatUser.from_yaml("---") property join_channels : JoinChannels? = JoinChannels.from_yaml("---") - property commands : Hash( String, Array( Commands ) )? = nil + property match : Hash( String, # network regex + Hash( String, # channel regex + Hash( String, # text regex + Array( Commands ) ) ) )? @[YAML::Field(emit_null: true)] property twitch_user_id : UInt32? = nil @[YAML::Field(emit_null: true)] -- cgit v1.2.3