Skip to content

Commit 879b933

Browse files
committed
Merge branch 'master' of https://github.com/mojira/mojira-discord-bot into feature/mention-config
2 parents 873101b + 43b3cdf commit 879b933

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Diff for: src/commands/MentionCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ export default class MentionCommand extends Command<MentionArguments> {
4141
return { mentions, matches };
4242
}
4343

44+
<<<<<<< HEAD
4445
public async run( message: Message, args: MentionArguments ): Promise<boolean> {
46+
=======
47+
public static get ticketLinkRegex(): RegExp {
48+
return new RegExp( `https?://bugs.mojang.com/(?:browse|projects/\\w+/issues)/(${ MentionCommand.ticketPattern })`, 'g' );
49+
}
50+
>>>>>>> 43b3cdfff8d4e88c40b2cdb9a8405d529a0bb327
4551

4652
let mentions = new Array<Mention>();
4753
let group = false;

Diff for: src/permissions/ModeratorPermission.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Permission from './Permission';
66
* This allows the command to be run by any guild member who has the "Manage messages" permission serverwide.
77
*/
88
export default class ModeratorPermission extends Permission {
9-
public checkPermission( member: GuildMember ): boolean {
10-
return member.hasPermission( 'MANAGE_MESSAGES' );
9+
public checkPermission( member?: GuildMember ): boolean {
10+
return member?.hasPermission( 'MANAGE_MESSAGES' );
1111
}
1212
}

Diff for: src/permissions/OwnerPermission.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Permission from './Permission';
33
import BotConfig from '../BotConfig';
44

55
export default class OwnerPermission extends Permission {
6-
public checkPermission( member: GuildMember ): boolean {
7-
return member.id === BotConfig.owner;
6+
public checkPermission( member?: GuildMember ): boolean {
7+
return member?.id === BotConfig.owner;
88
}
99
}

Diff for: src/util/MentionUtil.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class MentionUtil {
1414
}
1515

1616
public static get linkPattern(): string {
17-
return 'https?:\\/\\/bugs.mojang.com\\/browse\\/';
17+
return 'https?:\\/\\/bugs.mojang.com\\/(?:browse|projects\\/\\w+\\/issues)\\/';
1818
}
1919

2020
public static get ticketLinkPattern(): string {

0 commit comments

Comments
 (0)