Skip to content

Instantly share code, notes, and snippets.

@reactmore
Created February 13, 2026 03:24
Show Gist options
  • Select an option

  • Save reactmore/77c6a9825a8ef70c9086ee3c80869753 to your computer and use it in GitHub Desktop.

Select an option

Save reactmore/77c6a9825a8ef70c9086ee3c80869753 to your computer and use it in GitHub Desktop.
External Bot Without Modular
const { botHandler } = require("../../handler");
const { Api } = require("teleproto");
botHandler({
name: "PingExternalBot",
BOT_TOKEN,
commands: [
// =========================
// START
// =========================
{
pattern: "start",
description: "Start command",
callback: async (m) => {
await m.send("External bot is running ๐Ÿš€");
}
},
// =========================
// PING
// =========================
{
pattern: "ping",
description: "Ping test",
callback: async (m) => {
const start = Date.now();
await m.send("Testing ping...");
const end = Date.now();
await m.send(`Latency: ${end - start} ms`);
}
},
// =========================
// INLINE QUERY
// =========================
{
on: "inline_query",
callback: async (event, client) => {
await client.invoke(
new Api.messages.SetInlineBotResults({
queryId: event.queryId,
results: [
new Api.InputBotInlineResult({
id: "1",
type: "article",
title: "Hello",
description: "Inline result working",
sendMessage: new Api.InputBotInlineMessageText({
message: "Hello from external bot ๐Ÿ‘‹"
})
})
]
})
);
}
}
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment