@friendlyrobot/discord-pi-agent 0.9.1 → 0.9.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/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -975,8 +975,17 @@ var typingIntervals = new Map;
|
|
|
975
975
|
async function sendTypingSafe(channel, channelKey) {
|
|
976
976
|
logger5.info({ channelKey }, "[TYPING] calling sendTyping()");
|
|
977
977
|
try {
|
|
978
|
-
|
|
979
|
-
|
|
978
|
+
const token = channel.client.token;
|
|
979
|
+
const url = `https://discord.com/api/v10/channels/${channel.id}/typing`;
|
|
980
|
+
const res = await fetch(url, {
|
|
981
|
+
method: "POST",
|
|
982
|
+
headers: { Authorization: `Bot ${token}` }
|
|
983
|
+
});
|
|
984
|
+
const body = await res.text();
|
|
985
|
+
logger5.info({ channelKey, status: res.status, headers: Object.fromEntries(res.headers.entries()), body }, "[TYPING] raw fetch response");
|
|
986
|
+
if (res.ok) {
|
|
987
|
+
logger5.info({ channelKey }, "[TYPING] raw fetch OK — Discord accepted typing");
|
|
988
|
+
}
|
|
980
989
|
} catch (error) {
|
|
981
990
|
logger5.warn({ channelKey, error }, "[TYPING] sendTyping() FAILED");
|
|
982
991
|
}
|