Skip to content

Commit 3460319

Browse files
Merge branch 'main' of https://github.com/ai16z/eliza
2 parents 11e5465 + 2d17b37 commit 3460319

File tree

134 files changed

+10948
-5924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+10948
-5924
lines changed

core/src/clients/discord/messages.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,18 @@ function canSendMessage(channel) {
147147
// Check each required permission
148148
const missingPermissions = requiredPermissions.filter(perm => !permissions.has(perm));
149149

150+
// Convert BigInts to strings to avoid serialization issues
151+
const missingPermNames = missingPermissions.map(perm => {
152+
// Find the flag name by its value
153+
return Object.entries(PermissionsBitField.Flags)
154+
.find(([_, val]) => val === perm)?.[0] || String(perm);
155+
});
156+
150157
return {
151158
canSend: missingPermissions.length === 0,
152-
missingPermissions: missingPermissions,
159+
missingPermissions: missingPermNames, // Now using string names instead of BigInts
153160
reason: missingPermissions.length > 0
154-
? `Missing permissions: ${missingPermissions.map(p => String(p)).join(', ')}`
161+
? `Missing permissions: ${missingPermNames.join(', ')}`
155162
: null
156163
};
157164
}

docs/api/_category_.yml

-1
This file was deleted.

0 commit comments

Comments
 (0)