fix(RoleColorEverywhere): MessageLinkEmbeds DM error (#648)

This commit is contained in:
Lewis Crichton 2023-03-22 02:57:53 +00:00 committed by GitHub
parent a2f0c912f0
commit 55a66dbb39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,7 +53,7 @@ export default definePlugin({
replacement: [ replacement: [
{ {
match: /user:(\i),channel:(\i).{0,300}?"@"\.concat\(.+?\)/, match: /user:(\i),channel:(\i).{0,300}?"@"\.concat\(.+?\)/,
replace: "$&,color:$self.getUserColor($1.id,{channelId:$2.id})" replace: "$&,color:$self.getUserColor($1.id,{channelId:$2?.id})"
} }
], ],
predicate: () => settings.store.chatMentions, predicate: () => settings.store.chatMentions,
@ -65,7 +65,7 @@ export default definePlugin({
replacement: [ replacement: [
{ {
match: /function \i\((\i)\).{5,20}id.{5,20}guildId.{5,10}channelId.{100,150}hidePersonalInformation.{5,50}jsx.{5,20},{/, match: /function \i\((\i)\).{5,20}id.{5,20}guildId.{5,10}channelId.{100,150}hidePersonalInformation.{5,50}jsx.{5,20},{/,
replace: "$&color:$self.getUserColor($1.id,{guildId:$1.guildId})," replace: "$&color:$self.getUserColor($1.id,{guildId:$1?.guildId}),"
} }
], ],
predicate: () => settings.store.chatMentions, predicate: () => settings.store.chatMentions,