victornpb/undiscord - 5.2.3.with.fixes

Created Diff never expires
8 removals
Words removed18
Total words1892
Words removed (%)0.95
384 lines
9 additions
Words added14
Total words1888
Words added (%)0.74
384 lines




// ==UserScript==
// ==UserScript==
// @name Undiscord
// @name Undiscord
// @description Delete all messages in a Discord channel or DM (Bulk deletion)
// @description Undiscord 5.2.3, but with some fixes.
// @version 5.2.3
// @version 5.2.3.with.fixes
// @author victornpb
// @author victornpb
// @homepageURL https://github.com/victornpb/undiscord
// @homepageURL https://github.com/victornpb/undiscord
// @supportURL https://github.com/victornpb/undiscord/discussions
// @supportURL https://github.com/victornpb/undiscord/discussions
// @match https://*.discord.com/app
// @match https://*.discord.com/app
// @match https://*.discord.com/channels/*
// @match https://*.discord.com/channels/*
// @match https://*.discord.com/login
// @match https://*.discord.com/login
// @license MIT
// @license MIT
// @namespace https://github.com/victornpb/deleteDiscordMessages
// @namespace https://github.com/victornpb/deleteDiscordMessages
// @icon https://victornpb.github.io/undiscord/images/icon128.png
// @icon https://victornpb.github.io/undiscord/images/icon128.png
// @contributionURL https://www.buymeacoffee.com/vitim
// @contributionURL https://www.buymeacoffee.com/vitim
// @grant none
// @grant none
// ==/UserScript==
// ==/UserScript==
(function () {
(function () {
'use strict';
'use strict';
/* rollup-plugin-baked-env */
/* rollup-plugin-baked-env */
const VERSION = "5.2.3";
const VERSION = "5.2.3.with.fixes";
var themeCss = (`
var themeCss = (`
/* undiscord window */
/* undiscord window */
#undiscord.browser { box-shadow: var(--elevation-stroke), var(--elevation-high); overflow: hidden; }
#undiscord.browser { box-shadow: var(--elevation-stroke), var(--elevation-high); overflow: hidden; }
#undiscord.container,
#undiscord.container,
#undiscord .container { background-color: var(--background-secondary); border-radius: 8px; box-sizing: border-box; cursor: default; flex-direction: column; }
#undiscord .container { background-color: var(--background-secondary); border-radius: 8px; box-sizing: border-box; cursor: default; flex-direction: column; }
#undiscord .header { background-color: var(--background-tertiary); height: 48px; align-items: center; min-height: 48px; padding: 0 16px; display: flex; color: var(--header-secondary); cursor: grab; }
#undiscord .header { background-color: var(--background-tertiary); height: 48px; align-items: center; min-height: 48px; padding: 0 16px; display: flex; color: var(--header-secondary); cursor: grab; }
#undiscord .header .icon { color: var(--interactive-normal); margin-right: 8px; flex-shrink: 0; width: 24; height: 24; }
#undiscord .header .icon { color: var(--interactive-normal); margin-right: 8px; flex-shrink: 0; width: 24; height: 24; }
#undiscord .header .icon:hover { color: var(--interactive-hover); }
#undiscord .header .icon:hover { color: var(--interactive-hover); }
#undiscord .header h3 { font-size: 16px; line-height: 20px; font-weight: 500; font-family: var(--font-display); color: var(--header-primary); flex-shrink: 0; margin-right: 16px; }
#undiscord .header h3 { font-size: 16px; line-height: 20px; font-weight: 500; font-family: var(--font-display); color: var(--header-primary); flex-shrink: 0; margin-right: 16px; }
#undiscord .spacer { flex-grow: 1; }
#undiscord .spacer { flex-grow: 1; }
#undiscord .header .vert-divider { width: 1px; height: 24px; background-color: var(--background-modifier-accent); margin-right: 16px; flex-shrink: 0; }
#undiscord .header .vert-divider { width: 1px; height: 24px; background-color: var(--background-modifier-accent); margin-right: 16px; flex-shrink: 0; }
#undiscord legend,
#undiscord legend,
#undiscord label { color: var(--header-secondary); font-size: 12px; line-height: 16px; font-weight: 500; text-transform: uppercase; cursor: default; font-family: var(--font-display); margin-bottom: 8px; }
#undiscord label { color: var(--header-secondary); font-size: 12px; line-height: 16px; font-weight: 500; text-transform: uppercase; cursor: default; font-family: var(--font-display); margin-bottom: 8px; }
#undiscord .multiInput { display: flex; align-items: center; font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; }
#undiscord .multiInput { display: flex; align-items: center; font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; }
#undiscord .multiInput :first-child { flex-grow: 1; }
#undiscord .multiInput :first-child { flex-grow: 1; }
#undiscord .multiInput button:last-child { margin-right: 4px; }
#undiscord .multiInput button:last-child { margin-right: 4px; }
#undiscord .input { font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; padding: 10px; height: 40px; }
#undiscord .input { font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; padding: 10px; height: 40px; }
#undiscord fieldset { margin-top: 16px; }
#undiscord fieldset { margin-top: 16px; }
#undiscord .input-wrapper { display: flex; align-items: center; font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; }
#undiscord .input-wrapper { display: flex; align-items: center; font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; }
#undiscord input[type="text"],
#undiscord input[type="text"],
#undiscord input[type="search"],
#undiscord input[type="search"],
#undiscord input[type="password"],
#undiscord input[type="text"],
#undiscord input[type="datetime-local"],
#undiscord input[type="datetime-local"],
#undiscord input[type="number"],
#undiscord input[type="number"],
#undiscord input[type="range"] { font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; padding: 10px; height: 40px; }
#undiscord input[type="range"] { font-size: 16px; box-sizing: border-box; width: 100%; border-radius: 3px; color: var(--text-normal); background-color: var(--input-background); border: none; transition: border-color 0.2s ease-in-out 0s; padding: 10px; height: 40px; }
#undiscord .divider,
#undiscord .divider,
#undiscord hr { border: none; margin-bottom: 24px; padding-bottom: 4px; border-bottom: 1px solid var(--background-modifier-accent); }
#undiscord hr { border: none; margin-bottom: 24px; padding-bottom: 4px; border-bottom: 1px solid var(--background-modifier-accent); }
#undiscord .sectionDescription { margin-bottom: 16px; color: var(--header-secondary); font-size: 14px; line-height: 20px; font-weight: 400; }
#undiscord .sectionDescription { margin-bottom: 16px; color: var(--header-secondary); font-size: 14px; line-height: 20px; font-weight: 400; }
#undiscord a { color: var(--text-link); text-decoration: none; }
#undiscord a { color: var(--text-link); text-decoration: none; }
#undiscord .btn,
#undiscord .btn,
#undiscord button { position: relative; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; box-sizing: border-box; background: none; border: none; border-radius: 3px; font-size: 14px; font-weight: 500; line-height: 16px; padding: 2px 16px; user-select: none; /* sizeSmall */ width: 60px; height: 32px; min-width: 60px; min-height: 32px; /* lookFilled colorPrimary */ color: rgb(255, 255, 255); background-color: var(--button-secondary-background); }
#undiscord button { position: relative; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; box-sizing: border-box; background: none; border: none; border-radius: 3px; font-size: 14px; font-weight: 500; line-height: 16px; padding: 2px 16px; user-select: none; /* sizeSmall */ width: 60px; height: 32px; min-width: 60px; min-height: 32px; /* lookFilled colorPrimary */ color: rgb(255, 255, 255); background-color: var(--button-secondary-background); }
#undiscord .sizeMedium { width: 96px; height: 38px; min-width: 96px; min-height: 38px; }
#undiscord .sizeMedium { width: 96px; height: 38px; min-width: 96px; min-height: 38px; }
#undiscord .sizeMedium.icon { width: 38px; min-width: 38px; }
#undiscord .sizeMedium.icon { width: 38px; min-width: 38px; }
#undiscord sup { vertical-align: top; }
#undiscord sup { vertical-align: top; }
/* lookFilled colorPrimary */
/* lookFilled colorPrimary */
#undiscord .accent { background-color: var(--brand-experiment); }
#undiscord .accent { background-color: var(--brand-experiment); }
#undiscord .danger { background-color: var(--button-danger-background); }
#undiscord .danger { background-color: var(--button-danger-background); }
#undiscord .positive { background-color: var(--button-positive-background); }
#undiscord .positive { background-color: var(--button-positive-background); }
#undiscord .info { font-size: 12px; line-height: 16px; padding: 8px 10px; color: var(--text-muted); }
#undiscord .info { font-size: 12px; line-height: 16px; padding: 8px 10px; color: var(--text-muted); }
/* Scrollbar */
/* Scrollbar */
#undiscord .scroll::-webkit-scrollbar { width: 8px; height: 8px; }
#undiscord .scroll::-webkit-scrollbar { width: 8px; height: 8px; }
#undiscord .scroll::-webkit-scrollbar-corner { background-color: transparent; }
#undiscord .scroll::-webkit-scrollbar-corner { background-color: transparent; }
#undiscord .scroll::-webkit-scrollbar-thumb { background-clip: padding-box; border: 2px solid transparent; border-radius: 4px; background-color: var(--scrollbar-thin-thumb); min-height: 40px; }
#undiscord .scroll::-webkit-scrollbar-thumb { background-clip: padding-box; border: 2px solid transparent; border-radius: 4px; background-color: var(--scrollbar-thin-thumb); min-height: 40px; }
#undiscord .scroll::-webkit-scrollbar-track { border-color: var(--scrollbar-thin-track); background-color: var(--scrollbar-thin-track); border: 2px solid var(--scrollbar-thin-track); }
#undiscord .scroll::-webkit-scrollbar-track { border-color: var(--scrollbar-thin-track); background-color: var(--scrollbar-thin-track); border: 2px solid var(--scrollbar-thin-track); }
/* fade scrollbar */
/* fade scrollbar */
#undiscord .scroll::-webkit-scrollbar-thumb,
#undiscord .scroll::-webkit-scrollbar-thumb,
#undiscord .scroll::-webkit-scrollbar-track { visibility: hidden; }
#undiscord .scroll::-webkit-scrollbar-track { visibility: hidden; }
#undiscord .scroll:hover::-webkit-scrollbar-thumb,
#undiscord .scroll:hover::-webkit-scrollbar-thumb,
#undiscord .scroll:hover::-webkit-scrollbar-track { visibility: visible; }
#undiscord .scroll:hover::-webkit-scrollbar-track { visibility: visible; }
/**** functional classes ****/
/**** functional classes ****/
#undiscord.redact .priv { display: none !important; }
#undiscord.redact .priv { display: none !important; }
#undiscord.redact x:not(:active) { color: transparent !important; background-color: var(--primary-700) !important; cursor: default; user-select: none; }
#undiscord.redact x:not(:active) { color: transparent !important; background-color: var(--primary-700) !important; cursor: default; user-select: none; }
#undiscord.redact x:hover { position: relative; }
#undiscord.redact x:hover { position: relative; }
#undiscord.redact x:hover::after { content: "Redacted information (Streamer mode: ON)"; position: absolute; display: inline-block; top: -32px; left: -20px; padding: 4px; width: 150px; font-size: 8pt; text-align: center; white-space: pre-wrap; background-color: var(--background-floating); -webkit-box-shadow: var(--elevation-high); box-shadow: var(--elevation-high); color: var(--text-normal); border-radius: 5px; pointer-events: none; }
#undiscord.redact x:hover::after { content: "Redacted information (Streamer mode: ON)"; position: absolute; display: inline-block; top: -32px; left: -20px; padding: 4px; width: 150px; font-size: 8pt; text-align: center; white-space: pre-wrap; background-color: var(--background-floating); -webkit-box-shadow: var(--elevation-high); box-shadow: var(--elevation-high); color: var(--text-normal); border-radius: 5px; pointer-events: none; }
#undiscord.redact [priv] { -webkit-text-security: disc !important; }
#undiscord.redact [priv] { -webkit-text-security: disc !important; }
#undiscord :disabled { display: none; }
#undiscord :disabled { display: none; }
/**** layout and utility classes ****/
/**** layout and utility classes ****/
#undiscord,
#undiscord,
#undiscord * { box-sizing: border-box; }
#undiscord * { box-sizing: border-box; }
#undiscord .col { display: flex; flex-direction: column; }
#undiscord .col { display: flex; flex-direction: column; }
#undiscord .row { display: flex; flex-direction: row; align-items: center; }
#undiscord .row { display: flex; flex-direction: row; align-items: center; }
#undiscord .mb1 { margin-bottom: 8px; }
#undiscord .mb1 { margin-bottom: 8px; }
#undiscord .log { margin-bottom: 0.25em; }
#undiscord .log { margin-bottom: 0.25em; }
#undiscord .log-debug { color: inherit; }
#undiscord .log-debug { color: inherit; }
#undiscord .log-info { color: #00b0f4; }
#undiscord .log-info { color: #00b0f4; }
#undiscord .log-verb { color: #72767d; }
#undiscord .log-verb { color: #72767d; }
#undiscord .log-warn { color: #faa61a; }
#undiscord .log-warn { color: #faa61a; }
#undiscord .log-error { color: #f04747; }
#undiscord .log-error { color: #f04747; }
#undiscord .log-success { color: #43b581; }
#undiscord .log-success { color: #43b581; }
`);
`);
var mainCss = (`
var mainCss = (`
/**** Undiscord Button ****/
/**** Undiscord Button ****/
#undicord-btn { position: relative; width: auto; height: 24px; margin: 0 8px; cursor: pointer; color: var(--interactive-normal); flex: 0 0 auto; }
#undicord-btn { position: relative; width: auto; height: 24px; margin: 0 8px; cursor: pointer; color: var(--interactive-normal); flex: 0 0 auto; }
#undicord-btn progress { position: absolute; top: 23px; left: -4px; width: 32px; height: 12px; display: none; }
#undicord-btn progress { position: absolute; top: 23px; left: -4px; width: 32px; height: 12px; display: none; }
#undicord-btn.running { color: var(--button-danger-background) !important; }
#undicord-btn.running { color: var(--button-danger-background) !important; }
#undicord-btn.running progress { display: block; }
#undicord-btn.running progress { display: block; }
/**** Undiscord Interface ****/
/**** Undiscord Interface ****/
#undiscord { position: fixed; z-index: 100; top: 58px; right: 10px; display: flex; flex-direction: column; width: 800px; height: 80vh; min-width: 610px; max-width: 100vw; min-height: 448px; max-height: 100vh; color: var(--text-normal); border-radius: 4px; background-color: var(--background-secondary); box-shadow: var(--elevation-stroke), var(--elevation-high); will-change: top, left, width, height; }
#undiscord { position: right; z-index: 100; top: 58px; right: 44px; display: flex; flex-direction: column; width: 800px; height: 80vh; min-width: 610px; max-width: 100vw; min-height: 448px; max-height: 100vh; color: var(--text-normal); border-radius: 4px; background-color: var(--background-secondary); box-shadow: var(--elevation-stroke), var(--elevation-high); will-change: top, left, width, height; }
#undiscord .header .icon { cursor: pointer; }
#undiscord .header .icon { cursor: pointer; }
#undiscord .window-body { height: calc(100% - 48px); }
#undiscord .window-body { height: calc(100% - 48px); }
#undiscord .sidebar { overflow: hidden scroll; overflow-y: auto; width: 270px; min-width: 250px; height: 100%; max-height: 100%; padding: 8px; background: var(--background-secondary); }
#undiscord .sidebar { overflow: hidden scroll; overflow-y: auto; width: 270px; min-width: 250px; height: 100%; max-height: 100%; padding: 8px; background: var(--background-secondary); }
#undiscord .sidebar legend,
#undiscord .sidebar legend,
#undiscord .sidebar label { display: block; width: 100%; }
#undiscord .sidebar label { display: block; width: 100%; }
#undiscord .main { display: flex; max-width: calc(100% - 250px); background-color: var(--background-primary); flex-grow: 1; }
#undiscord .main { display: flex; max-width: calc(100% - 250px); background-color: var(--background-primary); flex-grow: 1; }
#undiscord.hide-sidebar .sidebar { display: none; }
#undiscord.hide-sidebar .sidebar { display: none; }
#undiscord.hide-sidebar .main { max-width: 100%; }
#undiscord.hide-sidebar .main { max-width: 100%; }
#undiscord #logArea { font-family: Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 0.75rem; overflow: auto; padding: 10px; user-select: text; flex-grow: 1; flex-grow: 1; cursor: auto; }
#undiscord #logArea { font-family: Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 0.75rem; overflow: auto; padding: 10px; user-select: text; flex-grow: 1; flex-grow: 1; cursor: auto; }
#undiscord .tbar { padding: 8px; background-color: var(--background-secondary-alt); }
#undiscord .tbar { padding: 8px; background-color: var(--background-secondary-alt); }
#undiscord .tbar button { margin-right: 4px; margin-bottom: 4px; }
#undiscord .tbar button { margin-right: 4px; margin-bottom: 4px; }
#undiscord .footer { cursor: se-resize; padding-right: 30px; }
#undiscord .footer { cursor: se-resize; padding-right: 30px; }
#undiscord .footer #progressPercent { padding: 0 1em; font-size: small; color: var(--interactive-muted); flex-grow: 1; }
#undiscord .footer #progressPercent { padding: 0 1em; font-size: small; color: var(--interactive-muted); flex-grow: 1; }
.resize-handle { position: absolute; bottom: -15px; right: -15px; width: 30px; height: 30px; transform: rotate(-45deg); background: repeating-linear-gradient(0, var(--background-modifier-accent), var(--background-modifier-accent) 1px, transparent 2px, transparent 4px); cursor: nwse-resize; }
.resize-handle { position: absolute; bottom: -15px; right: -15px; width: 30px; height: 30px; transform: rotate(-45deg); background: repeating-linear-gradient(0, var(--background-modifier-accent), var(--background-modifier-accent) 1px, transparent 2px, transparent 4px); cursor: nwse-resize; }
/**** Elements ****/
/**** Elements ****/
#undiscord summary { font-size: 16px; font-weight: 500; line-height: 20px; position: relative; overflow: hidden; margin-bottom: 2px; padding: 6px 10px; cursor: pointer; white-space: nowrap; text-overflow: ellipsis; color: var(--interactive-normal); border-radius: 4px; flex-shrink: 0; }
#undiscord summary { font-size: 16px; font-weight: 500; line-height: 20px; position: relative; overflow: hidden; margin-bottom: 2px; padding: 6px 10px; cursor: pointer; white-space: nowrap; text-overflow: ellipsis; color: var(--interactive-normal); border-radius: 4px; flex-shrink: 0; }
#undiscord fieldset { padding-left: 8px; }
#undiscord fieldset { padding-left: 8px; }
#undiscord legend a { float: right; text-transform: initial; }
#undiscord legend a { float: right; text-transform: initial; }
#undiscord progress { height: 8px; margin-top: 4px; flex-grow: 1; }
#undiscord progress { height: 8px; margin-top: 4px; flex-grow: 1; }
#undiscord .importJson { display: flex; flex-direction: row; }
#undiscord .importJson { display: flex; flex-direction: row; }
#undiscord .importJson button { margin-left: 5px; width: fit-content; }
#undiscord .importJson button { margin-left: 5px; width: fit-content; }
`);
`);
var dragCss = (`
var dragCss = (`
[name^="grab-"] { position: absolute; --size: 6px; --corner-size: 16px; --offset: -1px; z-index: 9; }
[name^="grab-"] { position: absolute; --size: 6px; --corner-size: 16px; --offset: -1px; z-index: 9; }
[name^="grab-"]:hover{ background: rgba(128,128,128,0.1); }
[name^="grab-"]:hover{ background: rgba(128,128,128,0.1); }
[name="grab-t"] { top: 0px; left: var(--corner-size); right: var(--corner-size); height: var(--size); margin-top: var(--offset); cursor: ns-resize; }
[name="grab-t"] { top: 0px; left: var(--corner-size); right: var(--corner-size); height: var(--size); margin-top: var(--offset); cursor: ns-resize; }
[name="grab-r"] { top: var(--corner-size); bottom: var(--corner-size); right: 0px; width: var(--size); margin-right: var(--offset);
[name="grab-r"] { top: var(--corner-size); bottom: var(--corner-size); right: 0px; width: var(--size); margin-right: var(--offset);
cursor: ew-resize; }
cursor: ew-resize; }
[name="grab-b"] { bottom: 0px; left: var(--corner-size); right: var(--corner-size); height: var(--size); margin-bottom: var(--offset); cursor: ns-resize; }
[name="grab-b"] { bottom: 0px; left: var(--corner-size); right: var(--corner-size); height: var(--size); margin-bottom: var(--offset); cursor: ns-resize; }
[name="grab-l"] { top: var(--corner-size); bottom: var(--corner-size); left: 0px; width: var(--size); margin-left: var(--offset); cursor: ew-resize; }
[name="grab-l"] { top: var(--corner-size); bottom: var(--corner-size); left: 0px; width: var(--size); margin-left: var(--offset); cursor: ew-resize; }
[name="grab-tl"] { top: 0px; left: 0px; width: var(--corner-size); height: var(--corner-size); margin-top: var(--offset); margin-left: var(--offset); cursor: nwse-resize; }
[name="grab-tl"] { top: 0px; left: 0px; width: var(--corner-size); height: var(--corner-size); margin-top: var(--offset); margin-left: var(--offset); cursor: nwse-resize; }
[name="grab-tr"] { top: 0px; right: 0px; width: var(--corner-size); height: var(--corner-size); margin-top: var(--offset); margin-right: var(--offset); cursor: nesw-resize; }
[name="grab-tr"] { top: 0px; right: 0px; width: var(--corner-size); height: var(--corner-size); margin-top: var(--offset); margin-right: var(--offset); cursor: nesw-resize; }
[name="grab-br"] { bottom: 0px; right: 0px; width: var(--corner-size); height: var(--corner-size); margin-bottom: var(--offset); margin-right: var(--offset); cursor: nwse-resize; }
[name="grab-br"] { bottom: 0px; right: 0px; width: var(--corner-size); height: var(--corner-size); margin-bottom: var(--offset); margin-right: var(--offset); cursor: nwse-resize; }
[name="grab-bl"] { bottom: 0px; left: 0px; width: var(--corner-size); height: var(--corner-size); margin-bottom: var(--offset); margin-left: var(--offset); cursor: nesw-resize; }
[name="grab-bl"] { bottom: 0px; left: 0px; width: var(--corner-size); height: var(--corner-size); margin-bottom: var(--offset); margin-left: var(--offset); cursor: nesw-resize; }
`);
`);
var buttonHtml = (`
var buttonHtml = (`
<div id="undicord-btn" tabindex="0" role="button" aria-label="Delete Messages" title="Delete Messages with Undiscord">
<div id="undicord-btn" tabindex="0" role="button" aria-label="Delete Messages" title="Delete Messages with Undiscord">
<svg aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<svg aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"></path>
<path fill="currentColor" d="M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"></path>
<path fill="currentColor" d="M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z"></path>
<path fill="currentColor" d="M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z"></path>
</svg>
</svg>
<progress></progress>
<progress></progress>
</div>
</div>
`);
`);
var undiscordTemplate = (`
var undiscordTemplate = (`
<div id="undiscord" class="browser container redact" style="display:none;">
<div id="undiscord" class="browser container redact" style="display:none;">
<div class="header">
<div class="header">
<svg class="icon" aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<svg class="icon" aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"></path>
<path fill="currentColor" d="M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"></path>
<path fill="currentColor"
<path fill="currentColor"
d="M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z">
d="M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z">
</path>
</path>
</svg>
</svg>
<h3>Undiscord</h3>
<h3>Undiscord</h3>
<div class="vert-divider"></div>
<div class="vert-divider"></div>
<span> Bulk delete messages</span>
<span> Bulk delete messages</span>
<div class="spacer"></div>
<div class="spacer"></div>
<div id="hide" class="icon" aria-label="Close" role="button" tabindex="0">
<div id="hide" class="icon" aria-label="Close" role="button" tabindex="0">
<svg aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<svg aria-hidden="false" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor"
<path fill="currentColor"
d="M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z">
d="M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z">
</path>
</path>
</svg>
</svg>
</div>
</div>
</div>
</div>
<div class="window-body" style="display: flex; flex-direction: row;">
<div class="window-body" style="display: flex; flex-direction: row;">
<div class="sidebar scroll">
<div class="sidebar scroll">
<details open>
<details open>
<summary>General</summary>
<summary>General</summary>
<fieldset>
<fieldset>
<legend>
<legend>
Author ID
Author ID
<a href="{{WIKI}}/authorId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/authorId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="multiInput">
<div class="multiInput">
<div class="input-wrapper">
<div class="input-wrapper">
<input class="input" id="authorId" type="text" priv>
<input class="input" id="authorId" type="text" priv>
</div>
</div>
<button id="getAuthor">me</button>
<button id="getAuthor">me</button>
</div>
</div>
</fieldset>
</fieldset>
<hr>
<hr>
<fieldset>
<fieldset>
<legend>
<legend>
Server ID
Server ID
<a href="{{WIKI}}/guildId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/guildId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="multiInput">
<div class="multiInput">
<div class="input-wrapper">
<div class="input-wrapper">
<input class="input" id="guildId" type="text" priv>
<input class="input" id="guildId" type="text" priv>
</div>
</div>
<button id="getGuild">current</button>
<button id="getGuild">current</button>
</div>
</div>
</fieldset>
</fieldset>
<fieldset>
<fieldset>
<legend>
<legend>
Channel ID
Channel ID
<a href="{{WIKI}}/channelId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/channelId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="multiInput mb1">
<div class="multiInput mb1">
<div class="input-wrapper">
<div class="input-wrapper">
<input class="input" id="channelId" type="text" priv>
<input class="input" id="channelId" type="text" priv>
</div>
</div>
<button id="getChannel">current</button>
<button id="getChannel">current</button>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
<label class="row"><input id="includeNsfw" type="checkbox">This is a NSFW channel</label>
<label class="row"><input id="includeNsfw" type="checkbox">This is a NSFW channel</label>
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<details>
<details>
<summary>Wipe Archive</summary>
<summary>Wipe Archive</summary>
<fieldset>
<fieldset>
<legend>
<legend>
Import index.json
Import index.json
<a href="{{WIKI}}/importJson" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/importJson" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper">
<div class="input-wrapper">
<input type="file" id="importJsonInput" accept="application/json,.json" style="width:100%";>
<input type="file" id="importJsonInput" accept="application/json,.json" style="width:100%";>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
<br>
<br>
After requesting your data from discord, you can import it here.<br>
After requesting your data from discord, you can import it here.<br>
Select the "messages/index.json" file from the discord archive.
Select the "messages/index.json" file from the discord archive.
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<hr>
<hr>
<details>
<details>
<summary>Filter</summary>
<summary>Filter</summary>
<fieldset>
<fieldset>
<legend>
<legend>
Search
Search
<a href="{{WIKI}}/filters" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/filters" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper">
<div class="input-wrapper">
<input id="search" type="text" placeholder="Containing text" priv>
<input id="search" type="text" placeholder="Containing text" priv>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
Only delete messages that contain the text
Only delete messages that contain the text
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
<label><input id="hasLink" type="checkbox">has: link</label>
<label><input id="hasLink" type="checkbox">has: link</label>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
<label><input id="hasFile" type="checkbox">has: file</label>
<label><input id="hasFile" type="checkbox">has: file</label>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
<label><input id="includePinned" type="checkbox">Include pinned</label>
<label><input id="includePinned" type="checkbox">Include pinned</label>
</div>
</div>
</fieldset>
</fieldset>
<hr>
<hr>
<fieldset>
<fieldset>
<legend>
<legend>
Pattern
Pattern
<a href="{{WIKI}}/pattern" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/pattern" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="sectionDescription">
<div class="sectionDescription">
Delete messages that match the regular expression
Delete messages that match the regular expression
</div>
</div>
<div class="input-wrapper">
<div class="input-wrapper">
<span class="info">/</span>
<span class="info">/</span>
<input id="pattern" type="text" placeholder="regular expression" priv>
<input id="pattern" type="text" placeholder="regular expression" priv>
<span class="info">/</span>
<span class="info">/</span>
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<details>
<details>
<summary>Messages interval</summary>
<summary>Messages interval</summary>
<fieldset>
<fieldset>
<legend>
<legend>
Interval of messages
Interval of messages
<a href="{{WIKI}}/messageId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/messageId" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="multiInput mb1">
<div class="multiInput mb1">
<div class="input-wrapper">
<div class="input-wrapper">
<input id="minId" type="text" placeholder="After a message" priv>
<input id="minId" type="text" placeholder="After a message" priv>
</div>
</div>
<button id="pickMessageAfter">Pick</button>
<button id="pickMessageAfter">Pick</button>
</div>
</div>
<div class="multiInput">
<div class="multiInput">
<div class="input-wrapper">
<div class="input-wrapper">
<input id="maxId" type="text" placeholder="Before a message" priv>
<input id="maxId" type="text" placeholder="Before a message" priv>
</div>
</div>
<button id="pickMessageBefore">Pick</button>
<button id="pickMessageBefore">Pick</button>
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
Specify an interval to delete messages.
Specify an interval to delete messages.
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<details>
<details>
<summary>Date interval</summary>
<summary>Date interval</summary>
<fieldset>
<fieldset>
<legend>
<legend>
After date
After date
<a href="{{WIKI}}/dateRange" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/dateRange" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper mb1">
<div class="input-wrapper mb1">
<input id="minDate" type="datetime-local" title="Messages posted AFTER this date">
<input id="minDate" type="datetime-local" title="Messages posted AFTER this date">
</div>
</div>
<legend>
<legend>
Before date
Before date
<a href="{{WIKI}}/dateRange" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/dateRange" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper">
<div class="input-wrapper">
<input id="maxDate" type="datetime-local" title="Messages posted BEFORE this date">
<input id="maxDate" type="datetime-local" title="Messages posted BEFORE this date">
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
Delete messages that were posted between the two dates.
Delete messages that were posted between the two dates.
</div>
</div>
<div class="sectionDescription">
<div class="sectionDescription">
* Filtering by date doesn't work if you use the "Messages interval".
* Filtering by date doesn't work if you use the "Messages interval".
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<hr>
<hr>
<details>
<details>
<summary>Advanced settings</summary>
<summary>Advanced settings</summary>
<fieldset>
<fieldset>
<legend>
<legend>
Search delay
Search delay
<a href="{{WIKI}}/delay" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/delay" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper">
<div class="input-wrapper">
<input id="searchDelay" type="range" value="30000" step="100" min="100" max="60000">
<input id="searchDelay" type="range" value="30000" step="100" min="100" max="60000">
<div id="searchDelayValue"></div>
<div id="searchDelayValue"></div>
</div>
</div>
</fieldset>
</fieldset>
<fieldset>
<fieldset>
<legend>
<legend>
Delete delay
Delete delay
<a href="{{WIKI}}/delay" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/delay" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="input-wrapper">
<div class="input-wrapper">
<input id="deleteDelay" type="range" value="1000" step="50" min="50" max="10000">
<input id="deleteDelay" type="range" value="1000" step="50" min="50" max="10000">
<div id="deleteDelayValue"></div>
<div id="deleteDelayValue"></div>
</div>
</div>
<br>
<br>
<div class="sectionDescription">
<div class="sectionDescription">
This will affect the speed in which the messages are deleted.
This will affect the speed in which the messages are deleted.
Use the help link for more information.
Use the help link for more information.
</div>
</div>
</fieldset>
</fieldset>
<hr>
<hr>
<fieldset>
<fieldset>
<legend>
<legend>
Authorization Token
Authorization Token
<a href="{{WIKI}}/authToken" title="Help" target="_blank" rel="noopener noreferrer">help</a>
<a href="{{WIKI}}/authToken" title="Help" target="_blank" rel="noopener noreferrer">help</a>
</legend>
</legend>
<div class="multiInput">
<div class="multiInput">
<div class="input-wrapper">
<div class="input-wrapper">
<input class="input" id="token" type="password" autocomplete="dont" priv>
<input class="input" id="token" type="text" priv>
</div>
</div>
<button id="getToken">fill</button>
<button id="getToken">fill</button>
</div>
</div>
</fieldset>
</fieldset>
</details>
</details>
<hr>
<hr>
<div></div>
<div></div>
<div class="info">
<div class="info">
Undiscord {{VERSION}}
Undiscord {{VERSION}}
<br> victornpb
<br> victornpb
</div>
</div>
</div>
</div>
<div class="main col">
<div class="main col">
<div class="tbar col">
<div class="tbar col">
<div class="row">
<div class="row">
<button id="toggleSidebar" class="sizeMedium icon">☰</button>
<button id="toggleSidebar" class="sizeMedium icon">☰</button>
<button id="start" class="sizeMedium danger" style="width: 150px;" title="Start the deletion process">▶︎ Delete</button>
<button id="start" class="sizeMedium danger" style="width: 150px;" title="Start the deletion process">▶︎ Delete</button>
<button id="stop" class="sizeMedium" title="Stop the deletion process" disabled>🛑 Stop</button>
<button id="stop" class="sizeMedium" title="Stop the deletion process" disabled>🛑 Stop</button>
<button id="clear" class="sizeMedium">Clear log</button>
<button id="clear" class="sizeMedium">Clear log</button>
<label class="row" title="Hide sensitive information on your screen for taking screenshots">
<label class="row" title="Hide sensitive information on your screen for taking screenshots">
<input id="redact" type="checkbox" checked> Streamer mode
<input id="redact" type="checkbox" checked> Streamer mode
</label>
</label>
</div>
</div>
<div class="row">
<div class="row">
<progress id="p