-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v4.13.8 - Alteração na atualização de status do bot
- Loading branch information
1 parent
ceeb5bc
commit 51e6d26
Showing
4 changed files
with
33 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
module.exports = class buttonUpdate { | ||
constructor() { | ||
return { | ||
name: "btUpdate", | ||
name: 'btUpdate', | ||
run: this.execute | ||
} | ||
}; | ||
} | ||
|
||
execute(client, comp) { | ||
comp.deferUpdate() | ||
.then(() => { | ||
if (comp.user.id == process.env.OWNER) { | ||
client.channels.fetch(comp.channelId) | ||
.then(channel => { | ||
channel.messages.fetch("784039521645101066") | ||
.then((msg) => { | ||
msg.content = msg.content.split("<@720128587289722902> <@716053210179043409>").join("") | ||
msg.content = msg.content.split("```js").join("") | ||
msg.content = msg.content.split("```").join("") | ||
var msgConfig = JSON.parse(msg.content) | ||
client.emit("varUpdate", msgConfig) | ||
comp.followUp({ content: "Atualizado com sucesso", ephemeral: true }) | ||
}) | ||
}) | ||
} | ||
else { | ||
comp.followUp({ content: "Somente pessoal autorizado pode utilizar esta função", ephemeral: true }) | ||
} | ||
}) | ||
comp.deferUpdate().then(() => { | ||
if (comp.user.id == process.env.OWNER) { | ||
client.channels.fetch(comp.channelId).then(channel => { | ||
channel.messages.fetch('784039521645101066').then(msg => { | ||
msg.content = msg.content.split('<@720128587289722902> <@716053210179043409>').join(''); | ||
msg.content = msg.content.split('```js').join(''); | ||
msg.content = msg.content.split('```').join(''); | ||
var msgConfig = JSON.parse(msg.content); | ||
client.emit('varUpdate', msgConfig); | ||
client.shard.broadcastEval( | ||
async (c, ctx) => { | ||
c.emit('varUpdate', ctx); | ||
}, | ||
{ | ||
context: JSON.stringify(msgConfig) | ||
} | ||
); | ||
comp.followUp({ content: 'Atualizado com sucesso', ephemeral: true }); | ||
}); | ||
}); | ||
} else { | ||
comp.followUp({ content: 'Somente pessoal autorizado pode utilizar esta função', ephemeral: true }); | ||
} | ||
}); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters