new commands: recent and rejoin, fixed some stuff
This commit is contained in:
parent
89b75481e9
commit
921febf278
6 changed files with 5 additions and 4 deletions
|
@ -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`
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -39,5 +39,4 @@ client.on("voiceStateUpdate", (oldState, newState) => {
|
|||
});
|
||||
|
||||
register();
|
||||
|
||||
client.login(process.env.TOKEN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue