2020-06-16 15:51:21 +02:00
|
|
|
export default new class DisableTyping {
|
|
|
|
constructor(){
|
|
|
|
window.Lightcord.Api.ensureExported(e => e.default && e.default.startTyping)
|
|
|
|
.then(typingModule => {
|
|
|
|
let self = this
|
|
|
|
const startTyping = typingModule.default.startTyping
|
|
|
|
typingModule.default.startTyping = function(){
|
|
|
|
if(self.disabled)return startTyping.call(this, ...arguments)
|
|
|
|
}
|
|
|
|
const stopTyping = typingModule.default.stopTyping
|
|
|
|
typingModule.default.stopTyping = function(){
|
|
|
|
if(self.disabled)return stopTyping.call(this, ...arguments)
|
|
|
|
}
|
|
|
|
this.disabled = true
|
|
|
|
})
|
2020-07-04 22:42:26 +02:00
|
|
|
window.Lightcord.BetterDiscord.DisableTyping = this
|
2020-06-16 15:51:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
disable(){
|
|
|
|
this.disabled = true
|
|
|
|
}
|
|
|
|
|
|
|
|
enable(){
|
|
|
|
this.disabled = false
|
|
|
|
}
|
|
|
|
}
|