Open wholesomegarden opened 3 years ago
FOUND SOLUTION working code from open-wa
(need to add code in init and in wapi.js) https://github.com/open-wa/wa-automate-python/blob/master/src/__init__.py https://github.com/open-wa/wa-automate-python/blob/master/src/js/wapi.js
in init.py
def set_group_icon(self, group_id, imagepath):
image = self.convert_to_base64(imagepath)
return self.wapi_functions.setGroupIcon(group_id, image)
in wapi.js
/** Change the icon for the group chat
* @param groupId 123123123123_1312313123@g.us The id of the group
* @param imgData 'data:image/jpeg;base64,...` The base 64 data uri
* @returns boolean true if it was set, false if it didn't work. It usually doesn't work if the image file is too big.
*/
window.WAPI.setGroupIcon = async function(groupId, imgData) {
const {status} = await Store.WapQuery.sendSetPicture(groupId,imgData,imgData);
return status==200;
}
hello i'm trying to do with: but only this error: exception log: Error in function sendContact (TypeError: window.WAPI.getChat(...).sendContact is not a function). Command: return WAPI.sendContact('558694434027@c.us','558694518432@c.us', arguments[0])
see source:
def send_contact(self, chat_id, contact_ids):
return self.wapi_functions.sendContact(chat_id, contact_ids)
window.WAPI.sendContact = async function (to, contact) { if (!Array.isArray(contact)) { contact = [contact]; } contact = contact.map((c) => { return WAPI.getChat(c).__x_contact; });
if (contact.length > 1) {
window.WAPI.getChat(to).sendContactList(contact);
} else if (contact.length === 1) {
window.WAPI.getChat(to).sendContact(contact[0]);
}
};
Hi there, I've already posted in #983 on how i managed to create a group with a contact Still trying to figure out how to add an icon to the group looking for a solution that works on Linux Firefox AND Linux Chrome HEADLESS
hope someone could help :pray: also i've managed to grab the invite link while opening a group, lemme know if anyone's interested :)