Skip to content

Commit

Permalink
feat: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
niracler committed Nov 26, 2023
1 parent 131bcd1 commit 9704c0f
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Nyaruko Telegram 机器人

欢迎来到充满异域风情的 `Nyaruko` Telegram 机器人项目!🌟 这是一个与众不同的 Telegram 机器人,部署在性能卓越的 Cloudflare Workers 上。我们的 Nyaruko 不仅仅是一个机器人,更是 Niracler 的精灵伙伴,随时准备执行各种奇妙而独特的任务。就像《潜行吧、奈亚子!!!》中的女主角奈亚子一样,这个机器人灵感来源于克苏鲁神话,奇趣横生、处处充满惊喜!👾

## 功能介绍

目前,Nyaruko 机器人能够实现以下惊艳的功能:

### `/sync_twitter` - 将 Telegram 信息同步到 Twitter

通过 `/sync_twitter` 命令,Nyaruko 可以将 Telegram 中的信息同步到 Twitter 上。让你的思绪像翅膀一样,飞跃到另一个社交圈。🕊️ 不过呢,Nyaruko 还在成长中,当前还不支持超链接以及处理 Telegram 的 `media_group`。这需要在 Cloudflare 中巧妙地缓存历史,相信不久之后,Nyaruko 将学会这项新技能!🎓

### 更多功能敬请期待

Nyaruko 的能力正在不断进化中,未来将会有更多激动人心的功能陆续上线。

## 如何运行 Nyaruko

想要让 Nyaruko 在您的环境中活跃起来,您需要按照下面的步骤进行配置:

1. 准备好您的 Cloudflare Workers 环境。
2. 配置必要的环境变量,使用 `wrangler secret` 命令来设置它们。
3. 部署 Nyaruko 机器人到 Cloudflare Workers。

### 必要的环境变量

Nyaruko 需要以下环境变量的支持来发挥其作用:

- `ALLOWED_USER_IDS`:允许使用机器人的用户 ID 列表,以逗号分隔。这一个是设置在 wrangler.yml 中的,不需要使用 `wrangler secret` 命令设置。
- `TELEGRAM_BOT_SECRET`:您的 Telegram 机器人密钥。
- `TWITTER_API_KEY`:您的 Twitter API 密钥。
- `TWITTER_API_SECRET`:您的 Twitter API 密钥密文。
- `TWITTER_ACCESS_TOKEN`:Twitter 的访问令牌。
- `TWITTER_ACCESS_TOKEN_SECRET`:Twitter 的访问令牌密文。

[点击这里](https://developer.twitter.com/en/portal/dashboard) 来获取 Twitter 相关的 token。

[点击这里](https://core.telegram.org/bots#6-botfather) 可以了解更多关于获取 Telegram Bot Token 的信息。

### 关于设置环境变量

环境变量的设置请使用 Cloudflare Workers 的 `wrangler` CLI 工具,具体命令如下:

```bash
wrangler secret put TELEGRAM_BOT_SECRET
# 在提示后输入相应的值

wrangler secret put TWITTER_API_KEY
# 重复上述步骤设置所有需要的变量
...
```

更详细的 wrangler 配置和命令说明,请查阅 [官方 wrangler 文档](https://developers.cloudflare.com/workers/wrangler/commands/) (wrangler 文档感觉要比 twitter 文档好懂得多了,起码事例会多很多~~)。

## 奈亚子的小秘密

Nyaruko 的名字来源于日本轻小说《潜行吧!奈亚子》,女主角奈亚子是一位积极向上、充满活力的克苏鲁神秘生物,她的形象是根据克苏鲁神话中的尼亚拉托提普塑造的。在 Nyaruko 机器人中,它代表了智能与活力的象征,不仅助力 Niracler 处理信息,还带着点二次元的趣味,为生活添彩!🌈

🎉 祝您和 Nyaruko 有着愉快的交流与合作!如果您对 Nyaruko 有任何建议,欢迎与我们取得联系,我们为 Nyaruko 的成长和进步保持着开放的心态和热忱的欢迎!💌
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Nyaruko Telegram Bot

[English](README.md) | [简体中文](README.cn.md)

Welcome to the exotic Nyaruko Telegram Bot project! 🌟 This one-of-a-kind Telegram bot is deployed on the high-performance Cloudflare Workers. Nyaruko is not just any bot, but a sprite companion for Niracler, always ready to execute whimsical and unique tasks. Inspired by the leading character Nyaruko from "Haiyore! Nyaruko-san" and rooted in the Lovecraftian Mythos, our bot brings surprises and quirky fun at every corner! 👾

## Feature Introduction

Currently, Nyaruko has the following stunning features:

### `/sync_twitter` - Synchronize Telegram messages to Twitter

With the `/sync_twitter` command, Nyaruko can synchronize messages from Telegram to Twitter. Let your thoughts take flight and soar into another social media realm. 🕊️ However, Nyaruko is still growing and currently does not support hyperlinks or handle Telegram's `media_group`. Cleverly caching history in Cloudflare is needed, and it is believed that Nyaruko will soon learn this new skill! 🎓

### More features coming soon

The capabilities of Nyaruko are continuously evolving, and more exciting features will be launched in the future.

## How to Run Nyaruko

To get Nyaruko up and running in your environment, please follow these steps:

1. Prepare your Cloudflare Workers environment.
2. Configure the necessary environment variables using the `wrangler secret` command to set them.
3. Deploy the Nyaruko bot to Cloudflare Workers.

### Necessary Environment Variables

Nyaruko requires the following environment variables to function:

- `ALLOWED_USER_IDS`: The comma-separated list of user IDs allowed to use the bot. This is set in `wrangler.yml` and does not need to be set using the `wrangler secret` command.
- `TELEGRAM_BOT_SECRET`: Your Telegram bot token.
- `TWITTER_API_KEY`: Your Twitter API key.
- `TWITTER_API_SECRET`: Your Twitter API secret.
- `TWITTER_ACCESS_TOKEN`: Twitter access token.
- `TWITTER_ACCESS_TOKEN_SECRET`: Twitter access token secret.

[Click here](https://developer.twitter.com/en/portal/dashboard) to get your Twitter-related tokens.

[Click here](https://core.telegram.org/bots#6-botfather) to learn more about acquiring your Telegram Bot Token.

### About Setting Environment Variables

To set up environment variables, please use the `wrangler` CLI tool of Cloudflare Workers as follows:

```bash
wrangler secret put TELEGRAM_BOT_SECRET
# Enter the corresponding value when prompted

wrangler secret put TWITTER_API_KEY
# Repeat the above steps to set all required variables
...
```

For a more detailed explanation of wrangler configuration and commands, refer to the [official wrangler documentation](https://developers.cloudflare.com/workers/wrangler/commands/) (The wrangler documents are much easier to understand compared to the Twitter documentation, mainly because there are a lot more examples~~).

### Little Secret of Nyaruko

The name Nyaruko originates from the Japanese light novel series “Haiyore! Nyaruko-san,” where the heroine Nyaruko is an energetic and positive Cthulhu mythical creature modeled after Nyarlathotep from Lovecraftian Mythos. In the Nyaruko bot, it represents a symbol of intelligence and vitality, not only assisting Niracler in message handling but also adding a touch of two-dimensional fun to life! 🌈

🎉 We wish you enjoyable interactions and cooperation with Nyaruko! If you have any suggestions for Nyaruko, please feel free to contact us. We keep an open mind and warmly welcome ideas for Nyaruko’s growth and improvement! 💌

0 comments on commit 9704c0f

Please sign in to comment.