-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwelcome.js
More file actions
25 lines (23 loc) 路 1.3 KB
/
Copy pathwelcome.js
File metadata and controls
25 lines (23 loc) 路 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require('fs-extra')
module.exports = welcome = async (client, event) => {
//console.log(event.action)
const welkom = JSON.parse(fs.readFileSync('./lib/welcome.json'))
const isWelkom = welkom.includes(event.chat)
try {
if (event.action == 'add' && isWelkom) {
const gChat = await client.getChatById(event.chat)
const pChat = await client.getContact(event.who)
const { contact, groupMetadata, name } = gChat
const pepe = await client.getProfilePicFromServer(event.who)
const capt = `Halo @${event.who.replace('@c.us', '')} 馃憢\nSelamat datang di *Grup ${name}*\n鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺怽nSelamat bergabung dan juga semoga betah disini.\n鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺怽n`
if (pepe == '' || pepe == undefined) {
await client.sendFileFromUrl(event.chat, 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTQcODjk7AcA4wb_9OLzoeAdpGwmkJqOYxEBA&usqp=CAU', 'profile.jpg', capt)
} else {
await client.sendFileFromUrl(event.chat, pepe, 'profile.jpg')
client.sendTextWithMentions(event.chat, capt)
}
}
} catch (err) {
console.log(err)
}
}