Skip to content

Commit 867151c

Browse files
committed
WIP: more debug logging
Added debug logging of message that caused error when taking dispute in community.
1 parent 1df104d commit 867151c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Diff for: bot/modules/dispute/messages.js

+16-14
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,24 @@ exports.disputeData = async (
9292
const escapedInitiatorUsername = sanitizeMD(initiatorUser.username);
9393
const escapedCounterPartyUsername = sanitizeMD(counterPartyUser.username);
9494

95+
const message = ctx.i18n.t('dispute_started_channel', {
96+
initiatorUser: { ...initiatorUser, username: escapedInitiatorUsername },
97+
initiatorTgId: initiatorUser.tg_id,
98+
counterPartyUser: { ...counterPartyUser, username: escapedCounterPartyUsername },
99+
counterPartyUserTgId: counterPartyUser.tg_id,
100+
buyer,
101+
seller,
102+
buyerDisputes,
103+
sellerDisputes,
104+
detailedOrder,
105+
type,
106+
sellerToken: order.seller_dispute_token,
107+
buyerToken: order.buyer_dispute_token,
108+
});
109+
console.log(`Contens of message:\n${message}`);
95110
await ctx.telegram.sendMessage(
96111
solver.tg_id,
97-
ctx.i18n.t('dispute_started_channel', {
98-
initiatorUser: { ...initiatorUser, username: escapedInitiatorUsername },
99-
initiatorTgId: initiatorUser.tg_id,
100-
counterPartyUser: { ...counterPartyUser, username: escapedCounterPartyUsername },
101-
counterPartyUserTgId: counterPartyUser.tg_id,
102-
buyer,
103-
seller,
104-
buyerDisputes,
105-
sellerDisputes,
106-
detailedOrder,
107-
type,
108-
sellerToken: order.seller_dispute_token,
109-
buyerToken: order.buyer_dispute_token,
110-
}),
112+
message,
111113
{ parse_mode: 'MarkdownV2' }
112114
);
113115
// message to both parties letting them know the dispute

0 commit comments

Comments
 (0)