Copy const { alwaysReply , checkContains } = require ( 'mvk-project' );
module . exports = alwaysReply ({
action : async (message) => {
const authorId = message . author .id;
const result = checkContains ({
text : message .content ,
keywords : [ 'hi' , 'hello' ]
});
if (result) {
message .reply ( `Hi <@ ${ authorId } >!` );
}
}
});
Copy const { newSlashCommand , slashOption , checkContains } = require ( 'mvk-project' );
module . exports = newSlashCommand ({
name : 'test-command' ,
description : 'Test command' ,
options : [
{
type : 'STRING' ,
name : 'text' ,
description : 'Text for check.' ,
required : true
}
] ,
code : async function (interaction) {
const authorId = interaction . user .id;
const msg = slashOption (interaction , 'text' );
const result = checkContains ({
text : msg ,
keywords : [ 'hi' , 'hello' ]
});
if (result) {
await interaction .reply ( `Hi <@ ${ authorId } >!` );
}
}
});
Copy const { newCommand , checkContains } = require ( 'mvk-project' );
newCommand ({
name : 'test-command' ,
code : async function (message) {
const authorId = message . author .id;
const result = checkContains ({
text : message .content ,
keywords : [ 'hi' , 'hello' ]
});
if (result) {
message .reply ( `Hi <@ ${ authorId } >!` );
}
}
});