Recriando o evryone do discord no whatsapp [closed] - whatsapp

Closed. This question is not written in English. It is not currently accepting answers.
Stack Overflow is an English-only site. The author must be able to communicate in English to understand and engage with any comments and/or answers their question receives. Don't translate this post for the author; machine translations can be inaccurate, and even human translations can alter the intended meaning of the post.
Closed 3 days ago.
Improve this question
Eu estou tentado adaptar o !everyone do discord em bot do whats, só que não sei como e não cho nada sobre. o problema é só em ocultar tudo, já está marcando normal.
Esse é uma parte do meu código;
client.on("ready", async () => {
console.log("Conexão feita! Valeu boy.");
client.on('message', async (msg) => {
if (msg.body === '!everyone') {
const chat = await msg.getChat();
let text = "";
let mentions = [];
for (let participant of chat.participants) {
const contact = await client.getContactById(participant.id._serialized);
mentions.push(contact);
text += `#${participant.id.user} `;
}
await chat.sendMessage(text, { mentions });
}
});
});

Related

Diplay loading indicator for FullCalendar and Vuejs

is there a way to display a loading indicator on FullCalendar 5 and VueJS ?
https://fullcalendar.io/docs/loading
I checked the documentation and it states it works via AJAX request, but don't say anything about other technologies.
Is there any way to have something similar and easy to implement ?
Regards.
When i get my agendas entries, i update my calendars with the events.
entreesAgenda() {
// Ajout des evenements dans le(s) calendrier(s)
let entrees = []
if (this.entreesAgenda) {
for (let i = 0; i < this.utilisateurs.length; i++) {
entrees = this.data.items.filter(
(f) => f.idPersonnel === this.utilisateurs[i].id
)
// Mise à jour des businessHours
this.$refs.utilisateur[i]
.getApi()
.setOption('businessHours', this.calculBusinessHours(entrees))
// Insertion des entrees d'agenda dans le calendrier
for (let m = 0; m < entrees.length; m++) {
this.$refs.utilisateur[i].getApi().addEvent(entrees[m])
}
}
}
this.updateView()
},
But i don't know how to use the loading.

import binance api data into google sheet

I'm just a newbie trying to import raw binance api data into a google sheet. I tried using Mixed Analytics API Connector but the result is usually "completed with errors". And the support team suggestions didn't help at all with the end result still the same and so the data is still the same from its previous data that was a week old already.
You could see the raw binance api data on the link below.
https://api.binance.com/api/v3/ticker/24hr
And so I think it, the way only to tackle this problem would be to code it as a google script.
I would greatly appreciate any help I can get.
Any sample code gs code would be very helpful.
Thank you very much...
Here is a solution. Put a triger if needed on the function horodatage (i.e. each day)
// Mike Steelson
let resultat = [];
// mettre déclencheur horaire sur cette fonction
// define a trigger here
function horodatage(){
var f = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data')
f.getRange('A1').setValue(!f.getRange('A1').getValue())
f.getRange('B1').setValue(new Date())
}
function getDataJSON(url,xpath){
try{
if (url.match(/http(s)?:\/\/?/g)){var data = JSON.parse(UrlFetchApp.fetch(url).getContentText())}
else{var data = JSON.parse(url)}
var json = eval('data')
if (typeof xpath == 'object'){var liste = xpath.join().split(",")} else {var liste = xpath.split("|")}
if (json.length){json.forEach(function(elem){getData(elem,liste)})} else {getData(json,liste)}
return resultat
}
catch(e) {
return ('Pas de résultat - vérifier l\'url et les paramètres !');
}
}
function getData(elem,liste){
var prov=[]
liste.forEach(function(chemin){
var t=chemin.split('/');
var obj=elem;
for (var i=1;i<t.length;i++){obj=obj.item(t[i])}
if(typeof obj=='object'){prov.push('['+obj+']')}else{prov.push(obj)}
})
resultat.push(prov)
}
Object.prototype.item=function(i){return this[i]};
you can take a copy of this spreadsheet https://docs.google.com/spreadsheets/d/1DN0Gfim0LC098zVgrUpt2crPWUn4pWfZnCpuuL1ZiMs/copy
i cannot comment but here could be a solution, instead of api.binance.com/api/v3/ticker/24hr write api1.binance.com/api/v3/ticker/24hr
I have added 1 to api. in a video I saw it works for him.... but for me didnt work.
let me know if it was useful
thanks

Google App Script Email as PDF from Spreadsheet [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
My code below for generate PDF attachment is working fine but they send all data in the spreadsheet.
Anyone can help to send only the specify spreadsheet like my code only sheet"Email" in stead of All sheets ?
Thank you
function SendEmail() {
try {
var ss = SpreadsheetApp.getActive();
var url = "https://docs.google.com/feeds/download/spreadsheets/Export?key=" + ss.getId() + "&exportFormat=pdf";
var params = {
method : "get",
headers : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
muteHttpExceptions: true
};
var blob = UrlFetchApp.fetch(url, params).getBlob();
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Email')
var subjectrange = sheet.getRange("A20");
var subjectdata = subjectrange.getValues();
var emailranges=sheet.getRange('E14');
var emaildata=emailranges.getValue();
var username=ss.getSheetId();
blob.setName(ss.getName()+ ".pdf");
var confirm = Browser.msgBox('Send Email Confirmation','Are you sure you want to send this mail for booking request ?', Browser.Buttons.OK_CANCEL);
if(confirm=='ok') {
MailApp.sendEmail(emaildata, subjectdata, " Attachment file is: \n" +subjectdata+ "- \n Kindly reply your booking to this email . \n Thank you - ADS Co., Ltd", {attachments: [blob]}) };} catch (f) {Logger.log(f.toString());
}
}
Answer
If you don't want to export some sheets you can hide them. Furthermore, you can export a Spreadsheet with the method getBlob. Once you have made the export, you can undo the hide.
Small code assuming two sheets
var sheet = ss.getSheetByName('Unwanted Sheet')
sheet.hideSheet()
var blob = ss.getBlob()
blob.setName(ss.getName())
sheet.showSheet()
Full code working with many sheets
function exportSheet(sheetName) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].getSheetName() !== sheetName) {
sheets[i].hideSheet()
}
}
var blob = ss.getBlob()
blob.setName(ss.getName())
for (var i = 0; i < sheets.length; i++) {
sheets[i].showSheet()
}
}
Some tips
You don't have to add .pdf to the blob name, it already understand that it is a pdf file and the extension will appear automatically
You can use GmailApp service instead of MailApp since it is more versatile and has more functionalities. The main reason to use MailApp is using that it doesn’t require the developer to be a Gmail user.
Reference
hideSheet
showSheet
getBlob
GmailApp
MailApp

How can i display multiple views with ModuleFrontController in PS 1.6

With my Module Front Controller, i need to initialize it to display a form (formulaire.tpl) that the customer has to fill. Then the controller processes the data posted from the form using methods defines in my model (Formulaire.php) and then i would like to make it display another view (recapitulatif.tpl) that displays a reminder of data sent, an add to cart button for example or the possibility to fill the form in again.
As i would like to implement it the MVC way, i don't want to create a new php page to redirect my customer to but i would like to display somehow this second template after processing the data. Is there any way to do so with the controller? Here below, you can find my code, it doesn't work and it displays my first template and below my second..
class FormulaireModuleDefaultModuleFrontController extends ModuleFrontController
{
public $ssl = true;
private $done_traitement = false;
public function postProcess()
{
//On vérifie le bouton submit du formulaire
if(Tools::isSubmit('bouton'))
{
// On va commencer en premier par récupérer l'id customer avec la variable cookie
// et vérifier que la personnes est bien loggée
global $cookie;
if(!isset($cookie->id_customer))
{
$message='Aucun client loggé';
}
else
{
$errors=array();
$id_cart=$this->context->cart->id;
$customer=$cookie->id_customer;
//On récupère les valeurs du formulaire
$prix=Tools::getValue('resultat');
$titre='porte_test';
$desc='Largeur de passage de '.Tools::getValue('largeur_passage').' mm, hauteur de passage de '.Tools::getValue('hauteur_passage')
.' mm, hauteur de linteau de '.Tools::getValue('hauteur_linteau').' mm, ecoinçon gauche de '.Tools::getValue('ecoincon_gauche')
.' mm, ecoincon_droit de '.Tools::getValue('ecoincon_droit'). ' mm, motif en '.Tools::getValue('motif_porte').' et de couleur '
.Tools::getValue('couleur_porte');
//On va vérifier les champs obligatoires
//Les champs sont remplis, on va faire le traitement des données.
$idprod=Formulaire::creerProduct($titre,0,13,$prix,$desc, 'mod_100',$customer);
Formulaire::addProduitauPanier($idprod);
$this->done_traitement=true;
}
//On envoie le message si il existe:
if(isset($message))self::$smarty->assign('message',$message);
if(isset($errors))self::$smarty->assign('erreurs',$errors);
}
}
public function initContent()
{
parent::initContent();
if($this->done_traitement)
$this->display(__FILE__,'recapitulatif.tpl');
}
public function init(){
$this->display_column_left = false;
$this->display_column_right = false;
$this->page_name = 'Configurateur';
parent::init();
$this->setTemplate('formulaire.tpl');
}
}
Thanks in advance for your help !
EDIT :
Ok sorry for the question. It just took me 2 minutes to figure it out after posting the question. I only needed to change:
$this->display(__FILE__,'recapitulatif.tpl');
by :
$this->setTemplate('recapitulatif.tpl');
And now it works. Sorry for the inconvenience !

static class on .web project silverlight

I have been having a problem for a long time , but so far have not got a solution and I hope you can help me .
I have a Silverlight application where I use WCF for queries to retrieve information from the database and also for the communication between client ( Duplex ) and Socket (receive and send information between my application and others).
To control Duplex , when the client accesses a specific module of my application , I link that customer to a static class that I have on my Projeto.Web ( Application start ) , as in the code below :
//static Class
public static class ncClientes
{
private static List<IncServicoDuplex> clientesSupRecAlarme = new List<IncServicoDuplex>();
public static List<IncServicoDuplex> ClientesSupRecAlarme
{
get { return ncClientes.clientesSupRecAlarme; }
set { ncClientes.clientesSupRecAlarme = value; }
}
}
//Método chamado pelo WCF quando o cliente acessa o módulo
public void VinculaCliente(string strProjeto)
{
//GetCallbackChannel - obter o canal de comunicação entre o serviço e o cliente - retornará a instância do canal entre o serviço e o cliente.
IncServicoDuplex cliente = OperationContext.Current.GetCallbackChannel<IncServicoDuplex>();
//A palavra-chave lock marca um bloqueio de instruções como uma seção crítica, obter o bloqueio de exclusão de mútua para um determinado objeto,
//executar uma instrução e, em seguida, liberar o bloqueio.
switch (strProjeto)
{
case "ncPrincipal|Alarme":
case "ncAlarme":
case "ncConfiguracao|Supervisao":
lock (ncClientes.ClientesSupRecAlarme)
{
ncClientes.ClientesSupRecAlarme.Add(cliente);
}
break;
}
}
When I make a change to the database , all of my online customers who are at the receiving module that change the WCF service , use the following code :
//Método no meu WCF que transmite a informação de alteração, inclusão ou exclusão de um cliente para os outros
public void SupervisaoAlarmeOnline(ncAlarme objAlarme)
{
var varClientesAlarme = new List<IncServicoDuplex>(ncClientes.ClientesSupRecAlarme);
foreach (var item in varClientesAlarme)
{
try
{
item.SupervisaoAlarmeOnlineRetorno(objAlarme);
}
catch
{
ncClientes.ClientesSupRecAlarme.Remove(item);
}
}
}
My problem happens when I get some information by Socket ( class located in projeto.Web ) that creates an instance of my ServicoWCF and call the method to send the received information to clients. Apparently, my static variable is being reset when called on this side of the application.
Is there any difference on " which side " I call the service ? When I call it on WCF client side my static variable gets the correct count , but when I call it on the Socket class , count is set to 0.
I hope you can help me , I tried to be as clear as possible , if there is any doubt please let me know.
Thanks in advance !