Skip to content

Commit 39e939a

Browse files
authored
Merge pull request #5 from uwcsc/fan-masskick-fix
masskick fix
2 parents 2b07c1f + 9f558b5 commit 39e939a

File tree

8 files changed

+51
-31
lines changed

8 files changed

+51
-31
lines changed

.eslintrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
],
99
"rules": {
1010
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
11-
"@typescript-eslint/no-non-null-assertion": "off"
11+
"@typescript-eslint/no-non-null-assertion": "off",
12+
"no-console": 1,
13+
"prettier/prettier": [
14+
"error",
15+
{
16+
"endOfLine": "auto"
17+
}
18+
]
1219
}
1320
}

config/dev/vars.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/bot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ export const startBot = async (): Promise<void> => {
5353
logger.info({
5454
event: "init",
5555
});
56-
initBootcamp(client);
5756

5857
client.on("error", client.logger.error);
5958
// Use this on the discord.js client after sapphire
6059
// client.on('error', logger.error);
6160
client.on("ready", initReady);
61+
client.on("ready", initBootcamp);
6262
client.on("messageCreate", (message: Message) => {
6363
initMessageCreate(client, logger, message);
6464
});

src/codeyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export class CodeyCommand extends SapphireCommand {
322322
}
323323
}
324324

325-
console.log(subcommandName);
325+
// console.log(subcommandName);
326326
// Move the "argument picker" by one parameter if subcommand name is defined
327327
if (
328328
subcommandName &&

src/commandDetails/admin/ban.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const banExecuteCommand: SapphireMessageExecuteType = async (
3838

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

4444
if (await banUser(memberInGuild, reason, days)) {

src/commandDetails/admin/massKick.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { container } from "@sapphire/framework";
2-
import { Permissions } from "discord.js";
2+
import { Guild, Permissions } from "discord.js";
33
import {
44
CodeyCommandDetails,
55
SapphireMessageExecuteType,
@@ -11,6 +11,7 @@ const listOfRoleNamesToNotKick = [
1111
"Executive",
1212
"Coordinator",
1313
"carl-bot",
14+
"Codey Bootcamp",
1415
];
1516

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

3031
// Get the GuildMember object corresponding to the user in the guild
3132
// This is needed because we can only ban GuildMembers, not Users
32-
const guild = await client.guilds.fetch(vars.TARGET_GUILD_ID);
33-
const memberList = await (
34-
await client.guilds.fetch(guild.id)
35-
).members.fetch();
36-
memberList.forEach((member) => {
33+
const guild = await client.guilds.fetch({
34+
guild: vars.BOOTCAMP_GUILD_ID,
35+
cache: true,
36+
});
37+
const memberList = await guild.members.fetch();
38+
memberList.forEach((member, _) => {
3739
if (
3840
!member.roles.cache.find((role) =>
3941
listOfRoleNamesToNotKick.includes(role.name)

src/commandDetails/miscellaneous/help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
SapphireMessageResponse,
66
} from "../../codeyCommand";
77

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

1010
const helpExecuteCommand: SapphireMessageExecuteType = (
1111
_client,

yarn.lock

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,22 @@
253253
resolved "https://registry.yarnpkg.com/@sapphire/result/-/result-1.1.1.tgz#c268decd12f66e7adf00a3d6d24987640bf548b7"
254254
integrity sha512-mKWq+HCu9t+gqVcXMhfH72Trj6cO0LZilpdVYndqRb3+30mrRqs+NtdSf1wAERYEtBmOf3ZWvROe4RPSx7aKvw==
255255

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

264+
"@sapphire/shapeshift@^3.5.1":
265+
version "3.9.2"
266+
resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz#a9c12cd51e1bc467619bb56df804450dd14871ac"
267+
integrity sha512-YRbCXWy969oGIdqR/wha62eX8GNHsvyYi0Rfd4rNW6tSVVa8p0ELiMEuOH/k8rgtvRoM+EMV7Csqz77YdwiDpA==
268+
dependencies:
269+
fast-deep-equal "^3.1.3"
270+
lodash "^4.17.21"
271+
264272
"@sapphire/stopwatch@^1.4.1":
265273
version "1.5.0"
266274
resolved "https://registry.yarnpkg.com/@sapphire/stopwatch/-/stopwatch-1.5.0.tgz#4acf7352f969f0c81d69a838ecbfc8b6026ff660"
@@ -339,6 +347,14 @@
339347
"@types/node" "*"
340348
form-data "^3.0.0"
341349

350+
"@types/node-fetch@^2.6.3":
351+
version "2.6.4"
352+
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660"
353+
integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==
354+
dependencies:
355+
"@types/node" "*"
356+
form-data "^3.0.0"
357+
342358
"@types/node@*":
343359
version "18.11.13"
344360
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.13.tgz#dff34f226ec1ac0432ae3b136ec5552bd3b9c0fe"
@@ -361,10 +377,10 @@
361377
dependencies:
362378
"@types/node" "*"
363379

364-
"@types/ws@^8.5.3":
365-
version "8.5.3"
366-
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d"
367-
integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==
380+
"@types/ws@^8.5.4":
381+
version "8.5.5"
382+
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb"
383+
integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==
368384
dependencies:
369385
"@types/node" "*"
370386

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

857873
discord.js@^13.6.0:
858-
version "13.12.0"
859-
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-13.12.0.tgz#e4839c14a02b1947e063b72f09a49b11336a58f5"
860-
integrity sha512-K5qhREsYcTHkEqt7+7LcSoXTeQYZpI+SQRs9ei/FhbhUpirmjqFtN99P8W2mrKUyhhy7WXWm7rnna0AooKtIpw==
874+
version "13.16.0"
875+
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-13.16.0.tgz#3a60d0672ff9427cfa08b6f5548d9af269d1d77c"
876+
integrity sha512-bOoCs1Ilojd/UshZVxmEcpxVmHcYOv2fPVZOVq3aFV8xrKLJfaF9mxlvGZ1D1z9aIqf2NkptDr+QndeNuQBTxQ==
861877
dependencies:
862878
"@discordjs/builders" "^0.16.0"
863879
"@discordjs/collection" "^0.7.0"
864880
"@sapphire/async-queue" "^1.5.0"
865-
"@types/node-fetch" "^2.6.2"
866-
"@types/ws" "^8.5.3"
881+
"@types/node-fetch" "^2.6.3"
882+
"@types/ws" "^8.5.4"
867883
discord-api-types "^0.33.5"
868884
form-data "^4.0.0"
869885
node-fetch "^2.6.7"
870-
ws "^8.9.0"
886+
ws "^8.13.0"
871887

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

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

24962512
y18n@^5.0.5:
24972513
version "5.0.8"

0 commit comments

Comments
 (0)