Add solve subcommand
This commit is contained in:
parent
ca92d9131a
commit
bde3f00ee4
1 changed files with 19 additions and 0 deletions
|
|
@ -51,11 +51,30 @@ const subcommands: {[index: string]: subcommand} = {
|
|||
method: `POST`,
|
||||
url: `/${meta.channel}/guess`,
|
||||
payload: {
|
||||
type: `letter`,
|
||||
guess: meta.args[1]
|
||||
}
|
||||
})).payload;
|
||||
},
|
||||
},
|
||||
"solve": {
|
||||
modOnly: false,
|
||||
async handler(meta, req) {
|
||||
|
||||
if (meta.args.length < 2) {
|
||||
return `You need to provide a solution if you want to solve!`;
|
||||
};
|
||||
|
||||
return (await req.server.inject({
|
||||
method: `POST`,
|
||||
url: `/${meta.channel}/guess`,
|
||||
payload: {
|
||||
type: `solve`,
|
||||
guess: meta.args.slice(1).join(` `)
|
||||
}
|
||||
})).payload;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const route: ServerRoute = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue