refactor url
This commit is contained in:
parent
fe0a35c54e
commit
82b0ca24a7
5
index.js
5
index.js
@ -71,11 +71,12 @@ xmpp.on('stanza', async stanza => {
|
|||||||
const buf = await imageGenerator.generateBuffer()
|
const buf = await imageGenerator.generateBuffer()
|
||||||
if (buf.byteLength > 0 && stanza.getChild('slot')
|
if (buf.byteLength > 0 && stanza.getChild('slot')
|
||||||
&& stanza.getChild('slot').getChild('put')) {
|
&& stanza.getChild('slot').getChild('put')) {
|
||||||
const req = await got.put(stanza.getChild('slot').getChild('put').attrs.url, {
|
const url = stanza.getChild('slot').getChild('put').attrs.url,
|
||||||
|
req = await got.put(url, {
|
||||||
body: buf
|
body: buf
|
||||||
}).catch(console.error)
|
}).catch(console.error)
|
||||||
if (req && req.url && time) {
|
if (req && req.url && time) {
|
||||||
sendMessage(`Su turno: ${req.url} movimiento IA en ${time / 1000} s`)
|
sendMessage(`Su turno: ${req.url} movimiento IA en ${time / 1000}s`)
|
||||||
imageGenerator = null
|
imageGenerator = null
|
||||||
time = null
|
time = null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user