您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click any Discord message to copy its message ID
- // ==UserScript==
- // @name Single Click To Copy Discord Message ID
- // @namespace https://gf.qytechs.cn/users/1179204
- // @version 0.0.1
- // @description Click any Discord message to copy its message ID
- // @author KaKa
- // @match https://discord.com/channels/*
- // @license MIT
- // ==/UserScript==
- (function () {
- 'use strict';
- document.addEventListener('click', function (event) {
- const messageElement = event.target.closest('[id^="chat-messages-"]');
- if (!messageElement) return;
- const rawId = messageElement.id;
- if (!rawId.startsWith('chat-messages-')) return;
- const fullId = rawId.substring('chat-messages-'.length);
- const parts = fullId.split('-');
- const messageId = parts[1] || parts[0];
- navigator.clipboard.writeText(messageId).then(() => {
- messageElement.style.outline = '2px solid red';
- setTimeout(() =>{
- messageElement.style.outline = ''}, 500);
- }).catch(err => {
- console.error('Failed to copy message ID:', err);
- });
- });
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址