24 lines
708 B
JavaScript
Raw Normal View History

2025-03-16 15:02:23 +01:00
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;
};