forked from lasiyaWA/X-Troid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* # Exclusively from danuma project | ||
# Do not use this fore any commercial thing | ||
# If you abuse thais bot we wil kick you from bot | ||
# Do not edit (Respect to the Devaoloper) | ||
# All rights reserved ©Lasiya @lasiya99X t.me/lasiya99X | ||
const Asena = require('../events'); | ||
const {MessageType} = require('@adiwajshing/baileys'); | ||
const sql = require('./sql/greetings'); | ||
const Language = require('../language'); | ||
const Lang = Language.getString('greetings'); | ||
Asena.addCommand({pattern: 'welcome$', fromMe: true, desc: Lang.WELCOME_DESC}, (async (message, match) => { | ||
var hg = await sql.getMessage(message.jid); | ||
if (hg === false) { | ||
await message.client.sendMessage(message.jid,Lang.NOT_SET_WELCOME,MessageType.text); | ||
} else { | ||
await message.client.sendMessage(message.jid,Lang.WELCOME_ALREADY_SETTED + hg.message + '```',MessageType.text); | ||
} | ||
})); | ||
Asena.addCommand({pattern: 'welcome (.*)', fromMe: true, dontAddCommandList: true}, (async (message, match) => { | ||
if (match[1] === '') { | ||
return await message.client.sendMessage(message.jid,Lang.NEED_WELCOME_TEXT); | ||
} else { | ||
if (match[1] === 'delete') { await message.client.sendMessage(message.jid,Lang.WELCOME_DELETED,MessageType.text); return await sql.deleteMessage(message.jid, 'welcome'); } | ||
await sql.setMessage(message.jid, 'welcome', match[1].replace(/#/g, '\n')); | ||
return await message.client.sendMessage(message.jid,Lang.WELCOME_SETTED,MessageType.text) | ||
} | ||
})); | ||
Asena.addCommand({pattern: 'goodbye$', fromMe: true, desc: Lang.GOODBYE_DESC}, (async (message, match) => { | ||
var hg = await sql.getMessage(message.jid, 'goodbye'); | ||
if (hg === false) { | ||
await message.client.sendMessage(message.jid,Lang.NOT_SET_GOODBYE,MessageType.text) | ||
} else { | ||
await message.client.sendMessage(message.jid,Lang.GOODBYE_ALREADY_SETTED + hg.message + '```',MessageType.text); | ||
} | ||
})); | ||
Asena.addCommand({pattern: 'goodbye (.*)', fromMe: true, dontAddCommandList: true}, (async (message, match) => { | ||
if (match[1] === '') { | ||
return await message.client.sendMessage(message.jid,Lang.NEED_GOODBYE_TEXT,MessageType.text); | ||
} else { | ||
if (match[1] === 'delete') { await message.client.sendMessage(message.jid,Lang.GOODBYE_DELETED,MessageType.text); return await sql.deleteMessage(message.jid, 'goodbye'); } | ||
await sql.setMessage(message.jid, 'goodbye', match[1].replace(/#/g, '\n')); | ||
return await message.client.sendMessage(message.jid,Lang.GOODBYE_SETTED,MessageType.text) | ||
} | ||
})); | ||
# Get more about devaoloper https://lasiya.ml | ||
*/ |