changed Args to String because we dont need that

This commit is contained in:
jude
2020-08-10 22:12:26 +01:00
parent 27c62e6ac2
commit f37bf23d9f
5 changed files with 69 additions and 47 deletions

View File

@ -7,15 +7,14 @@ use serenity::{
Message,
},
},
framework::standard::{
Args, CommandResult,
},
framework::standard::CommandResult,
};
use crate::THEME_COLOR;
#[command]
async fn help(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
async fn help(ctx: &Context, msg: &Message, _args: String) -> CommandResult {
msg.channel_id.send_message(ctx, |m| m
.embed(|e| e
.title("Help")
@ -28,7 +27,7 @@ async fn help(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
}
#[command]
async fn info(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
async fn info(ctx: &Context, msg: &Message, _args: String) -> CommandResult {
msg.channel_id.send_message(ctx, |m| m
.embed(|e| e
.title("Info")
@ -41,7 +40,7 @@ async fn info(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
}
#[command]
async fn donate(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
async fn donate(ctx: &Context, msg: &Message, _args: String) -> CommandResult {
msg.channel_id.send_message(ctx, |m| m
.embed(|e| e
.title("Donate")

View File

@ -0,0 +1,47 @@
use regex_command_attr::command;
use serenity::{
client::Context,
model::{
channel::{
Message,
},
},
framework::standard::CommandResult,
};
enum TodoTarget {
User,
Channel,
Guild,
}
impl TodoTarget {
fn from_str(string: &str) -> Option<Self> {
match string {
"user" => Some(Self::User),
"channel" => Some(Self::Channel),
"server" | "guild" => Some(Self::Guild),
_ => None
}
}
}
enum SubCommand {
View,
Add,
Remove,
Clear,
}
#[command]
async fn todo_parse(ctx: &Context, msg: &Message, args: String) -> CommandResult {
Ok(())
}
async fn todo(ctx: &Context, target: TodoTarget, subcommand: SubCommand) {
}