Skip to content

Commit

Permalink
Queen Amdi 3.5v Button Bot available now!💃🏻❤️
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackAmda committed Nov 22, 2021
1 parent 6a3205f commit 6f394eb
Show file tree
Hide file tree
Showing 73 changed files with 40,777 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"diffEditor.wordWrap": "on"
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @BlackAmda @SinhalayaCreator @Dinaaofficial @Sajiya2002 @JokaTamah
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions QA-SQ.js
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
};
33 changes: 33 additions & 0 deletions antech_modules/Base.js
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;
79 changes: 79 additions & 0 deletions antech_modules/Image.js
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;
78 changes: 78 additions & 0 deletions antech_modules/Message.js
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;
90 changes: 90 additions & 0 deletions antech_modules/ReplyMessage.js
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;
45 changes: 45 additions & 0 deletions antech_modules/StringSession.js
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;
Loading

0 comments on commit 6f394eb

Please sign in to comment.