BypassDND -> BypassStatus

This commit is contained in:
thororen1234 2024-08-18 00:20:36 -04:00
parent aca51e64f8
commit 92fe7335fb
12 changed files with 32 additions and 25 deletions

View file

@ -37,7 +37,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- BetterUserArea by Samwich - BetterUserArea by Samwich
- BlockKeywords by catcraft - BlockKeywords by catcraft
- BlockKrsip by D3SOX - BlockKrsip by D3SOX
- BypassDND by Inbestigator - BypassStatus by Inbestigator and thororen
- ChannelTabs by TheSun, TheKodeToad, keifufu, Nickyux - ChannelTabs by TheSun, TheKodeToad, keifufu, Nickyux
- CleanChannelName by AutumnVN - CleanChannelName by AutumnVN
- ClientSideBlock by Samwich - ClientSideBlock by Samwich

View file

@ -6,7 +6,7 @@
import { type NavContextMenuPatchCallback } from "@api/ContextMenu"; import { type NavContextMenuPatchCallback } from "@api/ContextMenu";
import { Notifications } from "@api/index"; import { Notifications } from "@api/index";
import { definePluginSettings } from "@api/Settings"; import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { getCurrentChannel } from "@utils/discord"; import { getCurrentChannel } from "@utils/discord";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
@ -119,11 +119,35 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Whether the notification sound should be played", description: "Whether the notification sound should be played",
default: true, default: true,
},
statusToUse: {
type: OptionType.SELECT,
description: "Status to use for whitelist",
options: [
{
label: "Online",
value: "online",
},
{
label: "Idle",
value: "idle",
},
{
label: "Do Not Disturb",
value: "dnd",
default: true
},
{
label: "Invisible",
value: "invisible",
}
]
} }
}); });
migratePluginSettings("BypassStatus", "BypassDND");
export default definePlugin({ export default definePlugin({
name: "BypassDND", name: "BypassStatus",
description: "Still get notifications from specific sources when in do not disturb mode. Right-click on users/channels/guilds to set them to bypass do not disturb mode.", description: "Still get notifications from specific sources when in do not disturb mode. Right-click on users/channels/guilds to set them to bypass do not disturb mode.",
authors: [Devs.Inbestigator], authors: [Devs.Inbestigator],
flux: { flux: {
@ -132,7 +156,7 @@ export default definePlugin({
const currentUser = UserStore.getCurrentUser(); const currentUser = UserStore.getCurrentUser();
const userStatus = await PresenceStore.getStatus(currentUser.id); const userStatus = await PresenceStore.getStatus(currentUser.id);
const currentChannelId = getCurrentChannel()?.id ?? "0"; const currentChannelId = getCurrentChannel()?.id ?? "0";
if (message.state === "SENDING" || message.content === "" || message.author.id === currentUser.id || (channelId === currentChannelId && WindowStore.isFocused()) || userStatus !== "dnd") { if (message.state === "SENDING" || message.content === "" || message.author.id === currentUser.id || (channelId === currentChannelId && WindowStore.isFocused()) || userStatus !== settings.store.statusToUse) {
return; return;
} }
const mentioned = MessageStore.getMessage(channelId, message.id)?.mentioned; const mentioned = MessageStore.getMessage(channelId, message.id)?.mentioned;

View file

@ -5,7 +5,6 @@
*/ */
import { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from "@api/ContextMenu"; import { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from "@api/ContextMenu";
import { migratePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants"; import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { Menu } from "@webpack/common"; import { Menu } from "@webpack/common";
@ -23,7 +22,6 @@ const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild;
} }
}; };
migratePluginSettings("EmojiDumper", "emojiDumper");
export default definePlugin({ export default definePlugin({
name: "EmojiDumper", name: "EmojiDumper",
description: "Context menu to dump and download a server's emojis.", description: "Context menu to dump and download a server's emojis.",

View file

@ -17,7 +17,7 @@
*/ */
// Import required modules and components // Import required modules and components
import { definePluginSettings, migratePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { disableStyle, enableStyle } from "@api/Styles"; import { disableStyle, enableStyle } from "@api/Styles";
import { EquicordDevs } from "@utils/constants"; import { EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -73,8 +73,6 @@ const settings = definePluginSettings({
let settingsArray: Array<any> = []; let settingsArray: Array<any> = [];
let cssArray: Array<any> = []; let cssArray: Array<any> = [];
// Define the Vencord plugin
migratePluginSettings("EquicordCSS", "EquicordBuiltIn");
export default definePlugin({ export default definePlugin({
name: "EquicordCSS", name: "EquicordCSS",
description: "CSS for Equicord users. You will need to look at the settings.", description: "CSS for Equicord users. You will need to look at the settings.",

View file

@ -16,12 +16,10 @@
* 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 { migratePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants"; import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { PermissionStore } from "@webpack/common"; import { PermissionStore } from "@webpack/common";
migratePluginSettings("GodMode", "God Mode");
export default definePlugin({ export default definePlugin({
name: "GodMode", name: "GodMode",
description: "Get all permissions (client-side).", description: "Get all permissions (client-side).",

View file

@ -16,7 +16,6 @@
* 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 { migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -43,7 +42,6 @@ const keydown = (e: KeyboardEvent) => {
} }
}; };
migratePluginSettings("KeyboardSounds", "Keyboard Sounds");
export default definePlugin({ export default definePlugin({
name: "KeyboardSounds", name: "KeyboardSounds",
description: "Adds the Opera GX Keyboard Sounds to Discord", description: "Adds the Opera GX Keyboard Sounds to Discord",

View file

@ -23,7 +23,7 @@ export const Native = getNative();
import "./styles.css"; import "./styles.css";
import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { definePluginSettings, migratePluginSettings, Settings } from "@api/Settings"; import { definePluginSettings, Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary"; import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
@ -564,7 +564,6 @@ const contextMenuPath: NavContextMenuPatchCallback = (children, props) => {
} }
}; };
migratePluginSettings("MessageLoggerEnhanced", "MLEnhanced");
export default definePlugin({ export default definePlugin({
name: "MessageLoggerEnhanced", name: "MessageLoggerEnhanced",
authors: [Devs.Aria], authors: [Devs.Aria],

View file

@ -4,11 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import { migratePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants"; import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
migratePluginSettings("NoAppsAllowed", "noAppsAllowed");
export default definePlugin({ export default definePlugin({
name: "NoAppsAllowed", name: "NoAppsAllowed",
description: "returns the bot's tag :skulk:", description: "returns the bot's tag :skulk:",

View file

@ -17,7 +17,6 @@
*/ */
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { migratePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants"; import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByPropsLazy } from "@webpack";
@ -45,7 +44,6 @@ async function deleteMessages(amount: number, channel: Channel, delay: number =
return deleted; return deleted;
} }
migratePluginSettings("PurgeMessages", "MessagePurge");
export default definePlugin({ export default definePlugin({
name: "PurgeMessages", name: "PurgeMessages",
description: "Purges messages from a channel", description: "Purges messages from a channel",

View file

@ -5,7 +5,7 @@
*/ */
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents"; import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { definePluginSettings, migratePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -28,7 +28,6 @@ function replaceQuestionMarks(content: string): string {
} }
} }
migratePluginSettings("QuestionMarkReplacement", "QuestionMarkReplace");
export default definePlugin({ export default definePlugin({
name: "QuestionMarkReplacement", name: "QuestionMarkReplacement",
description: "Replace all question marks with chosen string, if message only contains question marks.", description: "Replace all question marks with chosen string, if message only contains question marks.",

View file

@ -5,7 +5,7 @@
*/ */
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { definePluginSettings, migratePluginSettings } from "@api/Settings"; import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { openModal } from "@utils/modal"; import { openModal } from "@utils/modal";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -30,7 +30,6 @@ const SekaiStickerChatButton: ChatBarButton = () => {
}; };
let IS_FONTS_LOADED = false; let IS_FONTS_LOADED = false;
migratePluginSettings("SekaiStickers", "Sekai Stickers");
export default definePlugin({ export default definePlugin({
name: "SekaiStickers", name: "SekaiStickers",
description: "Sekai Stickers built in discord originally from github.com/TheOriginalAyaka", description: "Sekai Stickers built in discord originally from github.com/TheOriginalAyaka",

View file

@ -16,7 +16,6 @@
* 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 { migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { FluxDispatcher, UserStore } from "@webpack/common"; import { FluxDispatcher, UserStore } from "@webpack/common";
@ -35,7 +34,6 @@ function toggleStreamerMode({ streamKey }: StreamEvent, value: boolean) {
}); });
} }
migratePluginSettings("StreamerModeOn", "StreamerModeOnStream");
export default definePlugin({ export default definePlugin({
name: "StreamerModeOn", name: "StreamerModeOn",
description: "Automatically enables streamer mode when you start streaming in Discord", description: "Automatically enables streamer mode when you start streaming in Discord",