implement the rest of the config commands

This commit is contained in:
dusk 2025-10-04 19:32:58 +00:00
parent a268f75d32
commit 0f26a69f1b
No known key found for this signature in database
11 changed files with 480 additions and 296 deletions

View file

@ -276,6 +276,7 @@ fn get_param_ty(kind: ParameterKind) -> &'static str {
ParameterKind::MessageRef => "Message.Reference",
ParameterKind::ChannelRef => "Channel",
ParameterKind::GuildRef => "Guild",
ParameterKind::ProxySwitchAction => "SystemConfig.ProxySwitchAction",
}
}
@ -298,6 +299,7 @@ fn get_param_param_ty(kind: ParameterKind) -> &'static str {
ParameterKind::MessageRef => "Message",
ParameterKind::ChannelRef => "Channel",
ParameterKind::GuildRef => "Guild",
ParameterKind::ProxySwitchAction => "ProxySwitchAction",
}
}

View file

@ -25,6 +25,7 @@ interface Parameter {
OpaqueInt(i32 raw);
Toggle(boolean toggle);
Avatar(string avatar);
ProxySwitchAction(string action);
Null();
};
dictionary ParsedCommand {

View file

@ -75,6 +75,9 @@ pub enum Parameter {
Avatar {
avatar: String,
},
ProxySwitchAction {
action: String,
},
Null,
}
@ -103,6 +106,9 @@ impl From<ParameterValue> for Parameter {
ParameterValue::ChannelRef(channel_id) => Self::ChannelRef { channel_id },
ParameterValue::GuildRef(guild_id) => Self::GuildRef { guild_id },
ParameterValue::Null => Self::Null,
ParameterValue::ProxySwitchAction(action) => Self::ProxySwitchAction {
action: action.as_ref().to_string(),
},
}
}
}