Compare commits
2 commits
35646ef153
...
1acedfbd3d
Author | SHA1 | Date | |
---|---|---|---|
1acedfbd3d | |||
4ed5beb42a |
11 changed files with 4662 additions and 8825 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -105,4 +105,5 @@ dist
|
|||
|
||||
config.json
|
||||
.DS_Store
|
||||
ormconfig.json
|
||||
ormconfig.json
|
||||
.temp/
|
8815
package-lock.json
generated
8815
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import EmbedColours from "../../constants/EmbedColours";
|
||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||
import { Command } from "../../type/command";
|
||||
|
@ -24,6 +24,8 @@ export default class Entry extends Command {
|
|||
.setTitle("Welcome")
|
||||
.setDescription(`Welcome to the server! Please make sure to read the rules in the <#${rulesChannelId}> channel and type the code found there in here to proceed to the main part of the server.`);
|
||||
|
||||
await interaction.channel.send({ embeds: [ embed ]});
|
||||
const channel = interaction.channel as TextChannel;
|
||||
|
||||
await channel.send({ embeds: [ embed ]});
|
||||
}
|
||||
}
|
|
@ -93,7 +93,7 @@ export default class Audits extends Command {
|
|||
private async SendAuditForUser(interaction: CommandInteraction) {
|
||||
if (!interaction.guildId) return;
|
||||
|
||||
const user = interaction.options.getUser('target');
|
||||
const user = interaction.options.get('target')?.user;
|
||||
|
||||
if (!user) {
|
||||
await interaction.reply("User not found.");
|
||||
|
@ -191,7 +191,7 @@ export default class Audits extends Command {
|
|||
private async AddAudit(interaction: CommandInteraction) {
|
||||
if (!interaction.guildId) return;
|
||||
|
||||
const user = interaction.options.getUser('target');
|
||||
const user = interaction.options.get('target')?.user;
|
||||
const auditType = interaction.options.get('type');
|
||||
const reasonInput = interaction.options.get('reason');
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import SettingsHelper from "../helpers/SettingsHelper";
|
||||
import StringTools from "../helpers/StringTools";
|
||||
import { Command } from "../type/command";
|
||||
|
@ -59,6 +59,8 @@ export default class Code extends Command {
|
|||
.setTitle("Entry Code")
|
||||
.setDescription(code);
|
||||
|
||||
await interaction.channel.send({ embeds: [ embed ]});
|
||||
const channel = interaction.channel as TextChannel;
|
||||
|
||||
await channel.send({ embeds: [ embed ]});
|
||||
}
|
||||
}
|
30
src/commands/linkonly.ts
Normal file
30
src/commands/linkonly.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { CommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
import { Command } from "../type/command";
|
||||
import SettingsHelper from "../helpers/SettingsHelper";
|
||||
|
||||
export default class Linkonly extends Command {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.CommandBuilder = new SlashCommandBuilder()
|
||||
.setName("linkonly")
|
||||
.setDescription("Set the link only channel, leave blank to disable")
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)
|
||||
.addChannelOption(x => x
|
||||
.setName("channel")
|
||||
.setDescription("The channel"));
|
||||
}
|
||||
|
||||
public override async execute(interaction: CommandInteraction) {
|
||||
if (!interaction.guild) return;
|
||||
|
||||
const channel = interaction.options.get("channel")?.channel;
|
||||
|
||||
const channelid = channel?.id ?? "";
|
||||
const channelName = channel?.name ?? "<NONE>";
|
||||
|
||||
await SettingsHelper.SetSetting("channel.linkonly", interaction.guild.id, channelid);
|
||||
|
||||
await interaction.reply(`Set the link only channel to \`${channelName}\``);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import { existsSync, readFileSync } from "fs";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
import { Command } from "../type/command";
|
||||
|
@ -79,7 +79,7 @@ export default class Rules extends Command {
|
|||
embeds.push(embed);
|
||||
});
|
||||
|
||||
const channel = interaction.channel;
|
||||
const channel = interaction.channel as TextChannel;
|
||||
|
||||
if (!channel) {
|
||||
await interaction.reply({ content: "Channel not found.", ephemeral: true });
|
||||
|
@ -109,7 +109,9 @@ export default class Rules extends Command {
|
|||
.setLabel(buttonLabel || "Verify")
|
||||
]);
|
||||
|
||||
await interaction.channel?.send({
|
||||
const channel = interaction.channel as TextChannel;
|
||||
|
||||
await channel.send({
|
||||
components: [ row ]
|
||||
});
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ export default class DefaultValues {
|
|||
this.values.push({ Key: "verification.role", Value: "Entry" });
|
||||
this.values.push({ Key: "verification.code", Value: "" });
|
||||
|
||||
// Gif Only Mode
|
||||
this.values.push({ Key: "channel.linkonly", Value: "" })
|
||||
|
||||
// Event
|
||||
this.values.push({ Key: "event.message.delete.enabled", Value: "false" });
|
||||
this.values.push({ Key: "event.message.delete.channel", Value: "message-logs" });
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Message } from "discord.js";
|
|||
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||
import VerificationCheck from "./MessageCreate/VerificationCheck";
|
||||
import CacheHelper from "../../helpers/CacheHelper";
|
||||
import LinkOnlyMode from "./MessageCreate/LinkOnlyMode";
|
||||
|
||||
export default async function MessageCreate(message: Message) {
|
||||
if (!message.guild) return;
|
||||
|
@ -9,6 +10,8 @@ export default async function MessageCreate(message: Message) {
|
|||
|
||||
await CacheHelper.UpdateServerCache(message.guild);
|
||||
|
||||
await LinkOnlyMode(message);
|
||||
|
||||
const isVerificationEnabled = await SettingsHelper.GetSetting("verification.enabled", message.guild.id);
|
||||
|
||||
if (isVerificationEnabled && isVerificationEnabled.toLocaleLowerCase() == "true") {
|
||||
|
|
20
src/events/MessageEvents/MessageCreate/LinkOnlyMode.ts
Normal file
20
src/events/MessageEvents/MessageCreate/LinkOnlyMode.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { Message } from "discord.js";
|
||||
import SettingsHelper from "../../../helpers/SettingsHelper";
|
||||
|
||||
export default async function LinkOnlyMode(message: Message) {
|
||||
if (!message.guild) return;
|
||||
|
||||
const gifOnlyMode = await SettingsHelper.GetSetting("channel.linkonly", message.guild.id);
|
||||
|
||||
if (!gifOnlyMode) return;
|
||||
|
||||
const channel = message.guild.channels.cache.find(x => x.id == gifOnlyMode) || message.guild.channels.fetch(gifOnlyMode);
|
||||
|
||||
if (!channel) return;
|
||||
|
||||
if (message.content.startsWith("https://") || message.content.startsWith("http://")) return;
|
||||
|
||||
if (!message.deletable) return;
|
||||
|
||||
await message.delete();
|
||||
}
|
Loading…
Reference in a new issue