mirror of
https://github.com/Xtao-Labs/misskey2telegram.git
synced 2024-11-22 05:53:09 +00:00
fix: post
This commit is contained in:
parent
7630b3c154
commit
30c804f500
@ -36,7 +36,7 @@ class ReadySend:
|
||||
try:
|
||||
misskey_bot = get_misskey_bot(user_id)
|
||||
await misskey_bot.core.api.note.action.send(
|
||||
content=self.content or None,
|
||||
text=self.content or None,
|
||||
reply_id=self.reply_id,
|
||||
files=self.files,
|
||||
)
|
||||
@ -48,49 +48,4 @@ class ReadySend:
|
||||
del ready_send[(msg.chat.id, msg.id)]
|
||||
|
||||
|
||||
class ReadySendMessage:
|
||||
def __init__(
|
||||
self,
|
||||
text: str,
|
||||
group: bool = False,
|
||||
uid: Optional[str] = None,
|
||||
file_id: Optional[str] = None,
|
||||
):
|
||||
self.text = text
|
||||
self.user_id = None if group else uid
|
||||
self.group_id = uid if group else None
|
||||
self.file_id = file_id
|
||||
|
||||
async def confirm(self, msg: Message):
|
||||
msg = await msg.reply(
|
||||
"确认发送?",
|
||||
quote=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(text="发送", callback_data="chat_send"),
|
||||
InlineKeyboardButton(text="拒绝", callback_data="delete"),
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
ready_send[(msg.chat.id, msg.id)] = self
|
||||
|
||||
async def send(self, msg: Message, user_id: int):
|
||||
try:
|
||||
misskey_bot = get_misskey_bot(user_id)
|
||||
await misskey_bot.core.api.chat.action.send(
|
||||
text=self.text or None,
|
||||
user_id=self.user_id,
|
||||
group_id=self.group_id,
|
||||
file_id=self.file_id,
|
||||
)
|
||||
except Exception as e:
|
||||
await msg.edit(f"发送失败:{e}")
|
||||
else:
|
||||
await msg.delete()
|
||||
finally:
|
||||
del ready_send[(msg.chat.id, msg.id)]
|
||||
|
||||
|
||||
ready_send = {}
|
||||
|
@ -326,7 +326,7 @@
|
||||
],
|
||||
"justPlainLucky": [
|
||||
"超高校级的幸运",
|
||||
"每 10 秒有 0.01 的概率自动获得",
|
||||
"每 10 秒有 0.005% 的概率自动获得",
|
||||
""
|
||||
],
|
||||
"setNameToSyuilo": [
|
||||
@ -368,5 +368,25 @@
|
||||
"Brain Diver",
|
||||
"发布了包含 Brain Diver 链接的帖子",
|
||||
"Misskey-Misskey La-Tu-Ma"
|
||||
],
|
||||
"smashTestNotificationButton": [
|
||||
"过度测试",
|
||||
"短时间内连续测试通知",
|
||||
""
|
||||
],
|
||||
"tutorialCompleted": [
|
||||
"Misskey 初学者课程 结业证书",
|
||||
"完成了教学",
|
||||
""
|
||||
],
|
||||
"bubbleGameExplodingHead": [
|
||||
"🤯",
|
||||
"你合成出了游戏里最大的Emoji",
|
||||
""
|
||||
],
|
||||
"bubbleGameDoubleExplodingHead": [
|
||||
"两个🤯",
|
||||
"你合成出了2个游戏里最大的Emoji",
|
||||
""
|
||||
]
|
||||
}
|
@ -9,7 +9,7 @@ json_path = Path(__file__).parent / "achievement.json"
|
||||
|
||||
def main():
|
||||
yml_data = get(
|
||||
"https://cdn.staticaly.com/gh/misskey-dev/misskey/develop/locales/zh-CN.yml"
|
||||
"https://raw.githubusercontent.com/misskey-dev/misskey/develop/locales/zh-CN.yml"
|
||||
)
|
||||
json_raw_data = yaml.safe_load(yml_data.text)
|
||||
json_data = {}
|
||||
|
@ -40,7 +40,7 @@ async def post_photo_command(_: Client, message: Message):
|
||||
photo = await message.download()
|
||||
try:
|
||||
misskey_bot = get_misskey_bot(message.from_user.id)
|
||||
file_ = await misskey_bot.core.api.drive.file.action.upload_file(
|
||||
file_ = await misskey_bot.core.api.drive.files.action.create(
|
||||
photo,
|
||||
is_sensitive=message.has_media_spoiler or False,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user