2026-02-11 07:21:50 +05:00
|
|
|
use std::{collections::HashMap, path::PathBuf};
|
|
|
|
|
|
|
|
|
|
use crate::commands::SlotValue;
|
2026-01-17 05:46:38 +05:00
|
|
|
|
|
|
|
|
// Context passed to Lua scripts
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub struct CommandContext {
|
|
|
|
|
// The phrase that triggered the command
|
|
|
|
|
pub phrase: String,
|
|
|
|
|
|
|
|
|
|
// Command ID
|
|
|
|
|
pub command_id: String,
|
|
|
|
|
|
|
|
|
|
// Path to command folder
|
|
|
|
|
pub command_path: PathBuf,
|
|
|
|
|
|
|
|
|
|
// Current language
|
|
|
|
|
pub language: String,
|
2026-02-11 07:21:50 +05:00
|
|
|
|
|
|
|
|
// Slots
|
|
|
|
|
pub slots: Option<HashMap<String, SlotValue>>
|
2026-01-17 05:46:38 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Result returned from Lua script execution
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub struct CommandResult {
|
|
|
|
|
// Whether to continue chaining commands
|
|
|
|
|
pub chain: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for CommandResult {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self { chain: true }
|
|
|
|
|
}
|
|
|
|
|
}
|