|
|
@ -96,7 +96,7 @@ class Bot { |
|
|
|
botClient.loginWithToken(this.config.accessToken, connectWithToken); |
|
|
|
} |
|
|
|
|
|
|
|
updateAvatar(avatarFile, overwrite=false) { |
|
|
|
updateAvatar(avatarFile, overwrite = false) { |
|
|
|
let matrixClient = this.client; |
|
|
|
let botConfig = this.config; |
|
|
|
let promises = [Promise.resolve(true)]; |
|
|
@ -117,13 +117,13 @@ class Bot { |
|
|
|
type: "image/jpeg", |
|
|
|
rawResponse: false |
|
|
|
}).then((uploadedAvatar) => { |
|
|
|
logger.info("Uploaded avatar %o", uploadedAvatar); |
|
|
|
matrixClient.setAvatarUrl(uploadedAvatar.content_uri) |
|
|
|
.then(() => { |
|
|
|
logger.info("Updated %s avatar to %s", botConfig.userId, uploadedAvatar.content_uri); |
|
|
|
return true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
logger.info("Uploaded avatar %o", uploadedAvatar); |
|
|
|
matrixClient.setAvatarUrl(uploadedAvatar.content_uri) |
|
|
|
.then(() => { |
|
|
|
logger.info("Updated %s avatar to %s", botConfig.userId, uploadedAvatar.content_uri); |
|
|
|
return true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
})); |
|
|
|
} else { |
|
|
|