interactions.getById
Returns the use with this ID, or undefined once it has ended.
Renamed in 0.28 from interactions.get; see renamed names.
Signature
Section titled “Signature”interactions.getById(id: string): Interaction | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
string |
The use’s ID. It is a decimal string; keep it as a string, it can be larger than a JavaScript number holds exactly. |
Returns
Section titled “Returns”The Interaction, or undefined.
Example
Section titled “Example”import { interactions, server } from "nativemp";
server.on("interactionStarted", ({ interaction }) => { setTimeout(() => { if (interactions.getById(interaction.id)) server.log(`player ${interaction.playerId} is still at it`); }, 60_000);});Related
Section titled “Related”interactions.listAll: every useinteractions.stop: end a use