diff --git a/evennia/server/portal/discord.py b/evennia/server/portal/discord.py
index 0e03ac6481..12f0cbb076 100644
--- a/evennia/server/portal/discord.py
+++ b/evennia/server/portal/discord.py
@@ -534,10 +534,17 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
if "guild_id" in data:
# message received to a Discord channel
keywords["type"] = "channel"
- author = data["member"]["nick"] or data["author"]["username"]
- author_id = data["author"]["id"]
+ member = data.get("member", {}) or {}
+ author_info = data.get("author", {}) or {}
+ # Prefer guild nickname; fall back to global_name, then username
+ author = (
+ member.get("nick")
+ or author_info.get("global_name")
+ or author_info.get("username")
+ )
+ author_id = author_info.get("id") or data["author"]["id"]
keywords["sender"] = (author_id, author)
- keywords["guild_id"] = data["guild_id"]
+ keywords["guild_id"] = data.get("guild_id")
else:
# message sent directly to the bot account via DM
diff --git a/evennia/web/static/webclient/js/plugins/multimedia.js b/evennia/web/static/webclient/js/plugins/multimedia.js
index f8f6ab10d3..d0c9c6e796 100644
--- a/evennia/web/static/webclient/js/plugins/multimedia.js
+++ b/evennia/web/static/webclient/js/plugins/multimedia.js
@@ -27,7 +27,13 @@ let multimedia_plugin = (function () {
var mwins = window.plugins["goldenlayout"].routeMessage(args, kwargs);
mwins.forEach( function (mwin) {
- mwin.append("
");
+ var html = "
";
+ var method = mwin.attr("updateMethod");
+ if (method === "replace") {
+ mwin.html(html);
+ } else {
+ mwin.append(html);
+ }
mwin.scrollTop(mwin[0].scrollHeight);
});
}
@@ -40,9 +46,15 @@ let multimedia_plugin = (function () {
// create an HTML5 audio control (only .mp3 is fully compatible with all major browsers)
var mwins = window.plugins["goldenlayout"].routeMessage(args, kwargs);
mwins.forEach( function (mwin) {
- mwin.append("";
+ var method = mwin.attr("updateMethod");
+ if (method === "replace") {
+ mwin.html(html);
+ } else {
+ mwin.append(html);
+ }
mwin.scrollTop(mwin[0].scrollHeight);
});
}
@@ -55,9 +67,15 @@ let multimedia_plugin = (function () {
// create an HTML5 video element (only h264 .mp4 is compatible with all major browsers)
var mwins = window.plugins["goldenlayout"].routeMessage(args, kwargs);
mwins.forEach( function (mwin) {
- mwin.append("";
+ var method = mwin.attr("updateMethod");
+ if (method === "replace") {
+ mwin.html(html);
+ } else {
+ mwin.append(html);
+ }
mwin.scrollTop(mwin[0].scrollHeight);
});
}