Skip to content

Commit 25a1f6b

Browse files
committed
merge
2 parents dcc7190 + 66cec5a commit 25a1f6b

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed
Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
CommandInteraction,
23
MessageReaction,
34
PartialMessageReaction,
45
PartialUser,
@@ -9,6 +10,7 @@ import {
910
bankerRoleId,
1011
officerRoleId,
1112
bankTransactionsChannelId,
13+
modRoleId,
1214
} from "../../../config";
1315
import {
1416
ReactionAction,
@@ -28,31 +30,44 @@ class BankRequestFinishedReactionAction extends ReactionAction {
2830
if (this.message.channel.id !== bankRequestsChannelId) {
2931
return;
3032
}
31-
32-
// filter non-finish emoji reactions
33-
if (this.reaction.emoji.name !== "✅") {
34-
return;
33+
// mark finished
34+
if (this.reaction.emoji.name === "✅") {
35+
const bankTransactionsChannel = await getTextChannel(
36+
bankTransactionsChannelId
37+
);
38+
let transactionContent = this.message.content + ` -- ✅ by ${this.user}`;
39+
if (!this.message.author?.bot) {
40+
transactionContent = this.message.author?.toString() + ": " + transactionContent;
41+
}
42+
bankTransactionsChannel?.send(transactionContent);
43+
// authorize user
44+
const reactor = await this.members?.fetch(this.user.id);
45+
if (
46+
!(
47+
reactor?.roles.cache.has(bankerRoleId) ||
48+
reactor?.roles.cache.has(officerRoleId) ||
49+
reactor?.roles.cache.has(modRoleId)
50+
)
51+
) {
52+
return;
53+
}
54+
this.message.delete();
3555
}
3656

37-
// authorize user
38-
const reactor = await this.members?.fetch(this.user.id);
39-
if (
40-
!(
41-
reactor?.roles.cache.has(bankerRoleId) ||
42-
reactor?.roles.cache.has(officerRoleId)
43-
)
44-
) {
45-
return;
57+
// delete
58+
if (this.reaction.emoji.name === "❌") {
59+
const reactor = await this.members?.fetch(this.user.id);
60+
if (
61+
!(
62+
reactor?.roles.cache.has(bankerRoleId) ||
63+
reactor?.roles.cache.has(officerRoleId) ||
64+
reactor?.roles.cache.has(modRoleId)
65+
) || this.message.mentions?.parsedUsers.hasAny(this.user.username ?? "")
66+
) {
67+
return;
68+
}
69+
this.message.delete();
4670
}
4771

48-
const bankTransactionsChannel = await getTextChannel(
49-
bankTransactionsChannelId
50-
);
51-
let transactionContent = this.message.content + ` -- ✅ by ${this.user}`;
52-
if (!this.message.author?.bot) {
53-
transactionContent = this.message.author?.toString() + ": " + transactionContent;
54-
}
55-
bankTransactionsChannel?.send(transactionContent);
56-
this.message.delete();
5772
}
5873
}

src/features/bank-request-info/bank-services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const services: Service[] = [
7070
"_NFP Bank or EC Tunnel_",
7171
"PP4DKP (Platinum Pieces for Dragon Kill Points) Fundraising",
7272
"PP4DKP runs on a monthly cycle with DKP recorded the following month",
73-
"1k = 1 DKP; 5 maximum",
73+
"1k = 1 DKP; 30 maximum",
7474
"No fractional DKP or rounding; Only PP, no items",
7575
],
7676
},

0 commit comments

Comments
 (0)