Skip to content

Commit

Permalink
Merge pull request #40 from alanfilho184/dev
Browse files Browse the repository at this point in the history
v4.13.8 - Alteração na atualização de status do bot
  • Loading branch information
alanfilho184 authored Aug 29, 2024
2 parents ee13db5 + 51e6d26 commit 8a83bc2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kami",
"version": "4.13.7",
"version": "4.13.8",
"description": "Um BOT para Discord com foco em ajudar em mesas de RPG online, tendo suas principais funções criar fichas e rolar dados.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/gerais/botinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = class botinfo {

const results = await Promise.all(promises);

const table = new ac('Kami Info');
const table = new ac(`Kami - Shard: ${client.shard.ids[0]}`);

var dbPing = time.now().toMillis();
await client.db.query('select 1').then(() => {
Expand Down
50 changes: 27 additions & 23 deletions src/components/buttonUpdate.js
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 });
}
});
}
}
};
8 changes: 4 additions & 4 deletions src/events/bot/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ function replaceAll(string, search, replace) {
return string.split(search).join(replace);
}

var actsPadrao = [`Quer ajuda? ${"$prefix$"}ajuda`, `Need help? ${"$prefix$"}help`, `Bug? ${"$prefix$"}bug`, `Alguma ideia? ${"$prefix$"}sugestão`, `Vote em mim, me ajuda muito ❤️ | ${"$prefix$"}votar`, "Me convide para outro servidor! $prefix$convite"]
var acts = [`Quer ajuda? ${"$prefix$"}ajuda`, `Need help? ${"$prefix$"}help`, `Bug? ${"$prefix$"}bug`, `Alguma ideia? ${"$prefix$"}sugestão`, `Vote em mim, me ajuda muito ❤️ | ${"$prefix$"}votar`]
var actsPadrao = ['teste']//["/ajuda", "/help", "kamiapp.com.br"]
var acts = ['teste']//["/ajuda", "/help", "kamiapp.com.br"]
var status = "online"
var typeStatus = "WATCHING"
var timeChange = 10000
var typeStatus = "PLAYING"
var timeChange = 30000
var act = ""

module.exports = {
Expand Down

0 comments on commit 8a83bc2

Please sign in to comment.