signOAuthUser(bot_token: string,user: Omit<TelegramOAuthUser, "hash">,): Promise<TelegramOAuthUser>
Signs the OAuth user data
Example 1
Example 1
import { signOAuthUser } from "@izzqz/tgtb/utils"; const bot_token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"; const user = { id: 1234567890, first_name: "John", last_name: "Doe", username: "johndoe", auth_date: 1234567890, }; const signedData = await signOAuthUser(bot_token, user); // { id: "1234567890", first_name: "John", ... hash: "..." }
user: Omit<TelegramOAuthUser, "hash">
- The user data to sign
Promise<TelegramOAuthUser>
The signed user data with hash