当Discord发布时,它永远改变了即时通讯和群聊的概念。(messaging and group chats)在它出现之前的十年(A decade),您可能已经发现自己在使用AOL Instant Messenger、MSN Messenger或更新的Skype——其中两个(Skype—two)已不复存在,而后者则因 Discord(Discord)的流行而遭受了巨大损失。
在Discord之前,我们从来不知道让消息服务将我们的(messaging service)对话历史(conversation history)永久存储在云中是什么感觉。要在AIM 或 MSN(AIM or MSN)上本地存储运行日志,您需要某种第三方插件。在Skype上,文本日志现在仅在云中保存 30 天。
对某些人来说,永远(message history forever)保留消息历史记录是一件好事。对于其他人来说,这是一场噩梦。2017年1(January)月,Discord概述了他们如何能够(how they’re able to store billions of messages)在博客文章(blog post)中存储数十亿条消息,而且这项政策似乎不会很快改变。Discord也无法让用户在Discord上批量删除他们的(Discord)DM 历史记录(DM history)。
那么,如果您发送了数千条直接消息并决定不再希望它们永远存在,会发生什么?有几种解决方案,但没有一个是完美的。
使用热键删除 Discord 上的 Discord DM 历史记录(Deleting Discord DM History on Discord With Hotkeys)
删除Discord 消息(Discord message)最直观的方法是
- 将鼠标悬停在其上以显示右侧的汉堡菜单图标(hamburger menu icon)。
- 点击图标。
- 选择删除(Delete)。
- 单击删除(Delete)按钮确认删除。
但是,这需要始终如一地使用鼠标,从而大大减慢了该过程。因此,您应该了解模拟此过程的键盘命令序列。
以下是序列的细分:
- 进入 Discord DM。
- 按一次向上(Up)选择您最近的消息。
- 再次按向上(Up)以激活编辑器。
- 按Ctrl + A选择字段中的所有文本。
- 按Backspace删除文本。
- 按Enter一次确认编辑。
- 再次按Enter以确认提示删除。
这似乎是一个漫长而疲惫的过程,但在实践中,你会进入节奏,删除每条消息只需一秒钟。与不断将光标移动到屏幕的不同区域以单击多个不同的按钮相比,它需要的稳定手要少得多。
使用 AutoHotkey 删除 Discord DM 历史记录(Deleting Discord DM History With AutoHotkey)
现在我们已经确定可以在不使用鼠标的情况下删除DM ,这为使用简单的(DMs)AutoHotkey 脚本(AutoHotkey script)自动执行该过程提供了可能性。
我们过去曾介绍过AutoHotkey,例如我们关于五个最有用的 AutoHotkey 脚本(most useful AutoHotkey scripts)的 HelpDeskGeek 文章,安装该应用程序是免费的,只需一分钟。但是,此选项仅适用于 Windows 用户(this option is only available to Windows users),因为AutoHotkey目前不适用于 macOS。
理想情况下,您需要 AutoHotkey 脚本中的以下内容:
- 用于打开和关闭它的切换键(toggle key)
- 每个步骤之间有停顿的完整键盘序列(keyboard sequence)
- 一种持续加载早期消息的方法
这是我编写的示例脚本:(example script)
F1::
Toggle := !Toggle
loop {
if not Toggle
break
if WinExist (“ahk_exe discord.exe”)
WinActivate
SendInput {Up}
Sleep 100
SendInput {Up}
Sleep 100
SendInput ^a
Sleep 100
SendInput {Backspace}
Sleep 100
SendInput { Enter}
Sleep 100
SendInput {Enter}
Sleep 100
SendInput {WheelUp}
Sleep 200
}
返回
该脚本使用F1 键(F1 key)作为切换来启用或禁用消息删除(message deletion)。为此,您需要在打开脚本之前已经处于活动的DM 窗口中。(DM window)每次按键之间的暂停(睡眠(Sleep))是为了让处理能力(power don)较低的机器不会超前并跳过一个键。如果您发现此脚本运行但行为异常,请尝试以 50 为增量增加每个Sleep的值。(Sleep)
但是,此脚本有一个警告,即它会在收到 Discord 呼叫(Discord call)消息时中断。以下是它们的样子:
到达其中一条消息将阻止您按向上(Up)键来选择之前的消息。但是,可能会对脚本进行改进,从而允许解决此问题。
使用机器人删除 Discord DM 历史记录(Deleting Discord DM History With Bots)
首先让我们澄清一下,我们不会提供(we will not be providing instructions)有关如何使用Discord 机器人(Discord bot)删除您的DM 历史记录(DM history)的说明,但我们要让读者知道这是可能的。
在过去的几年里,Discord已经从不鼓励使用自我机器人转变为直接将其标记为违反其条款(violation of its terms)。
Thanks for the heads up. We do not endorse the use of self-bots, and strongly recommend that users avoid using them.
— Discord (@discordapp) April 10, 2017
话虽如此,使用自我机器人会使您的帐户面临被终止的风险,因此我们不建议这样做。但是,许多用户报告说,将自我机器人用于不公开、破坏性或有害的目的从未引起Discord的谴责。自行决定。
自机器人只是在Discord API 令牌(Discord API token)上运行的用户帐户。如今,Discord要求通过其(Discord)Developer Portal跟踪和标记机器人。自机器人绕过了这一点,并为标准用户帐户提供(user account access)了发出API请求的权限,从而使他们能够自动执行各种任务。删除消息就是其中之一。
Discord API当前支持触发Message Delete Bulk 网关(Message Delete Bulk gateway)事件的POST 请求(POST request),允许机器人快速删除不到两周的所有消息。较旧的消息可以单独排队和删除(以速率限制(rate limit))。
由于Discord似乎满足于永久存储我们的消息,因此我们有责任提出解决方案来大规模删除它们并保护我们的隐私。以上三个选项都有点粗制滥造,但在Discord提供解决方案之前,这是我们拥有的最好的选项。
How To Delete Your DM History On Discord
When Discord was released, it changed the cоncеpt of instant messaging and group chats forever. A decade before іt existеd, you might have found yourself using AOL Instant Mesѕenger, MSN Messenger, or the nеwer Skype—two of which no longer exist, and the latter of which has suffered greatlу from Discord’s populаrity.
Before Discord, we never knew what it was like to have a messaging service permanently store our conversation history in the cloud. To locally store running logs on AIM or MSN, you’d need some sort of a third-party plugin. On Skype, text logs are now kept in the cloud for just 30 days.
To some, holding onto message history forever is a great thing. For others, it’s a nightmare. In January of 2017, Discord outlined how they’re able to store billions of messages in a blog post, and it seems like this policy won’t be changing any time soon. Discord also offers no way for users to mass delete their DM history on Discord.
So, what happens if you’ve sent thousands of direct messages and decide you no longer want them to exist forever? There are several solutions, but none of them are perfect.
Deleting Discord DM History on Discord With Hotkeys
The most intuitive way to delete a Discord message is by
- hovering over it to reveal the right-side hamburger menu icon.
- clicking on the icon.
- selecting Delete.
- confirming the deletion by clicking the Delete button.
However, this requires consistent use of the mouse, slowing down the process tremendously. Therefore, you should know about the sequence of keyboard commands that mimic this procedure.
Here’s a breakdown of the sequence:
- Go into a Discord DM.
- Press Up once to select your most recent message.
- Press Up again to activate the editor.
- Press Ctrl + A to select all of the text in the field.
- Press Backspace to delete the text.
- Press Enter once to confirm the edit.
- Press Enter again to confirm deletion on the prompt.
This seems like a long and exhausting process, but in practice, you get into a rhythm, and deleting each message takes only a second. It requires much less of a steady hand than constantly moving your cursor to different areas of the screen to click multiple different buttons.
Deleting Discord DM History With AutoHotkey
Now that we’ve established that DMs can be deleted without using the mouse, that opens up the possibility of automating the process with a simple AutoHotkey script.
We’ve covered AutoHotkey in the past, such as our HelpDeskGeek article on five of the most useful AutoHotkey scripts, and installing the application is free and only takes a minute. However, this option is only available to Windows users as AutoHotkey does not currently work on macOS.
Ideally, you’ll want the following things from your AutoHotkey script:
- A toggle key for turning it on and off
- The full keyboard sequence with pauses in between each step
- A way to continuously load earlier messages
Here is an example script I’ve written:
F1::
Toggle := !Toggle
loop {
if not Toggle
break
if WinExist(“ahk_exe discord.exe”)
WinActivate
SendInput {Up}
Sleep 100
SendInput {Up}
Sleep 100
SendInput ^a
Sleep 100
SendInput {Backspace}
Sleep 100
SendInput {Enter}
Sleep 100
SendInput {Enter}
Sleep 100
SendInput {WheelUp}
Sleep 200
}
return
This script uses the F1 key as a toggle to enable or disable message deletion. For this to work, you need to already be in an active DM window before toggling the script on. The pauses (Sleep) between each keypress are so that machines with less processing power don’t get ahead of themselves and skip a key. If you find that this script runs but is behaving strangely, try increasing the value of each Sleep at increments of 50.
There is a caveat to this script though, which is that it will break upon reaching a Discord call message. Here is what those look like:
Reaching one of these messages will prevent you from pressing the Up key to select your previous messages before it. However, improvements to the script may be possible that allow a workaround for this.
Deleting Discord DM History With Bots
Let us first clarify that we will not be providing instructions on how to use a Discord bot to delete your DM history, but we are letting readers know that this is possible.
In the past few years, Discord has gone from discouraging the use of self-bots to outright labeling it as a violation of its terms.
Thanks for the heads up. We do not endorse the use of self-bots, and strongly recommend that users avoid using them.
— Discord (@discordapp) April 10, 2017
That being said, using self-bots puts your account at risk of termination, so we cannot suggest doing it. However, many users report that using self-bots for purposes that aren’t public, disruptive, or harmful has never led to reprimand from Discord. Make a decision at your own discretion.
A self-bot is simply a user account running on a Discord API token. Today, Discord requires that bots are tracked and tagged through its Developer Portal. A self-bot circumvents this and gives a standard user account access to making API requests, allowing them to automate a wide range of tasks. Deleting messages is one of them.
The Discord API currently supports a POST request that fires a Message Delete Bulk gateway event, allowing bots to quickly delete all messages that are less than two weeks old. Older messages can be queued and deleted individually (at a rate limit).
With Discord seemingly content with storing our messages forever, it’s on us to come up with solutions to mass delete them and preserve our privacy. The above three options are all a bit shoddy, but it’s the best we have until Discord offers a solution.