Skip to content

Commit 6145954

Browse files
committed
improved workarround
1 parent 5c1cfb6 commit 6145954

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

bot/modules/dispute/commands.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,19 @@ export const handleDispute = async (ctx: MainContext, orderId: string) => {
9494
const dispute = async (ctx: MainContext) => {
9595
try {
9696
const { user } = ctx;
97-
if (
98-
ctx.state.command.args.length > 0 &&
99-
ctx.state.command.args[0] !== 'undefined'
100-
) {
97+
98+
const rawArgs = ctx.state.command.raw.split(' '); // workaround
99+
100+
if (rawArgs.length > 1) {
101+
101102
const params = await validateParams(ctx, 2, '\\<_order id_\\>');
102103

103104
if (!params || params.length === 0) return;
104105

105106
const [orderId] = params;
106107
return await handleDispute(ctx, orderId);
107108
}
109+
108110
const orders = await Order.find({
109111
$or: [
110112
{ seller_id: user._id.toString() },

0 commit comments

Comments
 (0)