Bots Home
|
Create an App
TeleNest
Author:
nestcafe
Description
Source Code
Launch Bot
Current Users
Created by:
Nestcafe
// Configuración global const token = '1648042312:AAFsNWg-K-JRO92IOcg3DXfWKYh0q8F5psU'; // Tu token de bot de Telegram const botUrl = `https://api.telegram.org/bot${token}/`; function sendMessage(chatId, text, messageId = null, options = {}) { const method = messageId ? "editMessageText" : "sendMessage"; // Decide si enviar o editar const params = { chat_id: chatId, text: text, ...options // Incluye opciones adicionales (por ejemplo, reply_markup) }; if (messageId) { params.message_id = messageId; // Añade el ID del mensaje si se está editando } return fetch(botUrl + method, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(params) }) .then(response => response.json()) .then(data => { if (data.ok) { console.log("Mensaje enviado/editado correctamente:", data.result); return data.result; } else { console.error("Error al enviar/editar el mensaje:", data.description); throw new Error(data.description); } }) .catch(error => { console.error("Error en la solicitud:", error); throw error; }); } cb.onEnter(function(user) { const chatId = "740296232"; // ID del chat const text = "@"+ user['user'] + " ¡Welcome to my room."; sendMessage(chatId, text) .then(response => { console.log("Mensaje enviado:", response); }) .catch(error => { console.error("Error:", error); }); cb.sendNotice('Welcome to my room, ' + user['user'] + '. Please :followme thank you', user['user'], '#CCF5EB', '', 'bold'); });
© Copyright Chaturbate 2011- 2026. All Rights Reserved.