remove copyright comment
This commit is contained in:
parent
dc4dc8d5bd
commit
108ee8e0e8
1 changed files with 44 additions and 62 deletions
|
@ -1,72 +1,54 @@
|
||||||
/*
|
|
||||||
* Vencord, a modification for Discord's desktop app
|
|
||||||
* Copyright (c) 2022 Vendicated and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
mode: {
|
mode: {
|
||||||
description: "Content to show",
|
description: "Content to show",
|
||||||
type: OptionType.SELECT,
|
type: OptionType.SELECT,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: "Name and content",
|
label: "Name and content",
|
||||||
value: 0,
|
value: 0,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Name only",
|
label: "Name only",
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "No name or content",
|
label: "No name or content",
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "NotificationContent",
|
name: "NotificationContent",
|
||||||
description: "Customize notification content",
|
description: "Customize notification content",
|
||||||
authors: [{ name: "slonkazoid", id: 276363003270791168n }],
|
authors: [{ name: "slonkazoid", id: 276363003270791168n }],
|
||||||
settings,
|
settings,
|
||||||
|
|
||||||
process(
|
process(
|
||||||
icon: string,
|
icon: string,
|
||||||
title: string,
|
title: string,
|
||||||
body: string
|
body: string
|
||||||
): { icon?: string; title: string; body: string } {
|
): { icon?: string; title: string; body: string } {
|
||||||
return {
|
return {
|
||||||
icon: settings.store.mode !== 2 ? icon : undefined,
|
icon: settings.store.mode !== 2 ? icon : undefined,
|
||||||
title: settings.store.mode !== 2 ? title : "Discord",
|
title: settings.store.mode !== 2 ? title : "Discord",
|
||||||
body: settings.store.mode === 0 ? body : "New message",
|
body: settings.store.mode === 0 ? body : "New message",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "showNotification:function",
|
find: "showNotification:function",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(showNotification:function\((\i),(\i),(\i),\i,\i\){)/,
|
match: /(showNotification:function\((\i),(\i),(\i),\i,\i\){)/,
|
||||||
replace:
|
replace:
|
||||||
"$1let processed = $self.process($2, $3, $4); $2 = processed.icon; $3 = processed.title; $4 = processed.body;",
|
"$1let processed = $self.process($2, $3, $4); $2 = processed.icon; $3 = processed.title; $4 = processed.body;",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue