mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Compare commits
No commits in common. "a44798edb11f15dc359d33ea62b195997f10a1d6" and "f0a342faec6034c69f3a4b3f3943b48e3a7b7d67" have entirely different histories.
a44798edb1
...
f0a342faec
5 changed files with 7 additions and 52 deletions
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -20,7 +20,7 @@
|
|||
"mathjs": "^9.3.0",
|
||||
"moment": "^2.29.1",
|
||||
"ms": "^2.1.3",
|
||||
"onion-lasers": "^1.1.1",
|
||||
"onion-lasers": "^1.1.0",
|
||||
"relevant-urban": "^2.0.0",
|
||||
"translate-google": "^1.4.3",
|
||||
"weather-js": "^2.0.0"
|
||||
|
@ -5140,9 +5140,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/onion-lasers": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.2.tgz",
|
||||
"integrity": "sha512-gQHQCdcfDSLeWFFXMTBCy2PZR/n603B+Q2L3vTj+9T1CmJS7OfO7zoFM5QrTkOY4N5hESboOdJ8eRvPXQgdxDg==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.1.tgz",
|
||||
"integrity": "sha512-aX1jZtDMDjXN3N/k5Ca/6N3aQ1ozN6/1iylhbjB9u5xj97KcqhITx8jH5u2JEjUBZRQ3var9PuF1jNz/DrEgdQ==",
|
||||
"dependencies": {
|
||||
"discord.js": "^12.5.3",
|
||||
"glob": "^7.1.6"
|
||||
|
@ -11845,9 +11845,9 @@
|
|||
}
|
||||
},
|
||||
"onion-lasers": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.2.tgz",
|
||||
"integrity": "sha512-gQHQCdcfDSLeWFFXMTBCy2PZR/n603B+Q2L3vTj+9T1CmJS7OfO7zoFM5QrTkOY4N5hESboOdJ8eRvPXQgdxDg==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.1.tgz",
|
||||
"integrity": "sha512-aX1jZtDMDjXN3N/k5Ca/6N3aQ1ozN6/1iylhbjB9u5xj97KcqhITx8jH5u2JEjUBZRQ3var9PuF1jNz/DrEgdQ==",
|
||||
"requires": {
|
||||
"discord.js": "^12.5.3",
|
||||
"glob": "^7.1.6"
|
||||
|
|
|
@ -204,27 +204,6 @@ export default new NamedCommand({
|
|||
})
|
||||
})
|
||||
}
|
||||
}),
|
||||
name: new NamedCommand({
|
||||
aliases: ["defaultname"],
|
||||
description:
|
||||
"Sets the name that the channel will be reset to once no more members are in the channel.",
|
||||
usage: "(<name>)",
|
||||
run: "Please provide a new voice channel name.",
|
||||
any: new RestCommand({
|
||||
async run({send, guild, message, combined}) {
|
||||
const voiceChannel = message.member?.voice.channel;
|
||||
const guildID = guild!.id;
|
||||
const guildStorage = Storage.getGuild(guildID);
|
||||
const newName = combined;
|
||||
|
||||
if (!voiceChannel) return send("You are not in a voice channel.");
|
||||
|
||||
guildStorage.channelNames[voiceChannel.id] = newName;
|
||||
Storage.save();
|
||||
return await send(`Set default channel name to "${newName}".`);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -74,4 +74,3 @@ import "./modules/intercept";
|
|||
import "./modules/messageEmbed";
|
||||
import "./modules/guildMemberAdd";
|
||||
import "./modules/streamNotifications";
|
||||
import "./modules/channelDefaults";
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import {client} from "../index";
|
||||
import {Storage} from "../structures";
|
||||
|
||||
client.on("voiceStateUpdate", async (before, after) => {
|
||||
const channel = before.channel!;
|
||||
const {channelNames} = Storage.getGuild(after.guild.id);
|
||||
|
||||
if (channel?.members.size === 0 && channel?.id in channelNames) {
|
||||
channel.setName(channelNames[channel.id]);
|
||||
}
|
||||
});
|
|
@ -72,7 +72,6 @@ class Guild {
|
|||
public welcomeMessage: string | null;
|
||||
public streamingChannel: string | null;
|
||||
public streamingRoles: {[role: string]: string}; // Role ID: Category Name
|
||||
public channelNames: {[channel: string]: string};
|
||||
public members: {[id: string]: Member};
|
||||
|
||||
constructor(data?: GenericJSON) {
|
||||
|
@ -81,7 +80,6 @@ class Guild {
|
|||
this.welcomeMessage = select(data?.welcomeMessage, null, String);
|
||||
this.streamingChannel = select(data?.streamingChannel, null, String);
|
||||
this.streamingRoles = {};
|
||||
this.channelNames = {};
|
||||
this.members = {};
|
||||
|
||||
switch (data?.welcomeType) {
|
||||
|
@ -106,16 +104,6 @@ class Guild {
|
|||
}
|
||||
}
|
||||
|
||||
if (data?.channelNames) {
|
||||
for (const id in data.channelNames) {
|
||||
const name = data.channelNames[id];
|
||||
|
||||
if (/\d{17,}/g.test(id) && typeof name === "string") {
|
||||
this.channelNames[id] = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data?.members) {
|
||||
for (let id in data.members) {
|
||||
if (/\d{17,}/g.test(id)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue