{"id":24766226,"url":"https://github.com/yuuzi261/tweetcord","last_synced_at":"2025-04-09T21:13:50.390Z","repository":{"id":195888149,"uuid":"693713239","full_name":"Yuuzi261/Tweetcord","owner":"Yuuzi261","description":"A Discord bot for Twitter notifications, using tweety-ns module.","archived":false,"fork":false,"pushed_at":"2025-04-09T18:09:54.000Z","size":2259,"stargazers_count":67,"open_issues_count":5,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T21:13:39.299Z","etag":null,"topics":["bot","discord","discord-bot","discordbot","python","python3","tweety","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yuuzi261.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-19T15:03:44.000Z","updated_at":"2025-04-06T16:03:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7b8609c-1e9a-4874-8318-e37145a3c1a4","html_url":"https://github.com/Yuuzi261/Tweetcord","commit_stats":null,"previous_names":["goldorange261/tweetcord"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yuuzi261%2FTweetcord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yuuzi261%2FTweetcord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yuuzi261%2FTweetcord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yuuzi261%2FTweetcord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yuuzi261","download_url":"https://codeload.github.com/Yuuzi261/Tweetcord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111972,"owners_count":21049578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","discord-bot","discordbot","python","python3","tweety","twitter","twitter-api"],"created_at":"2025-01-28T23:20:14.873Z","updated_at":"2025-04-09T21:13:50.366Z","avatar_url":"https://github.com/Yuuzi261.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"./AVATAR.md\"\u003e\u003cimg alt=\"LOGO\" src=\"/images/md/avatar.png\" width=\"300\" height=\"300\" /\u003e\u003c/a\u003e\n  \n# Tweetcord\n\nA Discord Bot for Twitter Notifications\n\n[![](https://img.shields.io/badge/python-3.11+-blue?logo=python\u0026logoColor=white)](https://www.python.org/downloads/)\n[![](https://img.shields.io/github/v/release/Yuuzi261/Tweetcord?sort=semver)](https://github.com/Yuuzi261/Tweetcord/releases)\n[![](https://img.shields.io/github/release-date/Yuuzi261/Tweetcord)](https://github.com/Yuuzi261/Tweetcord/releases)\n\n[**English**](./README.md) | [**繁體中文**](./README_zh.md)\n\n\u003c/div\u003e\n\n## 📝Introduction\n\nTweetcord is a Discord bot that leverages the [tweety-ns module](https://github.com/mahrtayyab/tweety) to provide real-time tweet updates from specific Twitter users directly to your Discord server. Simply configure the Twitter users and Discord channels you want to monitor, and Tweetcord will automatically forward tweets to the designated channels, ensuring you never miss important updates.🐦\n\n## ✨Features\n\n\u003cdetails\u003e\n   \u003csummary\u003e\n\n### Screenshots\n\n   \u003c/summary\u003e\n👇Whenever a followed user posts a new tweet, your server will receive an instant notification.\n\n![](/images/md/screenshot.png)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n   \u003csummary\u003e\n\n### Commands\n\n   \u003c/summary\u003e\n\n👉 `/add notifier` `username` `channel` | `mention` `type` `media_type` `account_used`\n\n| Parameter | Type | Description |\n| --------- | ---- | ----------- |\n| `username` | str | The username of the twitter user you want to turn on notifications for |\n| `channel` | discord.TextChannel | The channel to which the bot delivers notifications |\n| `mention` | discord.Role | The role to mention when notifying |\n| `type` | str | Whether to enable notifications for retweets \u0026 quotes |\n| `media_type` | str | Whether to enable notifications that include media, or only enable notifications that include media |\n| `account_used` | str | The twitter client used by the bot to monitor the user's tweets |\n\n👉 `/remove notifier` `username` `channel`\n\n| Parameter | Type | Description |\n| --------- | ---- | ----------- |\n| `username` | str | The username of the twitter user you want to turn off notifications for |\n| `channel` | discord.TextChannel | The channel which set to delivers notifications |\n\n👉 `/list users`\n\n- List all twitter users whose notifications are enabled on the current server\n\n👉 `/sync`\n\n- Sync the notification of new Twitter account with database.  If you change the twitter account used by bot, please use this command\n\n👉 `/customize message` `username` `channel` | `default`\n\n| Parameter | Type | Description |\n| --------- | ---- | ----------- |\n| `username` | str | The username of the twitter user you want to set customized message |\n| `channel` | discord.TextChannel | The channel which set to delivers notifications |\n| `default` | bool | Whether to use default setting _(default is false)_ |\n\nCustom notification messages are in `f-string format`, currently supporting 4 special variables for use, which will be explained below.\n\n- `{action}` : poster's action, include `tweeted`, `retweeted` and `quoted`\n- `{author}` : poster's display name\n- `{mention}` : the role to mention when sending to discord\n- `{url}` : the link of the tweet\n\nUsing the default notification as an example, if the message is customized to the following format (supporting Discord's markdown format):\n\n```plaintext\n{mention}**{author}** just {action} here: \n{url}\n```\n\nThe notification will be sent in this format when a tweet is posted (here is a real-world example):\n\n```plaintext\n@Ping_SubTweet ﾅﾁｮﾈｺ just tweeted here: \nhttps://twitter.com/nyachodayo/status/1869000108697960952\n```\n\n\u003c/details\u003e\n\n## 📥Installation\n\nBefore running the bot, you need to install the necessary modules.\n\n```shell\npip install -r requirements.txt\n```\n\n## ⚡Usage\n\n**📢This tutorial applies to version 0.5 or higher. For settings of older versions, please refer to the README files of the respective historical versions.**\n\n### [⬆️View Version Upgrade Guides](./UPGRADE_GUIDE.md)\n\n### 1. Create and configure the .env file\n\n```env\nBOT_TOKEN=YourDiscordBotToken\nTWITTER_TOKEN=NameForYourTwitterToken:YourTwitterAccountAuthToken\nDATA_PATH=./data\n```\n\n\u003e [!NOTE]  \n\u003e The `NameForYourTwitterToken` here can be freely defined. It is only used as an alias to specify the account when entering commands and does not need to match the Twitter account name.\n\n#### Example\n```env\nBOT_TOKEN=FAKE1234567890ABCDEFGHIJKLMNO.PQRSTUVWXYZ1234567890.ABCDEFGHIJKLMNOPQRSTUVWXYZ123456\nTWITTER_TOKEN=Account1:12345abcde67890fghij12345klmnop67890qrstuv,Account2:abcdef123456ghijkl7890mnopqrst123456uvwx\nDATA_PATH=./data\n```\n\nYou can retrieve your auth token from cookies, or you can explore other methods to obtain it.\n\n### 2. Configure the configs.yml file\n\nCreate `configs.yml` and copy the contents of `configs.example.yml` into it, and edit it to your liking.\n\n\u003e [!IMPORTANT]\n\u003e All configuration instructions here are synchronized with the latest version. For users of the old version, please refer to the old README.\n\n#### Base\n\n| Parameter | Description | Restriction |\n|-----------|-------------|-------------|\n| `prefix` | The prefix for bot commands, only effective for prefix commands. | None, but recommended to choose a simple and easily identifiable prefix and avoid using empty strings. |\n| `activity_name` | The activity name displayed by the bot. | None. |\n| `activity_type` | The activity type displayed by the bot. | `playing`, `streaming`, `listening`, `watching` and `competing` only. |\n| `users_list_pagination_size` | `list users` command's pagination size. | Only accepts integers, and it is not recommended to use too large or too small values. |\n| `users_list_page_counter_position` | `list users` command's pagination counter position. | `title` and `footer` only. |\n\nCustom activity name is in `f-string` format, currently supporting 1 special variable for use, which will be explained below.\n\n- `{count}` : the number of users currently being monitored, it will be updated in real time\n\n#### Timer \u0026 Counter\n\n| Parameter | Description | Unit |\n|-----------|-------------|------|\n| `tweets_check_period` | The check frequency for the posts, it is not recommended to set this value too low to avoid rate limiting. Default value: `10`, Safety value: `18` [(why is this value?)](https://github.com/mahrtayyab/tweety/wiki/FAQs#twitter-new-limits), not recommended below `10`. If the account controlled by Tweetocrd is the same as the account you usually use, please increase the value appropriately to avoid rate limiting. | seconds |\n| `tweets_updater_retry_delay` | Retry Interval when Tweets Updater encounters exceptions. | minutes |\n| `tasks_monitor_check_period` | Interval at which to check if each tasks is functioning properly, and if a task has stopped, attempt a restart. | minutes |\n| `tasks_monitor_log_period` | Interval at which to output the list of currently running tasks to the execution log. | hours |\n| `auth_max_attempts` | The maximum number of attempts to log in to the Twitter account, if the number of failures exceeds this number, the bot will be forced to stop running. | times |\n\n#### Control Account Behavior\n\n| Parameter | Description |\n|-----------|-------------|\n| `auto_change_client` | If a new client is specified for an exisiting user, automatically use the new client to monitor the user. |\n| `auto_turn_off_notification` | If all notifications for a user are disabled, decide whether to unfollow the user. |\n| `auto_unfollow` | If all notifications for a user is disabled, decide whether to disable notification for the user (twitter side). |\n\n#### Database\n\n| Parameter | Description |\n|-----------|-------------|\n| `auto_repair_mismatched_clients` | Whether the system should automatically use the first client defined in the current environment variables to replace invalid `client_used` values in the database when they are not defined in the environment variables. |\n\n#### Embed Style\n\n| Parameter | Description |\n|-----------|-------------|\n| `type` | Determine the type of embed, supported types: `built_in` / `fx_twitter`. |\n\n##### built_in:\n\n| Parameter | Description |\n|-----------|-------------|\n| `fx_image` | Whether to use FxTwitter's combined image when there are multiple images, friendly for iOS systems that cannot display multiple image embeddings. |\n| `video_link_button` | _coming soon_ |\n| `footer_logo` | _coming soon_ |\n\n##### fx_twitter:\n\n| Parameter | Description |\n|-----------|-------------|\n| `domain_name` | The domain name to be used when sending tweet links, can be `fxtwitter` or `fixupx`. |\n| `original_url_button` | _coming soon_ |\n\n#### Message\n\n| Parameter | Description |\n|-----------|-------------|\n| `default_message` | Set default message format globally, the format is the same as the customized message, use f-string and support 4 special variables. For details, please refer to [Commands](#commands). |\n\n### 3. Run and invite the bot to your server\n\n```shell\npython bot.py\n```\n\n🔧Bot Permissions Setup `2147666944`\n\n- [x] Read Messages/View Channels\n- [x] Send Messages\n- [x] Embed Links\n- [x] Attach Files\n- [x] Mention Everyone\n- [x] Use Slash Commands\n\n\u003e [!NOTE]\n\u003e If you want to host the bot on a server, here is a recommended service that is basically free: [fly.io](https://fly.io) _(update: fly.io has stopped offering free plans to new users)_\n\n\u003e [!TIP]\n\u003e Alternatively, you can try this virtual hosting service provided by Taiwanese students: [FreeServer](https://freeserver.tw/index.html)\n\n\u003cdetails\u003e\n   \u003csummary\u003e\u003cb\u003e⚙️some configuration files you may need if you use fly.io\u003c/b\u003e\u003c/summary\u003e\n\n- dockerfile\n\n```dockerfile\nFROM python:3.11.11\nWORKDIR /bot\nCOPY requirements.txt /bot/\nRUN pip install -r requirements.txt\nCOPY . /bot/\nCMD python bot.py\n```\n\n- fly.toml\n\n```toml\napp = \"YOUR_APP_NAME\"\nprimary_region = \"YOUR_APP_REGION\"\n\n[env]\n  DATA_PATH = \"/data\"\n\n[mounts]\n  source = \"YOUR_APP_VOLUME_NAME\"\n  destination = \"/data\"\n```\n\n\u003c/details\u003e\n\n### 4. Have fun\n\nNow you can go back to Discord and use the `/add notifier` command to set up notifications for the Twitter users you wish to receive updates from!\n\n## 💪Contributors\n\nThis project exists thanks to all the people who contribute.\n\n[![](https://contrib.rocks/image?repo=Yuuzi261/Tweetcord)](https://github.com/Yuuzi261/Tweetcord/graphs/contributors)\n\nThis project also benefits from the creative contributions of artists who provide our logo.\n\n\u003ca href=\"./AVATAR.md\"\u003e\u003cimg alt=\"LOGO\" src=\"/images/md/MarcoDK.png\" width=\"64\" height=\"64\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuuzi261%2Ftweetcord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuuzi261%2Ftweetcord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuuzi261%2Ftweetcord/lists"}