-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Queen Amdi 3.5v Button Bot available now!💃🏻❤️
- Loading branch information
Showing
73 changed files
with
40,777 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,3 @@ | ||
{ | ||
"diffEditor.wordWrap": "on" | ||
} |
Validating CODEOWNERS rules …
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 @@ | ||
* @BlackAmda @SinhalayaCreator @Dinaaofficial @Sajiya2002 @JokaTamah |
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,5 @@ | ||
module.exports = { | ||
QUEEN_AMDI_OWNER: '94757405652', // Black Amda - Queen Amdi Owner | ||
QUEEN_AMDI_TEAM: '94719077818,94757672873,94774976567,94766426385,94711870791', // Team - Queen Amdi TEAM | ||
SEW_QUEEN_OWNER: '94785435462' // Ravindu Manoj - Sew Queen Owner --> For The Friendship | ||
}; |
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,33 @@ | ||
/* | ||
░██████╗░██╗░░░██╗███████╗███████╗███╗░░██╗ | ||
██╔═══██╗██║░░░██║██╔════╝██╔════╝████╗░██║ | ||
██║██╗██║██║░░░██║█████╗░░█████╗░░██╔██╗██║ | ||
╚██████╔╝██║░░░██║██╔══╝░░██╔══╝░░██║╚████║ | ||
░╚═██╔═╝░╚██████╔╝███████╗███████╗██║░╚███║ | ||
░░░╚═╝░░░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚══╝ | ||
░█████╗░███╗░░░███╗██████╗░██╗ | ||
██╔══██╗████╗░████║██╔══██╗██║ | ||
███████║██╔████╔██║██║░░██║██║ | ||
██╔══██║██║╚██╔╝██║██║░░██║██║ █▀█ █▀▀█ █▀█ ▄█─ | ||
██║░░██║██║░╚═╝░██║██████╔╝██║ ─▄▀ █▄▀█ ─▄▀ ─█─ | ||
╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═════╝░╚═╝ █▄▄ █▄▄█ █▄▄ ▄█▄ | ||
Copyright (C) 2021 Black Amda. | ||
Licensed under the GPL-3.0 License; | ||
you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
class Base { | ||
constructor(client) { | ||
Object.defineProperty(this, 'client', { value: client }); | ||
} | ||
|
||
_clone() { | ||
return Object.assign(Object.create(this), this); | ||
} | ||
|
||
_patch(data) { return data; } | ||
} | ||
|
||
module.exports = Base; |
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,79 @@ | ||
/* | ||
░██████╗░██╗░░░██╗███████╗███████╗███╗░░██╗ | ||
██╔═══██╗██║░░░██║██╔════╝██╔════╝████╗░██║ | ||
██║██╗██║██║░░░██║█████╗░░█████╗░░██╔██╗██║ | ||
╚██████╔╝██║░░░██║██╔══╝░░██╔══╝░░██║╚████║ | ||
░╚═██╔═╝░╚██████╔╝███████╗███████╗██║░╚███║ | ||
░░░╚═╝░░░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚══╝ | ||
░█████╗░███╗░░░███╗██████╗░██╗ | ||
██╔══██╗████╗░████║██╔══██╗██║ | ||
███████║██╔████╔██║██║░░██║██║ | ||
██╔══██║██║╚██╔╝██║██║░░██║██║ █▀█ █▀▀█ █▀█ ▄█─ | ||
██║░░██║██║░╚═╝░██║██████╔╝██║ ─▄▀ █▄▀█ ─▄▀ ─█─ | ||
╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═════╝░╚═╝ █▄▄ █▄▄█ █▄▄ ▄█▄ | ||
Copyright (C) 2021 Black Amda. | ||
Licensed under the GPL-3.0 License; | ||
you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
const {MessageType, Presence, MessageOptions} = require('@blackamda/queenamdi-web-api'); | ||
const Base = require('./Base'); | ||
const Message = require('./Message'); | ||
const ReplyMessage = require('./ReplyMessage'); | ||
|
||
class Image extends Base { | ||
constructor(client, data) { | ||
super(client); | ||
if (data) this._patch(data); | ||
} | ||
|
||
_patch(data) { | ||
this.id = data.key.id === undefined ? undefined : data.key.id; | ||
this.jid = data.key.remoteJid; | ||
this.fromMe = data.key.fromMe; | ||
this.caption = data.message.imageMessage.caption === null ? data.message.imageMessage.caption : ''; | ||
this.url = data.message.imageMessage.url; | ||
this.timestamp = typeof(data.messageTimestamp) === 'object' ? data.messageTimestamp.low : data.messageTimestamp; | ||
this.mimetype = data.message.imageMessage.mimetype; | ||
this.height = data.message.imageMessage.height; | ||
this.width = data.message.imageMessage.width; | ||
this.mediaKey = data.message.imageMessage.mediaKey; | ||
this.data = data; | ||
|
||
if (data.message.imageMessage.hasOwnProperty('contextInfo') && data.message.contextInfo.quotedMessage) { | ||
this.reply_message = new ReplyMessage(this.client, data.message.imageMessage.contextInfo); } | ||
else { | ||
this.reply_message = false; | ||
} | ||
|
||
return super._patch(data); | ||
} | ||
|
||
async delete() { | ||
return await this.client.deleteMessage(this.jid, {id: this.id, remoteJid: this.jid, fromMe: true}) | ||
} | ||
|
||
async reply(text) { | ||
var message = await this.client.sendMessage(this.jid, text, MessageType.text, {quoted: this.data}) | ||
return new Message(this.client, message) | ||
} | ||
|
||
async sendMessage(content, type, options) { | ||
return await this.client.sendMessage(this.jid, content, type, options) | ||
} | ||
|
||
async sendTyping() { | ||
return await this.client.updatePresence(this.jid, Presence.composing) ; | ||
} | ||
|
||
async sendRead() { | ||
return await this.client.chatRead(this.jid); | ||
} | ||
|
||
async download(location = this.id) { | ||
await this.client.downloadAndSaveMediaMessage(this.data, location); | ||
return this.id + '.' + this.mimetype.split('/')[1]; | ||
} | ||
}; | ||
|
||
module.exports = Image; |
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,78 @@ | ||
/* | ||
░██████╗░██╗░░░██╗███████╗███████╗███╗░░██╗ | ||
██╔═══██╗██║░░░██║██╔════╝██╔════╝████╗░██║ | ||
██║██╗██║██║░░░██║█████╗░░█████╗░░██╔██╗██║ | ||
╚██████╔╝██║░░░██║██╔══╝░░██╔══╝░░██║╚████║ | ||
░╚═██╔═╝░╚██████╔╝███████╗███████╗██║░╚███║ | ||
░░░╚═╝░░░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚══╝ | ||
░█████╗░███╗░░░███╗██████╗░██╗ | ||
██╔══██╗████╗░████║██╔══██╗██║ | ||
███████║██╔████╔██║██║░░██║██║ | ||
██╔══██║██║╚██╔╝██║██║░░██║██║ █▀█ █▀▀█ █▀█ ▄█─ | ||
██║░░██║██║░╚═╝░██║██████╔╝██║ ─▄▀ █▄▀█ ─▄▀ ─█─ | ||
╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═════╝░╚═╝ █▄▄ █▄▄█ █▄▄ ▄█▄ | ||
Copyright (C) 2021 Black Amda. | ||
Licensed under the GPL-3.0 License; | ||
you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
const {MessageType, Presence, MessageOptions} = require('@blackamda/queenamdi-web-api'); | ||
const Base = require('./Base'); | ||
const ReplyMessage = require('./ReplyMessage'); | ||
|
||
class Message extends Base { | ||
constructor(client, data) { | ||
super(client); | ||
if (data) this._patch(data); | ||
} | ||
|
||
_patch(data) { | ||
this.id = data.key.id === undefined ? undefined : data.key.id; | ||
this.jid = data.key.remoteJid; | ||
this.fromMe = data.key.fromMe; | ||
this.message = data.message.extendedTextMessage === null ? data.message.conversation : data.message.extendedTextMessage.text; | ||
this.unreadCount = data.unreadCount; | ||
this.timestamp = typeof(data.messageTimestamp) === 'object' ? data.messageTimestamp.low : data.messageTimestamp; | ||
this.data = data; | ||
|
||
if (data.message.hasOwnProperty('extendedTextMessage') && | ||
data.message.extendedTextMessage.hasOwnProperty('contextInfo') === true && | ||
data.message.extendedTextMessage.contextInfo.hasOwnProperty('quotedMessage')) { | ||
this.reply_message = new ReplyMessage(this.client, data.message.extendedTextMessage.contextInfo); } else { | ||
this.reply_message = false; | ||
} | ||
|
||
if (data.message.hasOwnProperty('extendedTextMessage') && | ||
data.message.extendedTextMessage.hasOwnProperty('contextInfo') === true && | ||
data.message.extendedTextMessage.contextInfo.hasOwnProperty('mentionedJid')) { | ||
this.mention = data.message.extendedTextMessage.contextInfo.mentionedJid; | ||
} else { | ||
this.mention = false; | ||
} | ||
|
||
return super._patch(data); | ||
} | ||
|
||
async delete() { | ||
return await this.client.deleteMessage(this.jid, {id: this.id, remoteJid: this.jid, fromMe: true}) | ||
} | ||
|
||
async reply(text) { | ||
var message = await this.client.sendMessage(this.jid, text, MessageType.text); | ||
return new Message(this.client, message) | ||
} | ||
|
||
async sendMessage(content, type = MessageType.text, options) { | ||
return await this.client.sendMessage(this.jid, content, type, options) | ||
} | ||
|
||
async sendTyping() { | ||
return await this.client.updatePresence(this.jid, Presence.composing) ; | ||
} | ||
|
||
async sendRead() { | ||
return await this.client.chatRead(this.jid); | ||
} | ||
}; | ||
|
||
module.exports = Message; |
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,90 @@ | ||
/* | ||
░██████╗░██╗░░░██╗███████╗███████╗███╗░░██╗ | ||
██╔═══██╗██║░░░██║██╔════╝██╔════╝████╗░██║ | ||
██║██╗██║██║░░░██║█████╗░░█████╗░░██╔██╗██║ | ||
╚██████╔╝██║░░░██║██╔══╝░░██╔══╝░░██║╚████║ | ||
░╚═██╔═╝░╚██████╔╝███████╗███████╗██║░╚███║ | ||
░░░╚═╝░░░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚══╝ | ||
░█████╗░███╗░░░███╗██████╗░██╗ | ||
██╔══██╗████╗░████║██╔══██╗██║ | ||
███████║██╔████╔██║██║░░██║██║ | ||
██╔══██║██║╚██╔╝██║██║░░██║██║ █▀█ █▀▀█ █▀█ ▄█─ | ||
██║░░██║██║░╚═╝░██║██████╔╝██║ ─▄▀ █▄▀█ ─▄▀ ─█─ | ||
╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═════╝░╚═╝ █▄▄ █▄▄█ █▄▄ ▄█▄ | ||
Copyright (C) 2021 Black Amda. | ||
Licensed under the GPL-3.0 License; | ||
you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
const {MessageType, Presence, MessageOptions} = require('@blackamda/queenamdi-web-api'); | ||
const Base = require('./Base'); | ||
const Image = require('./Image'); | ||
|
||
class ReplyMessage extends Base { | ||
constructor(client, data) { | ||
super(client); | ||
if (data) this._patch(data); | ||
} | ||
|
||
_patch(data) { | ||
this.id = data.stanzaId; | ||
this.jid = data.participant; | ||
if (data.quotedMessage && data.quotedMessage.imageMessage) { | ||
this.message = data.quotedMessage.imageMessage.caption === null ? data.message.imageMessage.caption : ''; | ||
this.caption = data.quotedMessage.imageMessage.caption === null ? data.message.imageMessage.caption : ''; | ||
this.url = data.quotedMessage.imageMessage.url; | ||
this.mimetype = data.quotedMessage.imageMessage.mimetype; | ||
this.height = data.quotedMessage.imageMessage.height; | ||
this.width = data.quotedMessage.imageMessage.width; | ||
this.mediaKey = data.quotedMessage.imageMessage.mediaKey; | ||
this.image = true; | ||
this.video = false; | ||
} else if (data.quotedMessage && data.quotedMessage.videoMessage) { | ||
this.message = data.quotedMessage.videoMessage.caption === null ? data.message.videoMessage.caption : ''; | ||
this.caption = data.quotedMessage.videoMessage.caption === null ? data.message.videoMessage.caption : ''; | ||
this.url = data.quotedMessage.videoMessage.url; | ||
this.mimetype = data.quotedMessage.videoMessage.mimetype; | ||
this.height = data.quotedMessage.videoMessage.height; | ||
this.width = data.quotedMessage.videoMessage.width; | ||
this.mediaKey = data.quotedMessage.videoMessage.mediaKey; | ||
this.video = true; | ||
} else if (data.quotedMessage && data.quotedMessage.conversation) { | ||
this.message = data.quotedMessage.conversation; | ||
this.text = data.quotedMessage.conversation; | ||
this.image = false; | ||
this.video = false; | ||
} | ||
|
||
this.data = data; | ||
|
||
return super._patch(data); | ||
} | ||
|
||
async delete() { | ||
return await this.client.deleteMessage(this.jid, {id: this.id, remoteJid: this.jid, fromMe: true}); | ||
} | ||
|
||
async reply(text) { | ||
var message = await this.client.sendMessage(this.jid, text, MessageType.text, {quoted: this.data}); | ||
return new Message(this.client, message) | ||
} | ||
|
||
async sendMessage(content, type, options) { | ||
return await this.client.sendMessage(this.jid, content, type, options); | ||
} | ||
|
||
async sendTyping() { | ||
return await this.client.updatePresence(this.jid, Presence.composing); | ||
} | ||
|
||
async download(location = this.id) { | ||
if (this.image) { | ||
await this.client.downloadAndSaveMediaMessage(this.data.quotedMessage.imageMessage, location); | ||
return this.id + '.' + this.mimetype.split('/')[1]; | ||
} else { | ||
return false; | ||
} | ||
} | ||
}; | ||
|
||
module.exports = ReplyMessage; |
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,45 @@ | ||
/* | ||
░██████╗░██╗░░░██╗███████╗███████╗███╗░░██╗ | ||
██╔═══██╗██║░░░██║██╔════╝██╔════╝████╗░██║ | ||
██║██╗██║██║░░░██║█████╗░░█████╗░░██╔██╗██║ | ||
╚██████╔╝██║░░░██║██╔══╝░░██╔══╝░░██║╚████║ | ||
░╚═██╔═╝░╚██████╔╝███████╗███████╗██║░╚███║ | ||
░░░╚═╝░░░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚══╝ | ||
░█████╗░███╗░░░███╗██████╗░██╗ | ||
██╔══██╗████╗░████║██╔══██╗██║ | ||
███████║██╔████╔██║██║░░██║██║ | ||
██╔══██║██║╚██╔╝██║██║░░██║██║ █▀█ █▀▀█ █▀█ ▄█─ | ||
██║░░██║██║░╚═╝░██║██████╔╝██║ ─▄▀ █▄▀█ ─▄▀ ─█─ | ||
╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═════╝░╚═╝ █▄▄ █▄▄█ █▄▄ ▄█▄ | ||
Copyright (C) 2021 Black Amda. | ||
Licensed under the GPL-3.0 License; | ||
you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
const fs = require('fs'); | ||
|
||
class StringSession { | ||
constructor() { | ||
} | ||
|
||
deCrypt(string = undefined) { | ||
if ('AMDI_SESSION' in process.env && string === undefined) { | ||
string = process.env.STRING_SESSION; | ||
} else if (string !== undefined) { | ||
if (fs.existsSync(string)) { | ||
string = fs.readFileSync(string, {encoding:'utf8', flag:'r'}); | ||
} | ||
} | ||
|
||
var split = string.split(';;;'); | ||
if (split.length >= 2) { | ||
return JSON.parse(Buffer.from(split[split.length - 1], 'base64').toString('utf-8')); | ||
} | ||
} | ||
|
||
createStringSession(dict) { | ||
return 'AMDI;;;' + Buffer.from(JSON.stringify(dict)).toString('base64'); | ||
} | ||
} | ||
|
||
module.exports = StringSession; |
Oops, something went wrong.