Skip to content

Commit

Permalink
Merge pull request #5 from uwcsc/fan-masskick-fix
Browse files Browse the repository at this point in the history
masskick fix
  • Loading branch information
Fan-Yang-284 authored Sep 11, 2023
2 parents 2b07c1f + 9f558b5 commit 39e939a
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 31 deletions.
9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
],
"rules": {
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": 1,
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}
5 changes: 0 additions & 5 deletions config/dev/vars.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export const startBot = async (): Promise<void> => {
logger.info({
event: "init",
});
initBootcamp(client);

client.on("error", client.logger.error);
// Use this on the discord.js client after sapphire
// client.on('error', logger.error);
client.on("ready", initReady);
client.on("ready", initBootcamp);
client.on("messageCreate", (message: Message) => {
initMessageCreate(client, logger, message);
});
Expand Down
2 changes: 1 addition & 1 deletion src/codeyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export class CodeyCommand extends SapphireCommand {
}
}

console.log(subcommandName);
// console.log(subcommandName);
// Move the "argument picker" by one parameter if subcommand name is defined
if (
subcommandName &&
Expand Down
2 changes: 1 addition & 1 deletion src/commandDetails/admin/ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const banExecuteCommand: SapphireMessageExecuteType = async (

// Get the GuildMember object corresponding to the user in the guild
// This is needed because we can only ban GuildMembers, not Users
const guild = await client.guilds.fetch(vars.TARGET_GUILD_ID);
const guild = await client.guilds.fetch(vars.BOOTCAMP_GUILD_ID);
const memberInGuild = await guild.members.fetch({ user });

if (await banUser(memberInGuild, reason, days)) {
Expand Down
14 changes: 8 additions & 6 deletions src/commandDetails/admin/massKick.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { container } from "@sapphire/framework";
import { Permissions } from "discord.js";
import { Guild, Permissions } from "discord.js";

Check warning on line 2 in src/commandDetails/admin/massKick.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'Guild' is defined but never used
import {
CodeyCommandDetails,
SapphireMessageExecuteType,
Expand All @@ -11,6 +11,7 @@ const listOfRoleNamesToNotKick = [
"Executive",
"Coordinator",
"carl-bot",
"Codey Bootcamp",
];

// Mass kick users not in specified roles
Expand All @@ -29,11 +30,12 @@ const massKickExecuteCommand: SapphireMessageExecuteType = async (

// Get the GuildMember object corresponding to the user in the guild
// This is needed because we can only ban GuildMembers, not Users
const guild = await client.guilds.fetch(vars.TARGET_GUILD_ID);
const memberList = await (
await client.guilds.fetch(guild.id)
).members.fetch();
memberList.forEach((member) => {
const guild = await client.guilds.fetch({
guild: vars.BOOTCAMP_GUILD_ID,
cache: true,
});
const memberList = await guild.members.fetch();
memberList.forEach((member, _) => {
if (
!member.roles.cache.find((role) =>
listOfRoleNamesToNotKick.includes(role.name)
Expand Down
2 changes: 1 addition & 1 deletion src/commandDetails/miscellaneous/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SapphireMessageResponse,
} from "../../codeyCommand";

const wikiLink = "https://github.com/uwcsc/codeybot/wiki/Command-Help";
const wikiLink = "https://github.com/uwcsc/codey-bootcamp/wiki/Commands-Help";

const helpExecuteCommand: SapphireMessageExecuteType = (
_client,
Expand Down
46 changes: 31 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,22 @@
resolved "https://registry.yarnpkg.com/@sapphire/result/-/result-1.1.1.tgz#c268decd12f66e7adf00a3d6d24987640bf548b7"
integrity sha512-mKWq+HCu9t+gqVcXMhfH72Trj6cO0LZilpdVYndqRb3+30mrRqs+NtdSf1wAERYEtBmOf3ZWvROe4RPSx7aKvw==

"@sapphire/shapeshift@^3.1.0", "@sapphire/shapeshift@^3.5.1":
"@sapphire/shapeshift@^3.1.0":
version "3.8.0"
resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.8.0.tgz#98935442716df3a538599982e92a85a36986e627"
integrity sha512-Ec8CqUy7CX87jM1AAUfVycNrKnKmfdOzJhq0gqlRRMQFPcarKV5z8P8TVFgN09E6bbKQW+Lh4Zsi+dzDadeyzw==
dependencies:
fast-deep-equal "^3.1.3"
lodash "^4.17.21"

"@sapphire/shapeshift@^3.5.1":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz#a9c12cd51e1bc467619bb56df804450dd14871ac"
integrity sha512-YRbCXWy969oGIdqR/wha62eX8GNHsvyYi0Rfd4rNW6tSVVa8p0ELiMEuOH/k8rgtvRoM+EMV7Csqz77YdwiDpA==
dependencies:
fast-deep-equal "^3.1.3"
lodash "^4.17.21"

"@sapphire/stopwatch@^1.4.1":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@sapphire/stopwatch/-/stopwatch-1.5.0.tgz#4acf7352f969f0c81d69a838ecbfc8b6026ff660"
Expand Down Expand Up @@ -339,6 +347,14 @@
"@types/node" "*"
form-data "^3.0.0"

"@types/node-fetch@^2.6.3":
version "2.6.4"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660"
integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==
dependencies:
"@types/node" "*"
form-data "^3.0.0"

"@types/node@*":
version "18.11.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.13.tgz#dff34f226ec1ac0432ae3b136ec5552bd3b9c0fe"
Expand All @@ -361,10 +377,10 @@
dependencies:
"@types/node" "*"

"@types/ws@^8.5.3":
version "8.5.3"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d"
integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==
"@types/ws@^8.5.4":
version "8.5.5"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb"
integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==
dependencies:
"@types/node" "*"

Expand Down Expand Up @@ -855,19 +871,19 @@ discord-api-types@^0.36.2, discord-api-types@^0.36.3:
integrity sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==

discord.js@^13.6.0:
version "13.12.0"
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-13.12.0.tgz#e4839c14a02b1947e063b72f09a49b11336a58f5"
integrity sha512-K5qhREsYcTHkEqt7+7LcSoXTeQYZpI+SQRs9ei/FhbhUpirmjqFtN99P8W2mrKUyhhy7WXWm7rnna0AooKtIpw==
version "13.16.0"
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-13.16.0.tgz#3a60d0672ff9427cfa08b6f5548d9af269d1d77c"
integrity sha512-bOoCs1Ilojd/UshZVxmEcpxVmHcYOv2fPVZOVq3aFV8xrKLJfaF9mxlvGZ1D1z9aIqf2NkptDr+QndeNuQBTxQ==
dependencies:
"@discordjs/builders" "^0.16.0"
"@discordjs/collection" "^0.7.0"
"@sapphire/async-queue" "^1.5.0"
"@types/node-fetch" "^2.6.2"
"@types/ws" "^8.5.3"
"@types/node-fetch" "^2.6.3"
"@types/ws" "^8.5.4"
discord-api-types "^0.33.5"
form-data "^4.0.0"
node-fetch "^2.6.7"
ws "^8.9.0"
ws "^8.13.0"

doctrine@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -2488,10 +2504,10 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==

ws@^8.9.0:
version "8.11.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143"
integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==
ws@^8.13.0:
version "8.14.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.1.tgz#4b9586b4f70f9e6534c7bb1d3dc0baa8b8cf01e0"
integrity sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==

y18n@^5.0.5:
version "5.0.8"
Expand Down

0 comments on commit 39e939a

Please sign in to comment.