add FixTweet, removed c.vxtwitter

This commit is contained in:
A.C.Sukazyo Eyre 2023-11-20 17:12:10 +08:00
parent c5c6683459
commit 2687c3be88
Signed by: Eyre_S
GPG Key ID: C17CE40291207874
2 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ MORNY_ARCHIVE_NAME = morny-coeur
MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono MORNY_CODE_STORE = https://github.com/Eyre-S/Coeur-Morny-Cono
MORNY_COMMIT_PATH = https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s MORNY_COMMIT_PATH = https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s
VERSION = 1.3.0-dev6 VERSION = 1.3.0-dev7
USE_DELTA = false USE_DELTA = false
VERSION_DELTA = VERSION_DELTA =

View File

@ -10,10 +10,10 @@ import scala.util.matching.Regex
class ShareToolTwitter extends ITelegramQuery { class ShareToolTwitter extends ITelegramQuery {
private val TITLE_VX = "[tweet] Share as VxTwitter" private val TITLE_VX = "[tweet] Share as VxTwitter"
private val TITLE_VX_COMBINED = "[tweet] Share as VxTwitter(combination)"
private val ID_PREFIX_VX = "[morny/share/twitter/vxtwi]" private val ID_PREFIX_VX = "[morny/share/twitter/vxtwi]"
private val ID_PREFIX_VX_COMBINED = "[morny/share/twitter/vxtwi_combine]" private val TITLE_FX = "[tweet] Share as Fix-Tweet"
private val REGEX_TWEET_LINK: Regex = "^(?:https?://)?((?:(?:c\\.)?vx|fx|www\\.)?twitter\\.com)/((\\w+)/status/(\\d+)(?:/photo/(\\d+))?)/?(\\?[\\w&=-]+)?$"r private val ID_PREFIX_FX = "[morny/share/twitter/fxtwi]"
private val REGEX_TWEET_LINK: Regex = "^(?:https?://)?((?:(?:c\\.)?vx|fx|www\\.)?twitter|(?:www\\.|fixup)?x)\\.com/((\\w+)/status/(\\d+)(?:/photo/(\\d+))?)/?(\\?[\\w&=-]+)?$"r
override def query (event: Update): List[InlineQueryUnit[_]] | Null = { override def query (event: Update): List[InlineQueryUnit[_]] | Null = {
@ -24,12 +24,12 @@ class ShareToolTwitter extends ITelegramQuery {
case REGEX_TWEET_LINK(_, _path_data, _, _, _, _) => case REGEX_TWEET_LINK(_, _path_data, _, _, _, _) =>
List( List(
InlineQueryUnit(InlineQueryResultArticle( InlineQueryUnit(InlineQueryResultArticle(
inlineQueryId(ID_PREFIX_VX+event.inlineQuery.query), TITLE_VX, inlineQueryId(ID_PREFIX_FX + event.inlineQuery.query), TITLE_FX,
s"https://vxtwitter.com/$_path_data" s"https://fxtwitter.com/$_path_data"
)), )),
InlineQueryUnit(InlineQueryResultArticle( InlineQueryUnit(InlineQueryResultArticle(
inlineQueryId(ID_PREFIX_VX_COMBINED+event.inlineQuery.query), TITLE_VX_COMBINED, inlineQueryId(ID_PREFIX_VX+event.inlineQuery.query), TITLE_VX,
s"https://c.vxtwitter.com/$_path_data" s"https://vxtwitter.com/$_path_data"
)) ))
) )