@koishijs/plugin-adapter-discord 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -251,7 +251,7 @@ function adaptMessage(bot, meta, session = {}) {
251
251
  if (meta.mention_roles.includes(id)) {
252
252
  return (0, import_koishi2.segment)("at", { role: id });
253
253
  } else {
254
- const user = (_a2 = meta.mentions) == null ? void 0 : _a2.find((u) => u.id === id);
254
+ const user = (_a2 = meta.mentions) == null ? void 0 : _a2.find((u) => u.id === id || `${u.username}#${u.discriminator}` === id);
255
255
  return import_koishi2.segment.at(id, { name: user == null ? void 0 : user.username });
256
256
  }
257
257
  }).replace(/<:(.*):(.+?)>/, (_, name, id) => (0, import_koishi2.segment)("face", { id, name })).replace(/<a:(.*):(.+?)>/, (_, name, id) => (0, import_koishi2.segment)("face", { id, name, animated: true })).replace(/@everyone/, () => (0, import_koishi2.segment)("at", { type: "all" })).replace(/@here/, () => (0, import_koishi2.segment)("at", { type: "here" })).replace(/<#(.+?)>/, (_, id) => {