#--- #statedir: /home/jrayhawk/.local/state/bungmobott/ #tempdir: /tmp/bungmobott/ #listen: 0.0.0.0:5555 #join_channels: # twitch: # - bungmonkey # - dopefish # # - yackamov # gamesurge: # - bungmonkey #twitch_user_id: 59895482 # saves a lookup #chat_user: # twitch: bungmonkey # gamesurge: bungmoBott module BungmoBott EXE = "bungmobott" class ChatUser include YAML::Serializable include YAML::Serializable::Unmapped property twitch : String? property gamesurge : String? end # Do we turn this into a class? Maybe an Enum? # class Permissions # include YAML::Serializable # include YAML::Serializable::Unmapped # property any # property sub # property mod # property vip # end class Commands include YAML::Serializable include YAML::Serializable::Unmapped property perm : Array( String )? = nil property func : String property arg : Array( String )? = nil end class JoinChannels include YAML::Serializable include YAML::Serializable::Unmapped property twitch : Array(String)? property gamesurge : Array(String)? end class Config include YAML::Serializable include YAML::Serializable::Unmapped property statedir : String = ( ENV["LOCALAPPDATA"]? && Path.windows( ENV["LOCALAPPDATA"] + "\\#{EXE}\\state\\" ).to_s || ENV["XDG_STATE_HOME"]? && ENV["XDG_STATE_HOME"] + "/#{EXE}/" || Path.home./(".local/state/#{EXE}").to_s ) property tempdir : String = ( ENV["TEMP"]? && ENV["TEMP"] + "\\#{EXE}\\" || "/tmp/#{EXE}/" ) property rundir : String = ( ENV["XDG_RUNTIME_DIR"]? && ENV["XDG_RUNTIME_DIR"] + "/#{EXE}/" || "/tmp/#{EXE}/" ) # FIXME: do sockets and such even work on Windows? # Should probably warn about that somewhere around here. #@[YAML::Field(emit_null: true)] property bungmobott_listen : String? = nil property bungmobott_connect : String? = nil #@[YAML::Field(emit_null: true)] 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 @[YAML::Field(emit_null: true)] property twitch_user_id : UInt32? = nil @[YAML::Field(emit_null: true)] property voice_list : String? = nil # def after_initialize() # if @voice_list? # # @voice_list = @statedir + "/voices.txt" # end # end end class Secrets include YAML::Serializable include YAML::Serializable::Unmapped @[YAML::Field(emit_null: true)] property twitch_access_token : String? @[YAML::Field(emit_null: true)] property twitch_client_id : String? @[YAML::Field(emit_null: true)] property gcloud_token : String? @[YAML::Field(emit_null: true)] property gamesurge_password : String? @[YAML::Field(emit_null: true)] property obs_password : String? @[YAML::Field(emit_null: true)] property bungmobott_key : String? end end