forked from nikhiljohn10/telegram-bot-worker
-
-
Notifications
You must be signed in to change notification settings - Fork 226
/
Copy pathindex.html
49 lines (46 loc) · 9.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@codebam/cf-workers-telegram-bot</title><meta name="description" content="Documentation for @codebam/cf-workers-telegram-bot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@codebam/cf-workers-telegram-bot</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@codebam/cf-workers-telegram-bot</h2></div><div class="tsd-panel tsd-typography"><h3 align="center">
<img src="https://raw.githubusercontent.com/codebam/cf-workers-telegram-bot/master/assets/logo.png" width="100" />
<br/>
CF Workers Telegram Bot
<br/>
</h3>
<h6 align="center">
<a href="https://codebam.github.io/cf-workers-telegram-bot/">Docs</a>
<a href="https://github.com/codebam/cf-workers-telegram-bot/wiki">Wiki</a>
</h6>
<p align="center">
<a href="https://github.com/codebam/cf-workers-telegram-bot/stargazers"> <img src="https://img.shields.io/github/stars/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=starship&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub stars"/></a>
<a href="https://github.com/codebam/cf-workers-telegram-bot/issues">
<img src="https://img.shields.io/github/issues/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=gitbook&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub issues"/></a>
<a href="https://github.com/codebam/cf-workers-telegram-bot"> <img src="https://img.shields.io/github/forks/codebam/cf-workers-telegram-bot?style=for-the-badge&logo=git&color=111111&logoColor=ffffff&labelColor=000000" alt="GitHub forks"/></a>
<a href="https://www.npmjs.com/package/@codebam/cf-workers-telegram-bot"> <img src="https://img.shields.io/npm/v/@codebam/cf-workers-telegram-bot?style=for-the-badge&logo=npm&color=111111&logoColor=ffffff&labelColor=000000" alt="npm version" /></a>
</p>
<p><img src="https://raw.githubusercontent.com/codebam/cf-workers-telegram-bot/master/assets/screenshot.png" alt="screenshot of cf-workers-telegram-bot"></p>
<pre><code class="language-sh"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-2">@codebam/cf-workers-telegram-bot</span>
</code><button>Copy</button></pre>
<p>See <a href="https://github.com/codebam/cwtb-consumer">cwtb-consumer</a> for an example of what a bot might look like. Just import from <code>@codebam/cf-workers-telegram-bot</code>.</p>
<p>See <a href="https://seanbehan.ca/posts/cf-workers-telegram-bot">my blog post</a> for a more in-depth guide for how to set up a bot.</p>
<ul>
<li><code>npm create cloudflare@latest</code></li>
<li><code>npx wrangler login</code></li>
<li><code>npx wrangler secret put SECRET_TELEGRAM_API_TOKEN</code>, set it to your telegram bot token that you got from <code>@BotFather</code></li>
<li><code>npx wrangler deploy</code></li>
<li>Open this url in your browser to set your webhook <code>https://your-worker.username.workers.dev/SECRET_TELEGRAM_API_TOKEN?command=set</code></li>
</ul>
<p>To set up GitHub actions to deploy when you push, see <a href="https://github.com/cloudflare/wrangler-action">https://github.com/cloudflare/wrangler-action</a></p>
<hr>
<p>These instructions are for if you want to deploy a copy of the bot along with
the library. Such as if you need extra API requests that haven't been
implemented yet.</p>
<p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/codebam/cf-workers-telegram-bot"><img src="https://deploy.workers.cloudflare.com/button" alt="Deploy to Cloudflare Workers"></a></p>
<ul>
<li><p>Click the deploy button</p>
</li>
<li><p>Navigate to your new <strong>GitHub repository > Settings > Secrets</strong> and add the following secrets:</p>
<pre><code class="language-yaml"><span class="hl-1">- </span><span class="hl-3">Name</span><span class="hl-1">: </span><span class="hl-4">CLOUDFLARE_API_TOKEN (should be added automatically)</span><br/><span class="hl-1">- </span><span class="hl-3">Name</span><span class="hl-1">: </span><span class="hl-4">CLOUDFLARE_ACCOUNT_ID (should be added automatically)</span><br/><br/><span class="hl-1">- </span><span class="hl-3">Name</span><span class="hl-1">: </span><span class="hl-4">SECRET_TELEGRAM_API_TOKEN</span><br/><span class="hl-1">- </span><span class="hl-3">Value</span><span class="hl-1">: </span><span class="hl-4">your-telegram-bot-token</span>
</code><button>Copy</button></pre>
</li>
<li><p>Push to <code>master</code> to trigger a deploy</p>
</li>
</ul>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@codebam/cf-workers-telegram-bot</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>