Compare commits
No commits in common. "6acc5a9a02a12e1e1d93f86874ec2c78f87a4fa1" and "35646ef153ed95272d547b497b7905c6829d0564" have entirely different histories.
6acc5a9a02
...
35646ef153
17 changed files with 8838 additions and 4677 deletions
|
@ -7,7 +7,7 @@
|
||||||
# any secret values.
|
# any secret values.
|
||||||
|
|
||||||
BOT_TOKEN=
|
BOT_TOKEN=
|
||||||
BOT_VER=3.2.3
|
BOT_VER=3.2.1
|
||||||
BOT_AUTHOR=Vylpes
|
BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=682942374040961060
|
BOT_CLIENTID=682942374040961060
|
||||||
|
|
|
@ -17,9 +17,9 @@ jobs:
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- run: yarn install --frozen-lockfile
|
- run: npm ci
|
||||||
- run: yarn build
|
- run: npm run build
|
||||||
- run: yarn test
|
- run: npm test
|
||||||
|
|
||||||
- name: "Copy files over to location"
|
- name: "Copy files over to location"
|
||||||
run: cp -r . ${{ secrets.PROD_REPO_PATH }}
|
run: cp -r . ${{ secrets.PROD_REPO_PATH }}
|
||||||
|
@ -63,5 +63,5 @@ jobs:
|
||||||
&& (pm2 delete vylbot_prod || true) \
|
&& (pm2 delete vylbot_prod || true) \
|
||||||
&& docker compose up -d \
|
&& docker compose up -d \
|
||||||
&& sleep 10 \
|
&& sleep 10 \
|
||||||
&& yarn db:up \
|
&& npm run db:up \
|
||||||
&& pm2 start --name vylbot_prod dist/vylbot.js
|
&& pm2 start --name vylbot_prod dist/vylbot.js
|
|
@ -17,9 +17,9 @@ jobs:
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- run: yarn install --frozen-lockfile
|
- run: npm ci
|
||||||
- run: yarn build
|
- run: npm run build
|
||||||
- run: yarn test
|
- run: npm test
|
||||||
|
|
||||||
- name: "Copy files over to location"
|
- name: "Copy files over to location"
|
||||||
run: cp -r . ${{ secrets.STAGE_REPO_PATH }}
|
run: cp -r . ${{ secrets.STAGE_REPO_PATH }}
|
||||||
|
@ -63,5 +63,5 @@ jobs:
|
||||||
&& (pm2 delete vylbot_stage || true) \
|
&& (pm2 delete vylbot_stage || true) \
|
||||||
&& docker compose up -d \
|
&& docker compose up -d \
|
||||||
&& sleep 10 \
|
&& sleep 10 \
|
||||||
&& yarn db:up \
|
&& npm run db:up \
|
||||||
&& pm2 start --name vylbot_stage dist/vylbot.js
|
&& pm2 start --name vylbot_stage dist/vylbot.js
|
|
@ -19,6 +19,6 @@ jobs:
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- run: yarn install --frozen-lockfile
|
- run: npm ci
|
||||||
- run: yarn build
|
- run: npm run build
|
||||||
- run: yarn test
|
- run: npm test
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -106,4 +106,3 @@ dist
|
||||||
config.json
|
config.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
ormconfig.json
|
ormconfig.json
|
||||||
.temp/
|
|
8815
package-lock.json
generated
Normal file
8815
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "vylbot-app",
|
"name": "vylbot-app",
|
||||||
"version": "3.2.3",
|
"version": "3.2.2",
|
||||||
"description": "A discord bot made for Vylpes' Den",
|
"description": "A discord bot made for Vylpes' Den",
|
||||||
"main": "./dist/vylbot",
|
"main": "./dist/vylbot",
|
||||||
"typings": "./dist",
|
"typings": "./dist",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import EmbedColours from "../../constants/EmbedColours";
|
import EmbedColours from "../../constants/EmbedColours";
|
||||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||||
import { Command } from "../../type/command";
|
import { Command } from "../../type/command";
|
||||||
|
@ -24,8 +24,6 @@ export default class Entry extends Command {
|
||||||
.setTitle("Welcome")
|
.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.`);
|
.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.`);
|
||||||
|
|
||||||
const channel = interaction.channel as TextChannel;
|
await interaction.channel.send({ embeds: [ embed ]});
|
||||||
|
|
||||||
await channel.send({ embeds: [ embed ]});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -93,7 +93,7 @@ export default class Audits extends Command {
|
||||||
private async SendAuditForUser(interaction: CommandInteraction) {
|
private async SendAuditForUser(interaction: CommandInteraction) {
|
||||||
if (!interaction.guildId) return;
|
if (!interaction.guildId) return;
|
||||||
|
|
||||||
const user = interaction.options.get('target')?.user;
|
const user = interaction.options.getUser('target');
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
await interaction.reply("User not found.");
|
await interaction.reply("User not found.");
|
||||||
|
@ -191,7 +191,7 @@ export default class Audits extends Command {
|
||||||
private async AddAudit(interaction: CommandInteraction) {
|
private async AddAudit(interaction: CommandInteraction) {
|
||||||
if (!interaction.guildId) return;
|
if (!interaction.guildId) return;
|
||||||
|
|
||||||
const user = interaction.options.get('target')?.user;
|
const user = interaction.options.getUser('target');
|
||||||
const auditType = interaction.options.get('type');
|
const auditType = interaction.options.get('type');
|
||||||
const reasonInput = interaction.options.get('reason');
|
const reasonInput = interaction.options.get('reason');
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
import { CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import SettingsHelper from "../helpers/SettingsHelper";
|
import SettingsHelper from "../helpers/SettingsHelper";
|
||||||
import StringTools from "../helpers/StringTools";
|
import StringTools from "../helpers/StringTools";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
@ -59,8 +59,6 @@ export default class Code extends Command {
|
||||||
.setTitle("Entry Code")
|
.setTitle("Entry Code")
|
||||||
.setDescription(code);
|
.setDescription(code);
|
||||||
|
|
||||||
const channel = interaction.channel as TextChannel;
|
await interaction.channel.send({ embeds: [ embed ]});
|
||||||
|
|
||||||
await channel.send({ embeds: [ embed ]});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
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, TextChannel } from "discord.js";
|
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, PermissionsBitField, SlashCommandBuilder } from "discord.js";
|
||||||
import { existsSync, readFileSync } from "fs";
|
import { existsSync, readFileSync } from "fs";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
@ -79,7 +79,7 @@ export default class Rules extends Command {
|
||||||
embeds.push(embed);
|
embeds.push(embed);
|
||||||
});
|
});
|
||||||
|
|
||||||
const channel = interaction.channel as TextChannel;
|
const channel = interaction.channel;
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
await interaction.reply({ content: "Channel not found.", ephemeral: true });
|
await interaction.reply({ content: "Channel not found.", ephemeral: true });
|
||||||
|
@ -109,9 +109,7 @@ export default class Rules extends Command {
|
||||||
.setLabel(buttonLabel || "Verify")
|
.setLabel(buttonLabel || "Verify")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const channel = interaction.channel as TextChannel;
|
await interaction.channel?.send({
|
||||||
|
|
||||||
await channel.send({
|
|
||||||
components: [ row ]
|
components: [ row ]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,6 @@ export default class DefaultValues {
|
||||||
this.values.push({ Key: "verification.role", Value: "Entry" });
|
this.values.push({ Key: "verification.role", Value: "Entry" });
|
||||||
this.values.push({ Key: "verification.code", Value: "" });
|
this.values.push({ Key: "verification.code", Value: "" });
|
||||||
|
|
||||||
// Gif Only Mode
|
|
||||||
this.values.push({ Key: "channel.linkonly", Value: "" })
|
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
this.values.push({ Key: "event.message.delete.enabled", Value: "false" });
|
this.values.push({ Key: "event.message.delete.enabled", Value: "false" });
|
||||||
this.values.push({ Key: "event.message.delete.channel", Value: "message-logs" });
|
this.values.push({ Key: "event.message.delete.channel", Value: "message-logs" });
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Message } from "discord.js";
|
||||||
import SettingsHelper from "../../helpers/SettingsHelper";
|
import SettingsHelper from "../../helpers/SettingsHelper";
|
||||||
import VerificationCheck from "./MessageCreate/VerificationCheck";
|
import VerificationCheck from "./MessageCreate/VerificationCheck";
|
||||||
import CacheHelper from "../../helpers/CacheHelper";
|
import CacheHelper from "../../helpers/CacheHelper";
|
||||||
import LinkOnlyMode from "./MessageCreate/LinkOnlyMode";
|
|
||||||
|
|
||||||
export default async function MessageCreate(message: Message) {
|
export default async function MessageCreate(message: Message) {
|
||||||
if (!message.guild) return;
|
if (!message.guild) return;
|
||||||
|
@ -10,8 +9,6 @@ export default async function MessageCreate(message: Message) {
|
||||||
|
|
||||||
await CacheHelper.UpdateServerCache(message.guild);
|
await CacheHelper.UpdateServerCache(message.guild);
|
||||||
|
|
||||||
await LinkOnlyMode(message);
|
|
||||||
|
|
||||||
const isVerificationEnabled = await SettingsHelper.GetSetting("verification.enabled", message.guild.id);
|
const isVerificationEnabled = await SettingsHelper.GetSetting("verification.enabled", message.guild.id);
|
||||||
|
|
||||||
if (isVerificationEnabled && isVerificationEnabled.toLocaleLowerCase() == "true") {
|
if (isVerificationEnabled && isVerificationEnabled.toLocaleLowerCase() == "true") {
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
|
@ -12,7 +12,6 @@ import Config from "./commands/config";
|
||||||
import Disable from "./commands/disable";
|
import Disable from "./commands/disable";
|
||||||
import Ignore from "./commands/ignore";
|
import Ignore from "./commands/ignore";
|
||||||
import Kick from "./commands/kick";
|
import Kick from "./commands/kick";
|
||||||
import Linkonly from "./commands/linkonly";
|
|
||||||
import Mute from "./commands/mute";
|
import Mute from "./commands/mute";
|
||||||
import Poll from "./commands/poll";
|
import Poll from "./commands/poll";
|
||||||
import Role from "./commands/Role/role";
|
import Role from "./commands/Role/role";
|
||||||
|
@ -53,7 +52,6 @@ export default class Registry {
|
||||||
CoreClient.RegisterCommand("disable", new Disable());
|
CoreClient.RegisterCommand("disable", new Disable());
|
||||||
CoreClient.RegisterCommand("ignore", new Ignore());
|
CoreClient.RegisterCommand("ignore", new Ignore());
|
||||||
CoreClient.RegisterCommand("kick", new Kick());
|
CoreClient.RegisterCommand("kick", new Kick());
|
||||||
CoreClient.RegisterCommand("linkonly", new Linkonly());
|
|
||||||
CoreClient.RegisterCommand("mute", new Mute());
|
CoreClient.RegisterCommand("mute", new Mute());
|
||||||
CoreClient.RegisterCommand("poll", new Poll());
|
CoreClient.RegisterCommand("poll", new Poll());
|
||||||
CoreClient.RegisterCommand("rules", new Rules());
|
CoreClient.RegisterCommand("rules", new Rules());
|
||||||
|
|
Loading…
Reference in a new issue