mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 10:34:16 +02:00
fix(verification): fix multiple eslint issues
This commit is contained in:
parent
c71b787c8b
commit
2b96d507eb
@ -17,5 +17,6 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"class-methods-use-this": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
package-lock.json
generated
19
package-lock.json
generated
@ -10,6 +10,7 @@
|
|||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^4.0.0",
|
"@prisma/client": "^4.0.0",
|
||||||
|
"@sapphire/discord.js-utilities": "^5.0.0",
|
||||||
"@sapphire/framework": "^3.0.0",
|
"@sapphire/framework": "^3.0.0",
|
||||||
"@sapphire/plugin-scheduled-tasks": "^4.0.0",
|
"@sapphire/plugin-scheduled-tasks": "^4.0.0",
|
||||||
"@sapphire/plugin-subcommands": "^3.0.0",
|
"@sapphire/plugin-subcommands": "^3.0.0",
|
||||||
@ -18,7 +19,7 @@
|
|||||||
"@types/node": "^18.0.3",
|
"@types/node": "^18.0.3",
|
||||||
"bullmq": "^1.89.1",
|
"bullmq": "^1.89.1",
|
||||||
"discord-api-types": "^0.33.3",
|
"discord-api-types": "^0.33.3",
|
||||||
"discord.js": "^13.10.2",
|
"discord.js": "^13.10.3",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"prisma": "^4.2.1",
|
"prisma": "^4.2.1",
|
||||||
"ts-node": "^10.8.2",
|
"ts-node": "^10.8.2",
|
||||||
@ -1114,13 +1115,13 @@
|
|||||||
"integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg=="
|
"integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg=="
|
||||||
},
|
},
|
||||||
"node_modules/discord.js": {
|
"node_modules/discord.js": {
|
||||||
"version": "13.10.2",
|
"version": "13.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.10.2.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.10.3.tgz",
|
||||||
"integrity": "sha512-zPhPaUvJRCqmsqMBmQ8gJ8k/O0rcuLj8tn/mOaJEiDPkpb5aFULHarOfqND6jRuLrKXd2to/bc0mjXTOgRW1MA==",
|
"integrity": "sha512-cIARuxfpQDeqA9Zw3fz4IL20xAhtMsjwJIf7/K82R3n2xROG9/fAx+7qjX8ysp9BfflYqMu2ZskyWq1EAmL5BA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/builders": "^0.16.0",
|
"@discordjs/builders": "^0.16.0",
|
||||||
"@discordjs/collection": "^0.7.0",
|
"@discordjs/collection": "^0.7.0",
|
||||||
"@sapphire/async-queue": "^1.3.2",
|
"@sapphire/async-queue": "^1.5.0",
|
||||||
"@types/node-fetch": "^2.6.2",
|
"@types/node-fetch": "^2.6.2",
|
||||||
"@types/ws": "^8.5.3",
|
"@types/ws": "^8.5.3",
|
||||||
"discord-api-types": "^0.33.3",
|
"discord-api-types": "^0.33.3",
|
||||||
@ -4069,13 +4070,13 @@
|
|||||||
"integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg=="
|
"integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg=="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "13.10.2",
|
"version": "13.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.10.2.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.10.3.tgz",
|
||||||
"integrity": "sha512-zPhPaUvJRCqmsqMBmQ8gJ8k/O0rcuLj8tn/mOaJEiDPkpb5aFULHarOfqND6jRuLrKXd2to/bc0mjXTOgRW1MA==",
|
"integrity": "sha512-cIARuxfpQDeqA9Zw3fz4IL20xAhtMsjwJIf7/K82R3n2xROG9/fAx+7qjX8ysp9BfflYqMu2ZskyWq1EAmL5BA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/builders": "^0.16.0",
|
"@discordjs/builders": "^0.16.0",
|
||||||
"@discordjs/collection": "^0.7.0",
|
"@discordjs/collection": "^0.7.0",
|
||||||
"@sapphire/async-queue": "^1.3.2",
|
"@sapphire/async-queue": "^1.5.0",
|
||||||
"@types/node-fetch": "^2.6.2",
|
"@types/node-fetch": "^2.6.2",
|
||||||
"@types/ws": "^8.5.3",
|
"@types/ws": "^8.5.3",
|
||||||
"discord-api-types": "^0.33.3",
|
"discord-api-types": "^0.33.3",
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
"homepage": "https://github.com/veganhacktivists/arabot#readme",
|
"homepage": "https://github.com/veganhacktivists/arabot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^4.0.0",
|
"@prisma/client": "^4.0.0",
|
||||||
|
"@sapphire/discord.js-utilities": "^5.0.0",
|
||||||
"@sapphire/framework": "^3.0.0",
|
"@sapphire/framework": "^3.0.0",
|
||||||
"@sapphire/plugin-scheduled-tasks": "^4.0.0",
|
"@sapphire/plugin-scheduled-tasks": "^4.0.0",
|
||||||
"@sapphire/plugin-subcommands": "^3.0.0",
|
"@sapphire/plugin-subcommands": "^3.0.0",
|
||||||
@ -35,7 +36,7 @@
|
|||||||
"@types/node": "^18.0.3",
|
"@types/node": "^18.0.3",
|
||||||
"bullmq": "^1.89.1",
|
"bullmq": "^1.89.1",
|
||||||
"discord-api-types": "^0.33.3",
|
"discord-api-types": "^0.33.3",
|
||||||
"discord.js": "^13.10.2",
|
"discord.js": "^13.10.3",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"prisma": "^4.2.1",
|
"prisma": "^4.2.1",
|
||||||
"ts-node": "^10.8.2",
|
"ts-node": "^10.8.2",
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { N1984 } from '../../utils/gifs';
|
import { N1984 } from '../../utils/gifs';
|
||||||
|
|
||||||
export class N1984Command extends Command {
|
class N1984Command extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -63,3 +63,5 @@ export class N1984Command extends Command {
|
|||||||
await interaction.reply({ embeds: [n1984Embed], fetchReply: true });
|
await interaction.reply({ embeds: [n1984Embed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default N1984Command;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Happy } from '../../utils/gifs';
|
import { Happy } from '../../utils/gifs';
|
||||||
|
|
||||||
export class HappyCommand extends Command {
|
class HappyCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -61,3 +61,5 @@ export class HappyCommand extends Command {
|
|||||||
await interaction.reply({ embeds: [happyEmbed], fetchReply: true });
|
await interaction.reply({ embeds: [happyEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default HappyCommand;
|
||||||
|
@ -21,13 +21,12 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Hugs } from '../../utils/gifs';
|
import { Hugs } from '../../utils/gifs';
|
||||||
|
|
||||||
export class HugCommand extends Command {
|
class HugCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
name: 'hug',
|
name: 'hug',
|
||||||
description: 'Hug a user',
|
description: 'Hug a user',
|
||||||
preconditions: [['CoordinatorOnly', 'PatreonOnly']],
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,3 +64,5 @@ export class HugCommand extends Command {
|
|||||||
await interaction.reply({ content: `<@${user.id}>`, embeds: [hugEmbed], fetchReply: true });
|
await interaction.reply({ content: `<@${user.id}>`, embeds: [hugEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default HugCommand;
|
||||||
|
@ -21,13 +21,12 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Kill } from '../../utils/gifs';
|
import { Kill } from '../../utils/gifs';
|
||||||
|
|
||||||
export class KillCommand extends Command {
|
class KillCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
name: 'kill',
|
name: 'kill',
|
||||||
description: 'Kill a user',
|
description: 'Kill a user',
|
||||||
preconditions: [['CoordinatorOnly', 'PatreonOnly']],
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,3 +64,5 @@ export class KillCommand extends Command {
|
|||||||
await interaction.reply({ content: `<@${user.id}>`, embeds: [killEmbed], fetchReply: true });
|
await interaction.reply({ content: `<@${user.id}>`, embeds: [killEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default KillCommand;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Poke } from '../../utils/gifs';
|
import { Poke } from '../../utils/gifs';
|
||||||
|
|
||||||
export class PokeCommand extends Command {
|
class PokeCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -65,3 +65,5 @@ export class PokeCommand extends Command {
|
|||||||
await interaction.reply({ content: `<@${user.id}>`, embeds: [pokeEmbed], fetchReply: true });
|
await interaction.reply({ content: `<@${user.id}>`, embeds: [pokeEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PokeCommand;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Sad } from '../../utils/gifs';
|
import { Sad } from '../../utils/gifs';
|
||||||
|
|
||||||
export class SadCommand extends Command {
|
class SadCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -61,3 +61,5 @@ export class SadCommand extends Command {
|
|||||||
await interaction.reply({ embeds: [sadEmbed], fetchReply: true });
|
await interaction.reply({ embeds: [sadEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SadCommand;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import { Shrug } from '../../utils/gifs';
|
import { Shrug } from '../../utils/gifs';
|
||||||
|
|
||||||
export class ShrugCommand extends Command {
|
class ShrugCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -61,3 +61,5 @@ export class ShrugCommand extends Command {
|
|||||||
await interaction.reply({ embeds: [shrugEmbed], fetchReply: true });
|
await interaction.reply({ embeds: [shrugEmbed], fetchReply: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ShrugCommand;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import type { TextChannel } from 'discord.js';
|
import type { TextChannel } from 'discord.js';
|
||||||
import IDs from '../../utils/ids';
|
import IDs from '../../utils/ids';
|
||||||
|
|
||||||
export class ToggleOpenCommand extends Command {
|
class ToggleOpenCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -52,10 +52,10 @@ export class ToggleOpenCommand extends Command {
|
|||||||
// Checks what subcommand was run
|
// Checks what subcommand was run
|
||||||
switch (subcommand) {
|
switch (subcommand) {
|
||||||
case 'toggleopen': {
|
case 'toggleopen': {
|
||||||
return await this.toggleOpen(interaction);
|
await this.toggleOpen(interaction);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
default: {
|
||||||
|
|
||||||
// If subcommand is invalid
|
// If subcommand is invalid
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Invalid sub command!',
|
content: 'Invalid sub command!',
|
||||||
@ -63,6 +63,8 @@ export class ToggleOpenCommand extends Command {
|
|||||||
fetchReply: true,
|
fetchReply: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Command run
|
// Command run
|
||||||
public async toggleOpen(interaction: Command.ChatInputInteraction) {
|
public async toggleOpen(interaction: Command.ChatInputInteraction) {
|
||||||
@ -123,3 +125,5 @@ export class ToggleOpenCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ToggleOpenCommand;
|
||||||
|
@ -59,7 +59,7 @@ async function findNotes(userId: string, active: boolean) {
|
|||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
// Query to get the specific user's sus notes
|
// Query to get the specific user's sus notes
|
||||||
const getNote = await prisma.sus.findMany({
|
const note = await prisma.sus.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId,
|
userId,
|
||||||
active,
|
active,
|
||||||
@ -68,7 +68,7 @@ async function findNotes(userId: string, active: boolean) {
|
|||||||
|
|
||||||
// Close the database connection
|
// Close the database connection
|
||||||
await prisma.$disconnect();
|
await prisma.$disconnect();
|
||||||
return getNote;
|
return note;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get one note from the id
|
// Get one note from the id
|
||||||
@ -77,7 +77,7 @@ async function getNote(noteId: number) {
|
|||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
// Query to get the specific user's sus notes
|
// Query to get the specific user's sus notes
|
||||||
const getNote = await prisma.sus.findUnique({
|
const note = await prisma.sus.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: noteId,
|
id: noteId,
|
||||||
},
|
},
|
||||||
@ -85,7 +85,7 @@ async function getNote(noteId: number) {
|
|||||||
|
|
||||||
// Close the database connection
|
// Close the database connection
|
||||||
await prisma.$disconnect();
|
await prisma.$disconnect();
|
||||||
return getNote;
|
return note;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deactivateNote(noteId: number) {
|
async function deactivateNote(noteId: number) {
|
||||||
@ -127,7 +127,7 @@ async function deactivateAllNotes(userId: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main command
|
// Main command
|
||||||
export class SusCommand extends Command {
|
class SusCommand extends Command {
|
||||||
public constructor(context: Command.Context) {
|
public constructor(context: Command.Context) {
|
||||||
super(context, {
|
super(context, {
|
||||||
name: 'sus',
|
name: 'sus',
|
||||||
@ -182,19 +182,22 @@ export class SusCommand extends Command {
|
|||||||
// Checks what subcommand was run
|
// Checks what subcommand was run
|
||||||
switch (subcommand) {
|
switch (subcommand) {
|
||||||
case 'add': {
|
case 'add': {
|
||||||
return await this.addNote(interaction);
|
await this.addNote(interaction);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
case 'view': {
|
case 'view': {
|
||||||
return await this.listNote(interaction);
|
await this.listNote(interaction);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
case 'remove': {
|
case 'remove': {
|
||||||
return await this.removeNote(interaction);
|
await this.removeNote(interaction);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
case 'purge': {
|
case 'purge': {
|
||||||
return await this.removeAllNotes(interaction);
|
await this.removeAllNotes(interaction);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
default: {
|
||||||
|
|
||||||
// If subcommand is invalid
|
// If subcommand is invalid
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: 'Invalid sub command!',
|
content: 'Invalid sub command!',
|
||||||
@ -202,9 +205,11 @@ export class SusCommand extends Command {
|
|||||||
fetchReply: true,
|
fetchReply: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Subcommand to add sus note
|
// Subcommand to add sus note
|
||||||
public async addNote(interaction: Command.ChatInputInteraction) {
|
private async addNote(interaction: Command.ChatInputInteraction) {
|
||||||
// Get the arguments
|
// Get the arguments
|
||||||
let user = interaction.options.getUser('user');
|
let user = interaction.options.getUser('user');
|
||||||
let note = interaction.options.getString('note');
|
let note = interaction.options.getString('note');
|
||||||
@ -261,7 +266,7 @@ export class SusCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async listNote(interaction: Command.ChatInputInteraction) {
|
private async listNote(interaction: Command.ChatInputInteraction) {
|
||||||
// Get the arguments
|
// Get the arguments
|
||||||
let user = interaction.options.getUser('user');
|
let user = interaction.options.getUser('user');
|
||||||
const { guild } = interaction;
|
const { guild } = interaction;
|
||||||
@ -321,7 +326,7 @@ export class SusCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async removeNote(interaction: Command.ChatInputInteraction) {
|
private async removeNote(interaction: Command.ChatInputInteraction) {
|
||||||
// Get the arguments
|
// Get the arguments
|
||||||
let noteId = interaction.options.getInteger('id');
|
let noteId = interaction.options.getInteger('id');
|
||||||
const { guild, channel } = interaction;
|
const { guild, channel } = interaction;
|
||||||
@ -439,7 +444,7 @@ export class SusCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async removeAllNotes(interaction: Command.ChatInputInteraction) {
|
private async removeAllNotes(interaction: Command.ChatInputInteraction) {
|
||||||
// Get the arguments
|
// Get the arguments
|
||||||
const user = interaction.options.getUser('user');
|
const user = interaction.options.getUser('user');
|
||||||
const { guild, channel } = interaction;
|
const { guild, channel } = interaction;
|
||||||
@ -557,3 +562,5 @@ export class SusCommand extends Command {
|
|||||||
await userGuildMember!.roles.remove(IDs.roles.restrictions.sus);
|
await userGuildMember!.roles.remove(IDs.roles.restrictions.sus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SusCommand;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||||
import IDs from '../../utils/ids';
|
import IDs from '../../utils/ids';
|
||||||
|
|
||||||
export class StageHostCommand extends Command {
|
class StageHostCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -98,3 +98,5 @@ export class StageHostCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default StageHostCommand;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import { Command, RegisterBehavior } from '@sapphire/framework';
|
import { Command, RegisterBehavior } from '@sapphire/framework';
|
||||||
import IDs from '../../utils/ids';
|
import IDs from '../../utils/ids';
|
||||||
|
|
||||||
export class VegCuriousCommand extends Command {
|
class VegCuriousCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -109,3 +109,5 @@ export class VegCuriousCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default VegCuriousCommand;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import { isMessageInstance } from '@sapphire/discord.js-utilities';
|
import { isMessageInstance } from '@sapphire/discord.js-utilities';
|
||||||
import { Command } from '@sapphire/framework';
|
import { Command } from '@sapphire/framework';
|
||||||
|
|
||||||
export class PingCommand extends Command {
|
class PingCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -49,3 +49,5 @@ export class PingCommand extends Command {
|
|||||||
return interaction.editReply('Failed to retrieve ping :(');
|
return interaction.editReply('Failed to retrieve ping :(');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PingCommand;
|
||||||
|
@ -21,7 +21,7 @@ import { Command, RegisterBehavior } from '@sapphire/framework';
|
|||||||
import { isMessageInstance } from '@sapphire/discord.js-utilities';
|
import { isMessageInstance } from '@sapphire/discord.js-utilities';
|
||||||
import IDs from '../../utils/ids';
|
import IDs from '../../utils/ids';
|
||||||
|
|
||||||
export class purgeVerifyingCommand extends Command {
|
class PurgeVerifyingCommand extends Command {
|
||||||
public constructor(context: Command.Context, options: Command.Options) {
|
public constructor(context: Command.Context, options: Command.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -129,3 +129,5 @@ export class purgeVerifyingCommand extends Command {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PurgeVerifyingCommand;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import type { UserError, ChatInputCommandDeniedPayload } from '@sapphire/framework';
|
import type { UserError, ChatInputCommandDeniedPayload } from '@sapphire/framework';
|
||||||
import { Listener } from '@sapphire/framework';
|
import { Listener } from '@sapphire/framework';
|
||||||
|
|
||||||
export class CommandDeniedListener extends Listener {
|
class CommandDeniedListener extends Listener {
|
||||||
public constructor(context: Listener.Context, options: Listener.Options) {
|
public constructor(context: Listener.Context, options: Listener.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -33,3 +33,5 @@ export class CommandDeniedListener extends Listener {
|
|||||||
return interaction.reply(error.message);
|
return interaction.reply(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CommandDeniedListener;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
import { Listener } from '@sapphire/framework';
|
import { Listener } from '@sapphire/framework';
|
||||||
import type { Client } from 'discord.js';
|
import type { Client } from 'discord.js';
|
||||||
|
|
||||||
export class ReadyListener extends Listener {
|
class ReadyListener extends Listener {
|
||||||
public constructor(context: Listener.Context, options: Listener.Options) {
|
public constructor(context: Listener.Context, options: Listener.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -37,3 +37,5 @@ export class ReadyListener extends Listener {
|
|||||||
this.container.logger.info(`Successfully logged in as ${username} (${id})`);
|
this.container.logger.info(`Successfully logged in as ${username} (${id})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ReadyListener;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class CoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class CoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkCoordinator(message.member!);
|
return this.checkCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
CoordinatorOnly: never;
|
CoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class DevCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class DevCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkDevCoordinator(message.member!);
|
return this.checkDevCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
DevCoordinatorOnly: never;
|
DevCoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DevCoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class DiversityCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class DiversityCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkDiversityCoordinator(message.member!);
|
return this.checkDiversityCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
DiversityCoordinatorOnly: never;
|
DiversityCoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DiversityCoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class EventCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class EventCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkEventCoordinator(message.member!);
|
return this.checkEventCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
EventCoordinatorOnly: never;
|
EventCoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default EventCoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class MentorCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class MentorCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkMentorCoordinator(message.member!);
|
return this.checkMentorCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
MentorCoordinatorOnly: never;
|
MentorCoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default MentorCoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class ModOnlyPrecondition extends AllFlowsPrecondition {
|
class ModOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkMod(message.member!);
|
return this.checkMod(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
ModOnly: never;
|
ModOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ModOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class PatreonOnlyPrecondition extends AllFlowsPrecondition {
|
class PatreonOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkPatreon(message.member!);
|
return this.checkPatreon(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
PatreonOnly: never;
|
PatreonOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PatreonOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class VerifierCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
class VerifierCoordinatorOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkVerifierCoordinator(message.member!);
|
return this.checkVerifierCoordinator(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
VerifierCoordinatorOnly: never;
|
VerifierCoordinatorOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default VerifierCoordinatorOnlyPrecondition;
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class VerifierOnlyPrecondition extends AllFlowsPrecondition {
|
class VerifierOnlyPrecondition extends AllFlowsPrecondition {
|
||||||
public override async messageRun(message: Message) {
|
public override async messageRun(message: Message) {
|
||||||
// for message command
|
// for message command
|
||||||
return this.checkVerifier(message.member!);
|
return this.checkVerifier(message.member!);
|
||||||
@ -54,3 +54,5 @@ declare module '@sapphire/framework' {
|
|||||||
VerifierOnly: never;
|
VerifierOnly: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default VerifierOnlyPrecondition;
|
||||||
|
50
src/scheduled-tasks/appleWarning.ts
Normal file
50
src/scheduled-tasks/appleWarning.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
/*
|
||||||
|
Animal Rights Advocates Discord Bot
|
||||||
|
Copyright (C) 2022 Anthony Berg
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks';
|
||||||
|
import { container } from '@sapphire/framework';
|
||||||
|
import type { TextChannel } from 'discord.js';
|
||||||
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
|
class AppleWarningTask extends ScheduledTask {
|
||||||
|
public constructor(context: ScheduledTask.Context, options: ScheduledTask.Options) {
|
||||||
|
super(context, {
|
||||||
|
...options,
|
||||||
|
cron: '0 */2 * * 2-3',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public async run() {
|
||||||
|
const { client } = container;
|
||||||
|
|
||||||
|
const channel = client.channels.cache.get(IDs.channels.nonVegan.general) as TextChannel;
|
||||||
|
|
||||||
|
await channel.send('Hiya everyone, this is a warning to all **Apple users**!\n'
|
||||||
|
+ 'Make sure to update your iOS, iPadOS and MacOS as there is a hack that lets anyone get remote access to your device if you click on a malicious link.\n'
|
||||||
|
+ `For more information, read the post in <#${IDs.channels.information.news}>`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module '@sapphire/plugin-scheduled-tasks' {
|
||||||
|
interface ScheduledTasks {
|
||||||
|
cron: never;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AppleWarningTask;
|
@ -22,7 +22,7 @@ import { container } from '@sapphire/framework';
|
|||||||
import type { TextChannel } from 'discord.js';
|
import type { TextChannel } from 'discord.js';
|
||||||
import IDs from '../utils/ids';
|
import IDs from '../utils/ids';
|
||||||
|
|
||||||
export class StandupTask extends ScheduledTask {
|
class StandupTask extends ScheduledTask {
|
||||||
public constructor(context: ScheduledTask.Context, options: ScheduledTask.Options) {
|
public constructor(context: ScheduledTask.Context, options: ScheduledTask.Options) {
|
||||||
super(context, {
|
super(context, {
|
||||||
...options,
|
...options,
|
||||||
@ -45,3 +45,5 @@ declare module '@sapphire/plugin-scheduled-tasks' {
|
|||||||
cron: never;
|
cron: never;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default StandupTask;
|
||||||
|
87
src/utils/dbExistingUser.ts
Normal file
87
src/utils/dbExistingUser.ts
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
/*
|
||||||
|
Animal Rights Advocates Discord Bot
|
||||||
|
Copyright (C) 2022 Anthony Berg
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { GuildMember } from 'discord.js';
|
||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import IDs from './ids';
|
||||||
|
|
||||||
|
// Checks if the user exists on the database
|
||||||
|
export async function userExists(user: GuildMember) {
|
||||||
|
// Initialises Prisma Client
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
// Counts if the user is on the database by their snowflake
|
||||||
|
const userQuery = await prisma.user.count({
|
||||||
|
where: {
|
||||||
|
id: user.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close the database connection
|
||||||
|
await prisma.$disconnect();
|
||||||
|
|
||||||
|
// If the user is found on the database, then return true, otherwise, false.
|
||||||
|
return userQuery > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adds the user to the database if they were already on the server before the bot/database
|
||||||
|
export async function addExistingUser(user: GuildMember) {
|
||||||
|
// Initialises Prisma Client
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
// Counts if the user is on the database by their snowflake
|
||||||
|
const userQuery = await prisma.user.count({
|
||||||
|
where: {
|
||||||
|
id: user.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// If the user is already in the database
|
||||||
|
if (userQuery > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks what roles the user has
|
||||||
|
const hasVegan = user.roles.cache.has(IDs.roles.vegan.vegan);
|
||||||
|
const hasActivist = user.roles.cache.has(IDs.roles.vegan.activist);
|
||||||
|
const hasPlus = user.roles.cache.has(IDs.roles.vegan.plus);
|
||||||
|
const hasNotVegan = user.roles.cache.has(IDs.roles.nonvegan.nonvegan);
|
||||||
|
const hasVegCurious = user.roles.cache.has(IDs.roles.nonvegan.vegCurious);
|
||||||
|
const hasConvinced = user.roles.cache.has(IDs.roles.nonvegan.convinced);
|
||||||
|
const hasTrusted = user.roles.cache.has(IDs.roles.trusted);
|
||||||
|
const hasMuted = user.roles.cache.has(IDs.roles.restrictions.muted);
|
||||||
|
|
||||||
|
// Create the user in the database
|
||||||
|
await prisma.user.create({
|
||||||
|
data: {
|
||||||
|
id: user.id,
|
||||||
|
vegan: hasVegan,
|
||||||
|
trusted: hasTrusted,
|
||||||
|
activist: hasActivist,
|
||||||
|
plus: hasPlus,
|
||||||
|
notVegan: hasNotVegan,
|
||||||
|
vegCurious: hasVegCurious,
|
||||||
|
convinced: hasConvinced,
|
||||||
|
muted: hasMuted,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close the database connection
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
@ -57,11 +57,17 @@ const devIDs = {
|
|||||||
verifyBlock: '1007477161835372574',
|
verifyBlock: '1007477161835372574',
|
||||||
},
|
},
|
||||||
channels: {
|
channels: {
|
||||||
|
information: {
|
||||||
|
news: '999431676058927247',
|
||||||
|
},
|
||||||
staff: {
|
staff: {
|
||||||
coordinators: '999431676058927254',
|
coordinators: '999431676058927254',
|
||||||
standup: '999431676289622183',
|
standup: '999431676289622183',
|
||||||
verifiers: '999431677006860411',
|
verifiers: '999431677006860411',
|
||||||
},
|
},
|
||||||
|
nonVegan: {
|
||||||
|
general: '999431677325615189',
|
||||||
|
},
|
||||||
diversity: {
|
diversity: {
|
||||||
women: '999431679053660187',
|
women: '999431679053660187',
|
||||||
lgbtqia: '999431679053660188',
|
lgbtqia: '999431679053660188',
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
import devIDs from './devIDs';
|
import devIDs from './devIDs';
|
||||||
|
|
||||||
|
// eslint-disable-next-line import/no-mutable-exports
|
||||||
let IDs = {
|
let IDs = {
|
||||||
roles: {
|
roles: {
|
||||||
trusted: '731563158011117590',
|
trusted: '731563158011117590',
|
||||||
@ -59,11 +60,17 @@ let IDs = {
|
|||||||
verifyBlock: '',
|
verifyBlock: '',
|
||||||
},
|
},
|
||||||
channels: {
|
channels: {
|
||||||
|
information: {
|
||||||
|
news: '866000393259319306',
|
||||||
|
},
|
||||||
staff: {
|
staff: {
|
||||||
coordinators: '1006240682505142354',
|
coordinators: '1006240682505142354',
|
||||||
standup: '996009201237233684',
|
standup: '996009201237233684',
|
||||||
verifiers: '873215538627756072',
|
verifiers: '873215538627756072',
|
||||||
},
|
},
|
||||||
|
nonVegan: {
|
||||||
|
general: '798967615636504657',
|
||||||
|
},
|
||||||
diversity: {
|
diversity: {
|
||||||
women: '938808963544285324',
|
women: '938808963544285324',
|
||||||
lgbtqia: '956224226556272670',
|
lgbtqia: '956224226556272670',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user