simmsb/calamity

Command and Group system

Closed this issue · 0 comments

something that allows for constructing commands and groups in a nice way, something that looks like this maybe:

command @"ban" @'[Member, KleeneConcat Text] \member reason -> do
    print $ "banning member: " <> showt member <> ", with reason: " <> reason
    invoke $ CreateGuildBan (getID @Guild member) member def

pre-invokation checks could also be done, maybe something like:

requires [a, list, of_, checks] do
    command @"ban" @'[Member, KleeneConcat Text] \member reason -> do
        print $ "banning member: " <> showt member <> ", with reason: " <> reason
        invoke $ CreateGuildBan (getID @Guild member) member def

groups would then be similar:

group @"mod" do
    requires [a, list, of_, checks] do
        command @"ban" @'[Member, KleeneConcat Text] \member reason -> do
            print $ "banning member: " <> showt member <> ", with reason: " <> reason
            invoke $ CreateGuildBan (getID @Guild member) member def

Whether the names of groups/ commands needs to be a symbol or not I'll need to think about
it could possibly be used to prevent duplicate commands and groups at compile time I guess.