feat: basic hello command

This commit is contained in:
Daniel Bulant 2021-04-27 15:28:34 +02:00
parent c815e4bc19
commit f8a42fefec
5 changed files with 38 additions and 0 deletions

4
.gitignore vendored
View file

@ -15,6 +15,10 @@ pids
*.seed
*.pid.lock
# Locks
package-lock.json
pnpm-lock.yaml
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

View file

@ -1,2 +1,5 @@
# igni-module
Sample custom module for igni
Commands in `commands`, services in `services`.

21
commands/hello.js Normal file
View file

@ -0,0 +1,21 @@
const commando = require("@iceprod/discord.js-commando");
module.exports = class hello extends commando.Command {
constructor(client) {
super(client, {
name: "hello",
memberName: "hello",
group: "commands",
description: "Say hello",
args: [{
key: "user",
type: "user",
prompt: "What's the user you want to say hello to?"
}]
});
}
run(msg, { user }) {
return msg.say("Hello " + user.username);
}
};

5
module.json Normal file
View file

@ -0,0 +1,5 @@
{
"name": "hello-world",
"display_name": "Hello world",
"lang": "node"
}

5
package.json Normal file
View file

@ -0,0 +1,5 @@
{
"dependencies": {
"@iceprod/discord.js-commando": "^0.14.4"
}
}