Fixed reserved word
This commit is contained in:
parent
acc70e6a83
commit
d0634a315f
1 changed files with 5 additions and 5 deletions
10
libs.js
10
libs.js
|
@ -250,7 +250,7 @@ const formatMessage = (values) => {
|
||||||
*/
|
*/
|
||||||
const publishMessage = (song, cover) => {
|
const publishMessage = (song, cover) => {
|
||||||
const status = formatMessage(song)
|
const status = formatMessage(song)
|
||||||
const catch = (err, res) => {
|
const callback = (err, res) => {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
console.log(config.colors.FgRed, 'ERR on publishMessage:', err, config.colors.Reset)
|
console.log(config.colors.FgRed, 'ERR on publishMessage:', err, config.colors.Reset)
|
||||||
}
|
}
|
||||||
|
@ -258,19 +258,19 @@ const publishMessage = (song, cover) => {
|
||||||
if (cover) {
|
if (cover) {
|
||||||
getMedia(cover, (err, dest) => {
|
getMedia(cover, (err, dest) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
M.post('statuses', { status }, catch)
|
M.post('statuses', { status }, callback)
|
||||||
} else {
|
} else {
|
||||||
M.post('media', { file: fs.createReadStream(dest) }).then(resp => {
|
M.post('media', { file: fs.createReadStream(dest) }).then(resp => {
|
||||||
const id = resp.data.id
|
const id = resp.data.id
|
||||||
M.post('statuses', { status, media_ids: [id] }, catch)
|
M.post('statuses', { status, media_ids: [id] }, callback)
|
||||||
})
|
})
|
||||||
.catch( () => {
|
.catch( () => {
|
||||||
M.post('statuses', { status }, catch)
|
M.post('statuses', { status }, callback)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
M.post('statuses', { status }, catch)
|
M.post('statuses', { status }, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue