Skip to main content

nonebot_plugin_tweet

Project description

nonebot_tweet

A NoneBot2 plugin to forward tweets.

Note: You need to build your own RSSHub instance to retrieve tweet content.
This plugin also uses an OpenAI-compatible API to translate the tweet text.

Usage

Just send a tweet link to the bot, and it will automatically fetch and forward the tweet content.

You can also use the following commands:

  • c or content: Send only the images and videos, without any text or translation.
  • o or origin: Send the original tweet text without translation.

Install

Install by nb-cli (current not available)

 nb plugin nonebot_plugin_tweet

Or install by pip

pip install nonebot_plugin_tweet

then add plugin name to your pyproject.toml file

plugins = ["nonebot_plugin_tweet"]

Configuration

You need to configure the following options in the .env file:

  • rsshub_base_url: The base URL of your RSSHub instance.
  • rsshub_query_param: The query parameters for the RSSHub URL (for private).
  • openai_api_base: The base URL of your OpenAI-compatible API.
  • openai_api_key: Your OpenAI API key.

Create a file named .env in the root directory of your project and add the following lines:

RSSHUB_BASE_URL=your_rsshub_url
RSSHUB_QUERY_PARAM=your_query_params
OPENAI_API_BASE=your_openai_api_base
OPENAI_API_KEY=your_openai_api_key

NoneBot will automatically load the .env file when it starts.

Directly RUN

This project can also be run directly in a Python environment using the following command:

pip install -r requirements.txt && python bot.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_tweet-0.0.5.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_tweet-0.0.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_tweet-0.0.5.tar.gz.

File metadata

  • Download URL: nonebot_plugin_tweet-0.0.5.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for nonebot_plugin_tweet-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0ffbd9e95dc7b68efa5dda1c5f25d09a5faee7d0890b882a7d667aad70322a4d
MD5 3889ca7f2109a5174e97654399904208
BLAKE2b-256 05bbe2ee063affcbbbd4fe3f830b27dd201c487b2cdc8249be2aae161168e126

See more details on using hashes here.

File details

Details for the file nonebot_plugin_tweet-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_tweet-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 64f1a2c3c3319b3f62ccfd970ded13a14d2d95e392530af2d95fc6a6aed1b768
MD5 88249f3a6119626d3b6207823a0197ac
BLAKE2b-256 c2a09fc111fb9ce87739b8df8cb6f4a47b34513ddf8b9db53817181510390698

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page