-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {IRCTC} from "../index.js"; | ||
const params = { | ||
"UPI": "9876543210@ybl", // Your NPCI UPI VPA ID | ||
"class": "2S", // class code such as 2A | 3A | SL | CC | 2S | FC | 1A | ||
"quota": "GN", // GN | TQ | PT | ||
"train_number": "17201", // 5 Digit Train Number | ||
"from": "GNT", // Station code | ||
"to": "PDKN", // Station code | ||
"journey_date": "20240530", // YYYYMMDD | ||
"mobile_number": "9876543210", // 10 Digit Mobile Number | ||
"userID": "username_here", // Secret User ID | ||
"password": "someSecret_here", // Secret Password | ||
"passengers": [ // Passengers List - Max 4 members for Tatkal and 6 for General Quota | ||
{ | ||
"age": "22", // Age of Passenger | ||
"food": "", // Food Preference - Leave as Empty string, if food is not required | ||
"name": "Virat Kohli", // Full Name of Passenger | ||
"sex": "M" // Sex of Passenger - M | F | ||
}, | ||
{ | ||
"age": "21", // Age of Passenger | ||
"food": "", // Food Preference - Leave as Empty string, if food is not required | ||
"name": "Anushka Sharma", // Full Name of Passenger | ||
"sex": "F" // Sex of Passenger - M | F | ||
} | ||
] | ||
}; | ||
async function custom_command_name(params) { | ||
try{ | ||
const irctc = new IRCTC(); | ||
const response = await irctc.book(params); | ||
console.log(response); | ||
} | ||
catch(e){ | ||
throw new Error(e); | ||
} | ||
}; | ||
await custom_command_name(params); |