mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf44c3ddd7
|
@@ -162,6 +162,22 @@ async def query_template(update: Update, context: CustomContext) -> None:
|
|||||||
await _edit_message.forward[0].edit_caption(context.chat_data.template[name])
|
await _edit_message.forward[0].edit_caption(context.chat_data.template[name])
|
||||||
|
|
||||||
|
|
||||||
|
@send_action(ChatAction.TYPING)
|
||||||
|
async def cmd_start(update: Update, context: CustomContext) -> None:
|
||||||
|
await update.effective_message.reply_text(
|
||||||
|
"Welcome to the Twitter Fetcher Bot!\n"
|
||||||
|
"You can use this bot to fetch tweets from Twitter and forward them to a channel.\n"
|
||||||
|
"Use /set_forward_channel to set a channel to forward tweets.\n"
|
||||||
|
"Use /remove_forward_channel to remove the channel.\n"
|
||||||
|
"Use /edit_before_forward to enable or disable edit before forward.\n"
|
||||||
|
"Use /set_template to set a template for the forwarded message.\n"
|
||||||
|
"Use /bot_dict to see the bot's data.\n"
|
||||||
|
"Use /clear_edit_message to clear the edit message cache.\n"
|
||||||
|
"You can also reply to a message with a tweet URL to fetch the tweet and forward it to the channel.\n"
|
||||||
|
"You can also use inline query to search for tweets."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@send_action(ChatAction.TYPING)
|
@send_action(ChatAction.TYPING)
|
||||||
async def cmd_set_forward_channel(update: Update, context: CustomContext) -> None:
|
async def cmd_set_forward_channel(update: Update, context: CustomContext) -> None:
|
||||||
if not context.args:
|
if not context.args:
|
||||||
|
|||||||
+3
-2
@@ -1,10 +1,11 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
x_url = re.compile(r"^(?:https?://)?(?:www\.|mobile\.)?(?:x|twitter|fixvx|vxtwitter)\.com/(.+)/status/(\d+)")
|
x_url = re.compile(
|
||||||
|
r"^(?:https?://)?(?:www\.|mobile\.)?(?:x|twitter|fixvx|vxtwitter|fixupx|fxtwitter)\.com/(.+)/status/(\d+)")
|
||||||
x_media_url = re.compile(r"^(?:https?://)?(pbs|video)\.twimg\.com/(.*)")
|
x_media_url = re.compile(r"^(?:https?://)?(pbs|video)\.twimg\.com/(.*)")
|
||||||
x_tco_url = re.compile(r"(?:https?://)?t\.co/.+$", re.M)
|
x_tco_url = re.compile(r"(?:https?://)?t\.co/.+$", re.M)
|
||||||
message_url = re.compile(r"\[.+]", re.S)
|
message_url = re.compile(r"\[.+]", re.S)
|
||||||
|
|
||||||
pixiv_url = re.compile(r"^(?:https?://)?(?:www\.)?pixiv\.net/(?:en/)?(?:artworks/|i/)(\d+)")
|
pixiv_url = re.compile(r"^(?:https?://)?(?:www\.)?pixiv\.net/(?:en/)?(?:artworks/|i/)(\d+)")
|
||||||
|
|
||||||
bsky_url = re.compile(r"^(?:https?://)?(?:bsky)\.app/profile/(.+)/post/(.+)")
|
bsky_url = re.compile(r"^(?:https?://)?bsky\.app/profile/(.+)/post/(.+)")
|
||||||
|
|||||||
Reference in New Issue
Block a user