MCPcopy Create free account
hub / github.com/Botloader/botloader / nextAutoId

Function nextAutoId

components/runtime/src/ts/discord/dapi.ts:235–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233 let idIncrementer = 0
234 // Provides automatic id generation for attachments, avoiding collisions with user provided ids
235 const nextAutoId = () => {
236 while (true) {
237 idIncrementer++
238
239 let next = idIncrementer
240 if (userProvidedIds.includes(next)) {
241 continue
242 }
243
244 return next
245 }
246 }
247
248 const attachments: Internal.OpCreateMessageFields["attachments"] = (fields.attachments ?? []).map(a => ({
249 dataB64: typeof a.data === "string"

Callers 1

toOpMessageFieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected