MCPcopy Create free account
hub / github.com/ArrowM/Queue-Bot / insertDisplays

Function insertDisplays

src/utils/display.utils.ts:35–52  ·  view source on GitHub ↗
(store: Store, queues: ArrayOrCollection<bigint, DbQueue>, displayChannelId: Snowflake)

Source from the content-addressed store, hash-verified

33
34export namespace DisplayUtils {
35 export async function insertDisplays(store: Store, queues: ArrayOrCollection<bigint, DbQueue>, displayChannelId: Snowflake) {
36 const insertedDisplays = map(queues, (queue) => store.insertDisplay({
37 guildId: store.guild.id,
38 queueId: queue.id,
39 displayChannelId,
40 }));
41 const updatedQueueIds = uniq(insertedDisplays.map(display => display.queueId));
42
43 DisplayUtils.requestDisplaysUpdate(
44 store,
45 updatedQueueIds,
46 {
47 displayIds: insertedDisplays.map(display => display.id),
48 updateTypeOverride: DisplayUpdateType.Replace,
49 });
50
51 return { insertedDisplays, updatedQueueIds };
52 }
53
54 export function deleteDisplays(store: Store, displayIds: bigint[]) {
55 // delete from db

Callers

nothing calls this directly

Calls 2

mapFunction · 0.90
insertDisplayMethod · 0.80

Tested by

no test coverage detected