imageGenerator check
Este commit está contenido en:
5
index.js
5
index.js
@@ -66,8 +66,10 @@ xmpp.on('stanza', async stanza => {
|
|||||||
)).catch(console.error)
|
)).catch(console.error)
|
||||||
}
|
}
|
||||||
} else if (stanza.is('iq') && stanza.attrs.type === 'result') {
|
} else if (stanza.is('iq') && stanza.attrs.type === 'result') {
|
||||||
|
if (imageGenerator) {
|
||||||
const buf = await imageGenerator.generateBuffer()
|
const buf = await imageGenerator.generateBuffer()
|
||||||
if (imageGenerator && buf.byteLength > 0 && stanza.getChild('slot') && stanza.getChild('slot').getChild('put')) {
|
if (buf.byteLength > 0 && stanza.getChild('slot')
|
||||||
|
&& stanza.getChild('slot').getChild('put')) {
|
||||||
const req = await got.put(stanza.getChild('slot').getChild('put').attrs.url, {
|
const req = await got.put(stanza.getChild('slot').getChild('put').attrs.url, {
|
||||||
body: buf
|
body: buf
|
||||||
}).catch(console.error)
|
}).catch(console.error)
|
||||||
@@ -76,6 +78,7 @@ xmpp.on('stanza', async stanza => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
xmpp.on('online', async address => {
|
xmpp.on('online', async address => {
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user