We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 691201a commit 0ea5fb0Copy full SHA for 0ea5fb0
src/tpy.ts
@@ -212,8 +212,17 @@ export class Tpy {
212
* @param deploymentID The deployment ID to follow the WebSocket when it disconnects. If empty, the function
213
* will use the set {@linkcode Tpy.deploymentID} in the class.
214
*/
215
- connectSocket(deploymentID: string) {
216
- return new TpyWs(this, deploymentID);
+ connectSocket(deploymentID?: string) {
+ const dID = deploymentID || this.deploymentID;
217
+ if (!dID) {
218
+ throw new TpyError(
219
+ "Missing or Invalid Required Parameter",
220
+ parametersPrompt("missing", ["deploymentID", "this.deploymentID"]),
221
+ ["deploymentID", "this.deploymentID"].join(", "),
222
+ dID
223
+ );
224
+ }
225
+ return new TpyWs(this, dID);
226
}
227
228
/**
0 commit comments