feat(NoReplyMention): exempt list support (#337)
This commit is contained in:
parent
f1bdfdd6b9
commit
f6122a00ca
2 changed files with 33 additions and 6 deletions
|
@ -16,20 +16,43 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { Settings } from "@api/settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
|
||||||
|
interface Reply {
|
||||||
|
message: {
|
||||||
|
author: {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "NoReplyMention",
|
name: "NoReplyMention",
|
||||||
description: "Disables reply pings by default",
|
description: "Disables reply pings by default",
|
||||||
authors: [Devs.DustyAngel47],
|
authors: [Devs.DustyAngel47, Devs.axyie],
|
||||||
|
options: {
|
||||||
|
exemptList: {
|
||||||
|
description:
|
||||||
|
"List of users to exempt from this plugin (separated by commas)",
|
||||||
|
type: OptionType.STRING,
|
||||||
|
default: "1234567890123445,1234567890123445",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shouldMention(reply: Reply) {
|
||||||
|
return Settings.plugins.NoReplyMention.exemptList.includes(
|
||||||
|
reply.message.author.id
|
||||||
|
);
|
||||||
|
},
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "CREATE_PENDING_REPLY:function",
|
find: "CREATE_PENDING_REPLY:function",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /CREATE_PENDING_REPLY:function\((.{1,2})\){/,
|
match: /CREATE_PENDING_REPLY:function\((.{1,2})\){/,
|
||||||
replace: "CREATE_PENDING_REPLY:function($1){$1.shouldMention=false;"
|
replace:
|
||||||
}
|
"CREATE_PENDING_REPLY:function($1){$1.shouldMention=Vencord.Plugins.plugins.NoReplyMention.shouldMention($1);",
|
||||||
}
|
},
|
||||||
]
|
},
|
||||||
|
],
|
||||||
});
|
});
|
|
@ -173,4 +173,8 @@ export const Devs = Object.freeze({
|
||||||
name: "ActuallyTheSun",
|
name: "ActuallyTheSun",
|
||||||
id: 406028027768733696n
|
id: 406028027768733696n
|
||||||
},
|
},
|
||||||
|
axyie: {
|
||||||
|
name: "'ax",
|
||||||
|
id: 273562710745284628n,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue