new commands: recent and rejoin, fixed some stuff

This commit is contained in:
ayeuhugyu 2024-01-03 15:38:22 -08:00
parent 89b75481e9
commit 921febf278
6 changed files with 5 additions and 4 deletions

View file

@ -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._ **_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 - 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
--- ---

View file

@ -5,6 +5,7 @@ export default {
name: "recent", name: "recent",
description: "sends most recent deleted message", description: "sends most recent deleted message",
execute(message, args) { execute(message, args) {
if (message.author.bot) return;
try { try {
const recent = fs.readFileSync( const recent = fs.readFileSync(
`./logs/deletedmessages/${message.guild.id}.log` `./logs/deletedmessages/${message.guild.id}.log`

View file

@ -3,7 +3,7 @@ import * as action from "../util/discordAction.js";
export default { export default {
name: "rejoin", name: "rejoin",
description: "Rejoin the voice channel", description: "rejoin the voice channel",
execute(message, args) { execute(message, args) {
const connection = getVoiceConnection(message.guild.id); const connection = getVoiceConnection(message.guild.id);
if (connection) { if (connection) {

View file

@ -8,7 +8,7 @@ export default function (message) {
"deletedmessages.log", "deletedmessages.log",
message, message,
import.meta.url, 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 true
); );
fsextra.ensureFileSync( fsextra.ensureFileSync(

View file

@ -5,7 +5,7 @@ export default async function (oldState, newState) {
if ((newState.channelId = undefined)) { if ((newState.channelId = undefined)) {
let channel = await client.channels.cache.get(oldState.channelId); let channel = await client.channels.cache.get(oldState.channelId);
if (!channel) { if (!channel) {
console.log("unable to find voice channel"); console.log("unable to find voice channel ");
return; return;
} }
memberCount = channel.members.size; memberCount = channel.members.size;

View file

@ -39,5 +39,4 @@ client.on("voiceStateUpdate", (oldState, newState) => {
}); });
register(); register();
client.login(process.env.TOKEN); client.login(process.env.TOKEN);