24 lines
708 B
JavaScript
24 lines
708 B
JavaScript
|
|
const helptext = `The \`!ping\` command can be used to check if NeverSteam v2 is running, it ignores any arguments given.`;
|
||
|
|
|
||
|
|
function ping(context) {
|
||
|
|
return new Promise((resolve, reject) => {
|
||
|
|
if(context.isHelpRequest) {
|
||
|
|
context.message.reply(helptext)
|
||
|
|
.then(() => {
|
||
|
|
console.info(`[${context.id}] ? ping`)
|
||
|
|
resolve();
|
||
|
|
}).catch(err => reject(err));
|
||
|
|
} else {
|
||
|
|
context.message.reply(`[${context.id}] ECHO`)
|
||
|
|
.then(() => {
|
||
|
|
console.info(`[${context.id}] PING -> ECHO [${context.pid}]`)
|
||
|
|
resolve();
|
||
|
|
}).catch(err => reject(err));
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = commands => {
|
||
|
|
commands.ping = ping;
|
||
|
|
};
|