basic Lua 5.4 implementation with few example commands
This commit is contained in:
parent
11c2500d9c
commit
7440baa1b2
35 changed files with 2554 additions and 460 deletions
30
crates/jarvis-core/src/lua/structs.rs
Normal file
30
crates/jarvis-core/src/lua/structs.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
// 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,
|
||||
}
|
||||
|
||||
// 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 }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue