MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / getReactionRoleMessage

Function getReactionRoleMessage

src/services/reactionRoleService.js:103–123  ·  view source on GitHub ↗
(client, guildId, messageId)

Source from the content-addressed store, hash-verified

101}
102
103export async function getReactionRoleMessage(client, guildId, messageId) {
104 try {
105 validateGuildId(guildId);
106 validateMessageId(messageId);
107
108 const key = `reaction_roles:${guildId}:${messageId}`;
109 const data = await client.db.get(key);
110 return data || null;
111 } catch (error) {
112 if (error.name === 'TitanBotError') {
113 throw error;
114 }
115 logger.error(`Error getting reaction role message ${messageId} in guild ${guildId}:`, error);
116 throw createError(
117 `Database error retrieving reaction role message`,
118 ErrorTypes.DATABASE,
119 'Failed to retrieve reaction role data. Please try again.',
120 { guildId, messageId, originalError: error.message }
121 );
122 }
123}
124
125export async function createReactionRoleMessage(client, guildId, channelId, messageId, roleIds) {
126 try {

Callers 6

executeFunction · 0.90
addReactionRoleFunction · 0.85
removeReactionRoleFunction · 0.85
setReactionRoleChannelFunction · 0.85

Calls 4

createErrorFunction · 0.90
validateGuildIdFunction · 0.85
validateMessageIdFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected