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

@ -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`

View file

@ -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) {

View file

@ -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(

View file

@ -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;

View file

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