diff options
author | Joe Rayhawk <jrayhawk+git@omgwallhack.org> | 2024-02-24 14:02:20 -0800 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@fairlystable.org> | 2024-02-27 03:14:33 -0800 |
commit | e04324d824a2e427c7229bd6b58006a26e16202f (patch) | |
tree | 33f5705fd9cbc9bb11f2df6076990f76e1236e71 /crystal/lib/bungmobott/src/bungmobott.cr | |
parent | 4c52796a73cfb981892a17eda3b570720d57794f (diff) | |
download | twitchtools-e04324d824a2e427c7229bd6b58006a26e16202f.tar.gz twitchtools-e04324d824a2e427c7229bd6b58006a26e16202f.zip |
crystal/tcpsocket: provide more command matching options in config
Diffstat (limited to 'crystal/lib/bungmobott/src/bungmobott.cr')
-rw-r--r-- | crystal/lib/bungmobott/src/bungmobott.cr | 13 |
1 files changed, 10 insertions, 3 deletions
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)] |