diff options
| author | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
| commit | 9742614a1dc4699c1f2c69d923d402237672335d (patch) | |
| tree | a49f7d834372f37cef06b30a28ff1b40bdfaa079 /src/modules/commands/owners/log.rs | |
| parent | Create README.md (diff) | |
| download | dep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.tar.xz dep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.zip | |
repo: push main from local to remote
Diffstat (limited to 'src/modules/commands/owners/log.rs')
| -rw-r--r-- | src/modules/commands/owners/log.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/commands/owners/log.rs b/src/modules/commands/owners/log.rs new file mode 100644 index 0000000..67a8156 --- /dev/null +++ b/src/modules/commands/owners/log.rs @@ -0,0 +1,27 @@ +use std::path::Path; +use serenity::framework::standard::{ + Args, + Command, + CommandError, + CommandOptions +}; +use serenity::model::channel::Message; +use serenity::prelude::Context; +use std::sync::Arc; + +pub struct Log; +impl Command for Log { + fn options(&self) -> Arc<CommandOptions> { + let default = CommandOptions::default(); + let options = CommandOptions { + owners_only: true, + ..default + }; + Arc::new(options) + } + + fn execute(&self, _: &mut Context, message: &Message, _: Args) -> Result<(), CommandError> { + message.channel_id.send_files(vec![Path::new("./output.log")], |m| m)?; + Ok(()) + } +} |