MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / mockMessage

Function mockMessage

packages/core/mock.ts:43–60  ·  view source on GitHub ↗
(
	server: Server,
	channel: Channel | ChannelWithFlags,
	author: DiscordAccount,
	override: Omit<
		Partial<BaseMessageWithRelations>,
		'authorId' | 'channelId' | 'serverId'
	> = {},
)

Source from the content-addressed store, hash-verified

41}
42
43export function mockMessage(
44 server: Server,
45 channel: Channel | ChannelWithFlags,
46 author: DiscordAccount,
47 override: Omit<
48 Partial<BaseMessageWithRelations>,
49 'authorId' | 'channelId' | 'serverId'
50 > = {},
51) {
52 return getDefaultMessage({
53 id: getRandomId(),
54 authorId: author.id,
55 channelId: channel.id,
56 serverId: server.id,
57 content: getRandomSentence(),
58 ...override,
59 });
60}
61
62export function mockServer(override: Partial<Server> = {}) {
63 return getDefaultServer({

Callers 6

message.test.tsFile · 0.90
channel.test.tsFile · 0.90
seedOneFunction · 0.90
seedTwoFunction · 0.90

Calls 3

getDefaultMessageFunction · 0.90
getRandomIdFunction · 0.90
getRandomSentenceFunction · 0.90

Tested by

no test coverage detected