Split ticket and group name fixes
This commit is contained in:
parent
69394c813d
commit
a882c9ecff
5 changed files with 37 additions and 7 deletions
|
|
@ -282,6 +282,35 @@ const sendSignalMessageTask = async ({
|
|||
},
|
||||
"Message sent successfully",
|
||||
);
|
||||
|
||||
// Update group name to use consistent template with ticket number
|
||||
// This ensures groups created by receive-signal-message get renamed
|
||||
// to match the template (e.g., "Support Request: 94085")
|
||||
if (finalTo.startsWith("group.") && conversationId) {
|
||||
try {
|
||||
const expectedGroupName = buildSignalGroupName(conversationId);
|
||||
await groupsClient.v1GroupsNumberGroupidPut({
|
||||
number: bot.phoneNumber,
|
||||
groupid: finalTo,
|
||||
data: {
|
||||
name: expectedGroupName,
|
||||
},
|
||||
});
|
||||
logger.debug(
|
||||
{ groupId: finalTo, newName: expectedGroupName },
|
||||
"Updated group name",
|
||||
);
|
||||
} catch (renameError) {
|
||||
// Non-fatal - group name update is best-effort
|
||||
logger.warn(
|
||||
{
|
||||
error: renameError instanceof Error ? renameError.message : renameError,
|
||||
groupId: finalTo,
|
||||
},
|
||||
"Could not update group name",
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
// Try to get the actual error message from the response
|
||||
if (error.response) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue