diff --git a/README.md b/README.md index 2a71997..f588472 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ clean up p/vileimagery, its horrendous **_Note:_** _versions before this were not uploaded to the repo, this is not the first version._ 1.15 - added p/recent and p/rejoin, p/recent sends the most recently deleted message, p/rejoin calls rejoin function on voice connections. also added some broken code for a voiceStateUpdate event but im too lazy to fix it so ill do that basically never. also deleted some useless line from .gitignore + 1.15.1 - fixed exploit with recurring p/recents --- diff --git a/src/commands/recent.js b/src/commands/recent.js index 7249d79..40c835c 100644 --- a/src/commands/recent.js +++ b/src/commands/recent.js @@ -5,6 +5,7 @@ export default { name: "recent", description: "sends most recent deleted message", execute(message, args) { + if (message.author.bot) return; try { const recent = fs.readFileSync( `./logs/deletedmessages/${message.guild.id}.log` diff --git a/src/commands/rejoin.js b/src/commands/rejoin.js index 88a6cc4..fe314d1 100644 --- a/src/commands/rejoin.js +++ b/src/commands/rejoin.js @@ -3,7 +3,7 @@ import * as action from "../util/discordAction.js"; export default { name: "rejoin", - description: "Rejoin the voice channel", + description: "rejoin the voice channel", execute(message, args) { const connection = getVoiceConnection(message.guild.id); if (connection) { diff --git a/src/events/messageDelete.js b/src/events/messageDelete.js index 0a52f10..65a6f61 100644 --- a/src/events/messageDelete.js +++ b/src/events/messageDelete.js @@ -8,7 +8,7 @@ export default function (message) { "deletedmessages.log", message, import.meta.url, - `deleted message from ${message.author.username} (${message.author}) with: "${message.content}"`, + `deleted message from: ${message.author.username} (${message.author}) with: "${message.content}"`, true ); fsextra.ensureFileSync( diff --git a/src/events/voiceStateUpdate.js b/src/events/voiceStateUpdate.js index 43a8ad7..74305a9 100644 --- a/src/events/voiceStateUpdate.js +++ b/src/events/voiceStateUpdate.js @@ -5,7 +5,7 @@ export default async function (oldState, newState) { if ((newState.channelId = undefined)) { let channel = await client.channels.cache.get(oldState.channelId); if (!channel) { - console.log("unable to find voice channel"); + console.log("unable to find voice channel "); return; } memberCount = channel.members.size; diff --git a/src/index.js b/src/index.js index 5ab924a..3413c49 100644 --- a/src/index.js +++ b/src/index.js @@ -39,5 +39,4 @@ client.on("voiceStateUpdate", (oldState, newState) => { }); register(); - client.login(process.env.TOKEN);