feat: errors compiler

pull/142/head
omg-xtao 7 months ago committed by yupix
parent 2239f74f87
commit ebb6bb503e
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -0,0 +1,132 @@
code,message
ACCESS_DENIED,Access denied.
ALREADY_ADDED,That user has already been added to that list.
ALREADY_BLOCKING,You are already blocking that user.
ALREADY_CLIPPED,The note has already been clipped.
ALREADY_ENDED,That game has already ended.
ALREADY_EXPIRED,The poll is already expired.
ALREADY_FAVORITED,You have not favorited the list.
ALREADY_FOLLOWING,You are already following that user.
ALREADY_LIKED,The flash has already been liked.
ALREADY_MOVED,Account was already moved to another account.
ALREADY_MUTING,You are already muting that user.
ALREADY_PINNED,That note has already been pinned.
ALREADY_PROMOTED,The note has already promoted.
ALREADY_REACTED,You are already reacting to that note.
ALREADY_VOTED,You have already voted.
AUTHENTICATION_FAILED,Authentication failed. Please ensure your token is correct.
AVATAR_NOT_AN_IMAGE,The file specified as an avatar is not an image.
BANNER_NOT_AN_IMAGE,The file specified as a banner is not an image.
BIRTHDAY_DATE_FORMAT_INVALID,Birthday date format is invalid.
BLOCKED,You are blocked by that user.
BLOCKEE_IS_YOURSELF,Blockee is yourself.
BLOCKING,You are blocking that user.
BOTH_WITH_REPLIES_AND_WITH_FILES,Specifying both withReplies and withFiles is not supported
CANNOT_CREATE_ALREADY_EXPIRED_POLL,Poll is already expired.
CANNOT_RENOTE_DUE_TO_VISIBILITY,You can not Renote due to target visibility.
CANNOT_RENOTE_OUTSIDE_OF_CHANNEL,Cannot renote outside of channel.
CANNOT_RENOTE_TO_A_PURE_RENOTE,You can not Renote a pure Renote.
CANNOT_REPLY_TO_AN_INVISIBLE_NOTE,You cannot reply to an invisible Note.
CANNOT_REPLY_TO_A_PURE_RENOTE,You can not reply to a pure Renote.
CANNOT_REPORT_THE_ADMIN,Cannot report the admin.
CANNOT_REPORT_YOURSELF,Cannot report yourself.
CAN_NOT_DELETE_INVITE_CODE,You can't delete this invite code.
CREDENTIAL_REQUIRED,Credential required.
DESTINATION_ACCOUNT_FORBIDS,"Destination account doesn't have proper 'Known As' alias, or has already moved."
DUPLICATE_NAME,Duplicate name.
EMPTY_FILE,That file is empty.
EXCEEDED_LIMIT_OF_CREATE_INVITE_CODE,You have exceeded the limit for creating an invitation code.
EXT_RESOURCE_HASH_DIDNT_MATCH,Hash did not match.
EXT_RESOURCE_RETURNED_INVALID_SCHEMA,External resource returned invalid schema.
FAILED_TO_RESOLVE_REMOTE_USER,Failed to resolve remote user.
FOLLOWEE_IS_YOURSELF,Followee is yourself.
FOLLOWER_IS_YOURSELF,Follower is yourself.
FOLLOW_REQUEST_NOT_FOUND,Follow request not found.
FORBIDDEN,Forbidden.
FORBIDDEN_TO_SET_YOURSELF,You can't set yourself as your own alias.
GTL_DISABLED,Global timeline has been disabled.
HAS_CHILD_FILES_OR_FOLDERS,This folder has child files or folders.
INAPPROPRIATE,Cannot upload the file because it has been determined that it possibly contains inappropriate content.
INCORRECT_PASSWORD,Incorrect password.
INTERNAL_ERROR,Internal error occurred. Please contact us if the error persists.
INVALID_CHOICE,Choice ID is invalid.
INVALID_DATE_TIME,Invalid date-time format
INVALID_FILE_NAME,Invalid file name.
INVALID_PARAM,Invalid param.
INVALID_REGEXP,Invalid Regular Expression.
INVALID_SEED,Provided seed is invalid.
INVALID_URL,Invalid URL
I_AM_AI,"You sent a request to Ai-chan, Misskey's showgirl, instead of the server."
LTL_DISABLED,Local timeline has been disabled.
MUTEE_IS_YOURSELF,Mutee is yourself.
NAME_ALREADY_EXISTS,Specified name already exists.
NOT_ASSIGNED,Not assigned.
NOT_BLOCKING,You are not blocking that user.
NOT_FAVORITED,You have not marked that note a favorite.
NOT_FOLLOWING,The other use is not following you.
NOT_LIKED,You have not liked that flash.
NOT_MUTING,You are not muting that user.
NOT_REACTED,You are not reacting to that note.
NOT_ROOT_FORBIDDEN,The root can't migrate.
NO_FOLLOW_REQUEST,No follow request.
NO_FREE_SPACE,Cannot upload the file because you have no free space of drive.
NO_POLL,The note does not attach a poll.
NO_SECURITY_KEY,No security key.
NO_SUCH_AD,No such ad.
NO_SUCH_ANNOUNCEMENT,No such announcement.
NO_SUCH_ANTENNA,No such antenna.
NO_SUCH_APP,No such app.
NO_SUCH_AVATAR,No such avatar file.
NO_SUCH_BANNER,No such banner file.
NO_SUCH_CHANNEL,No such channel.
NO_SUCH_CLIP,No such clip.
NO_SUCH_EMOJI,No such emoji.
NO_SUCH_FILE,No such file.
NO_SUCH_FLASH,No such flash.
NO_SUCH_FOLDER,No such folder.
NO_SUCH_GAME,No such game.
NO_SUCH_HASHTAG,No such hashtag.
NO_SUCH_INVITE_CODE,No such invite code.
NO_SUCH_KEY,No such key.
NO_SUCH_LIST,No such list.
NO_SUCH_NOTE,No such note.
NO_SUCH_OBJECT,No such object.
NO_SUCH_PAGE,No such page.
NO_SUCH_PARENT_FOLDER,No such parent folder.
NO_SUCH_POST,No such post.
NO_SUCH_REGISTRATION,No such registration.
NO_SUCH_RENOTE_TARGET,No such renote target.
NO_SUCH_REPLY_TARGET,No such reply target.
NO_SUCH_ROLE,No such role.
NO_SUCH_SESSION,No such session.
NO_SUCH_USER,No such user.
NO_SUCH_USER_LIST,No such user list.
NO_SUCH_WEBHOOK,No such webhook.
PENDING_SESSION,This session is not completed yet.
PIN_LIMIT_EXCEEDED,You can not pin notes any more.
RATE_LIMIT_EXCEEDED,Rate limit exceeded. Please try again later.
REACTIONS_NOT_PUBLIC,Reactions of the user is not public.
RECURSIVE_NESTING,It can not be structured like nesting folders recursively.
REMOTE_USER_NOT_ALLOWED,Not allowed to load the remote user's list
RESTRICTED_BY_ROLE,This feature is restricted by your role.
SAME_NAME_EMOJI_EXISTS,Emoji that have same name already exists.
STL_DISABLED,Hybrid timeline has been disabled.
TARGET_IS_YOURSELF,Target user is yourself.
TOO_BIG_FILE,That file is too big.
TOO_MANY_ANTENNAS,You cannot create antenna any more.
TOO_MANY_CLIPS,You cannot create clip any more.
TOO_MANY_CLIP_NOTES,You cannot add notes to the clip any more.
TOO_MANY_MUTED_WORDS,Too many muted words.
TOO_MANY_USERLISTS,You cannot create user list any more.
TOO_MANY_USERS,You can not push users any more.
TOO_MANY_WEBHOOKS,You cannot create webhook any more.
TWO_FACTOR_NOT_ENABLED,2fa not enabled.
UNAVAILABLE,Translate of notes unavailable.
UNEXPECTED_FILE_TYPE,We need csv file.
URI_NULL,Local User ActivityPup URI is null.
USER_IS_DELETED,User is deleted.
USER_NOT_FOUND,User not found.
YOUR_FLASH,You cannot like your flash.
YOUR_PAGE,You cannot like your page.
YOUR_POST,You cannot like your post.
YOU_HAVE_BEEN_BLOCKED,You cannot push this user because you have been blocked by this user.
1 code message
2 ACCESS_DENIED Access denied.
3 ALREADY_ADDED That user has already been added to that list.
4 ALREADY_BLOCKING You are already blocking that user.
5 ALREADY_CLIPPED The note has already been clipped.
6 ALREADY_ENDED That game has already ended.
7 ALREADY_EXPIRED The poll is already expired.
8 ALREADY_FAVORITED You have not favorited the list.
9 ALREADY_FOLLOWING You are already following that user.
10 ALREADY_LIKED The flash has already been liked.
11 ALREADY_MOVED Account was already moved to another account.
12 ALREADY_MUTING You are already muting that user.
13 ALREADY_PINNED That note has already been pinned.
14 ALREADY_PROMOTED The note has already promoted.
15 ALREADY_REACTED You are already reacting to that note.
16 ALREADY_VOTED You have already voted.
17 AUTHENTICATION_FAILED Authentication failed. Please ensure your token is correct.
18 AVATAR_NOT_AN_IMAGE The file specified as an avatar is not an image.
19 BANNER_NOT_AN_IMAGE The file specified as a banner is not an image.
20 BIRTHDAY_DATE_FORMAT_INVALID Birthday date format is invalid.
21 BLOCKED You are blocked by that user.
22 BLOCKEE_IS_YOURSELF Blockee is yourself.
23 BLOCKING You are blocking that user.
24 BOTH_WITH_REPLIES_AND_WITH_FILES Specifying both withReplies and withFiles is not supported
25 CANNOT_CREATE_ALREADY_EXPIRED_POLL Poll is already expired.
26 CANNOT_RENOTE_DUE_TO_VISIBILITY You can not Renote due to target visibility.
27 CANNOT_RENOTE_OUTSIDE_OF_CHANNEL Cannot renote outside of channel.
28 CANNOT_RENOTE_TO_A_PURE_RENOTE You can not Renote a pure Renote.
29 CANNOT_REPLY_TO_AN_INVISIBLE_NOTE You cannot reply to an invisible Note.
30 CANNOT_REPLY_TO_A_PURE_RENOTE You can not reply to a pure Renote.
31 CANNOT_REPORT_THE_ADMIN Cannot report the admin.
32 CANNOT_REPORT_YOURSELF Cannot report yourself.
33 CAN_NOT_DELETE_INVITE_CODE You can't delete this invite code.
34 CREDENTIAL_REQUIRED Credential required.
35 DESTINATION_ACCOUNT_FORBIDS Destination account doesn't have proper 'Known As' alias, or has already moved.
36 DUPLICATE_NAME Duplicate name.
37 EMPTY_FILE That file is empty.
38 EXCEEDED_LIMIT_OF_CREATE_INVITE_CODE You have exceeded the limit for creating an invitation code.
39 EXT_RESOURCE_HASH_DIDNT_MATCH Hash did not match.
40 EXT_RESOURCE_RETURNED_INVALID_SCHEMA External resource returned invalid schema.
41 FAILED_TO_RESOLVE_REMOTE_USER Failed to resolve remote user.
42 FOLLOWEE_IS_YOURSELF Followee is yourself.
43 FOLLOWER_IS_YOURSELF Follower is yourself.
44 FOLLOW_REQUEST_NOT_FOUND Follow request not found.
45 FORBIDDEN Forbidden.
46 FORBIDDEN_TO_SET_YOURSELF You can't set yourself as your own alias.
47 GTL_DISABLED Global timeline has been disabled.
48 HAS_CHILD_FILES_OR_FOLDERS This folder has child files or folders.
49 INAPPROPRIATE Cannot upload the file because it has been determined that it possibly contains inappropriate content.
50 INCORRECT_PASSWORD Incorrect password.
51 INTERNAL_ERROR Internal error occurred. Please contact us if the error persists.
52 INVALID_CHOICE Choice ID is invalid.
53 INVALID_DATE_TIME Invalid date-time format
54 INVALID_FILE_NAME Invalid file name.
55 INVALID_PARAM Invalid param.
56 INVALID_REGEXP Invalid Regular Expression.
57 INVALID_SEED Provided seed is invalid.
58 INVALID_URL Invalid URL
59 I_AM_AI You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
60 LTL_DISABLED Local timeline has been disabled.
61 MUTEE_IS_YOURSELF Mutee is yourself.
62 NAME_ALREADY_EXISTS Specified name already exists.
63 NOT_ASSIGNED Not assigned.
64 NOT_BLOCKING You are not blocking that user.
65 NOT_FAVORITED You have not marked that note a favorite.
66 NOT_FOLLOWING The other use is not following you.
67 NOT_LIKED You have not liked that flash.
68 NOT_MUTING You are not muting that user.
69 NOT_REACTED You are not reacting to that note.
70 NOT_ROOT_FORBIDDEN The root can't migrate.
71 NO_FOLLOW_REQUEST No follow request.
72 NO_FREE_SPACE Cannot upload the file because you have no free space of drive.
73 NO_POLL The note does not attach a poll.
74 NO_SECURITY_KEY No security key.
75 NO_SUCH_AD No such ad.
76 NO_SUCH_ANNOUNCEMENT No such announcement.
77 NO_SUCH_ANTENNA No such antenna.
78 NO_SUCH_APP No such app.
79 NO_SUCH_AVATAR No such avatar file.
80 NO_SUCH_BANNER No such banner file.
81 NO_SUCH_CHANNEL No such channel.
82 NO_SUCH_CLIP No such clip.
83 NO_SUCH_EMOJI No such emoji.
84 NO_SUCH_FILE No such file.
85 NO_SUCH_FLASH No such flash.
86 NO_SUCH_FOLDER No such folder.
87 NO_SUCH_GAME No such game.
88 NO_SUCH_HASHTAG No such hashtag.
89 NO_SUCH_INVITE_CODE No such invite code.
90 NO_SUCH_KEY No such key.
91 NO_SUCH_LIST No such list.
92 NO_SUCH_NOTE No such note.
93 NO_SUCH_OBJECT No such object.
94 NO_SUCH_PAGE No such page.
95 NO_SUCH_PARENT_FOLDER No such parent folder.
96 NO_SUCH_POST No such post.
97 NO_SUCH_REGISTRATION No such registration.
98 NO_SUCH_RENOTE_TARGET No such renote target.
99 NO_SUCH_REPLY_TARGET No such reply target.
100 NO_SUCH_ROLE No such role.
101 NO_SUCH_SESSION No such session.
102 NO_SUCH_USER No such user.
103 NO_SUCH_USER_LIST No such user list.
104 NO_SUCH_WEBHOOK No such webhook.
105 PENDING_SESSION This session is not completed yet.
106 PIN_LIMIT_EXCEEDED You can not pin notes any more.
107 RATE_LIMIT_EXCEEDED Rate limit exceeded. Please try again later.
108 REACTIONS_NOT_PUBLIC Reactions of the user is not public.
109 RECURSIVE_NESTING It can not be structured like nesting folders recursively.
110 REMOTE_USER_NOT_ALLOWED Not allowed to load the remote user's list
111 RESTRICTED_BY_ROLE This feature is restricted by your role.
112 SAME_NAME_EMOJI_EXISTS Emoji that have same name already exists.
113 STL_DISABLED Hybrid timeline has been disabled.
114 TARGET_IS_YOURSELF Target user is yourself.
115 TOO_BIG_FILE That file is too big.
116 TOO_MANY_ANTENNAS You cannot create antenna any more.
117 TOO_MANY_CLIPS You cannot create clip any more.
118 TOO_MANY_CLIP_NOTES You cannot add notes to the clip any more.
119 TOO_MANY_MUTED_WORDS Too many muted words.
120 TOO_MANY_USERLISTS You cannot create user list any more.
121 TOO_MANY_USERS You can not push users any more.
122 TOO_MANY_WEBHOOKS You cannot create webhook any more.
123 TWO_FACTOR_NOT_ENABLED 2fa not enabled.
124 UNAVAILABLE Translate of notes unavailable.
125 UNEXPECTED_FILE_TYPE We need csv file.
126 URI_NULL Local User ActivityPup URI is null.
127 USER_IS_DELETED User is deleted.
128 USER_NOT_FOUND User not found.
129 YOUR_FLASH You cannot like your flash.
130 YOUR_PAGE You cannot like your page.
131 YOUR_POST You cannot like your post.
132 YOU_HAVE_BEEN_BLOCKED You cannot push this user because you have been blocked by this user.

@ -0,0 +1,65 @@
import csv
import json
from type import OpenAPI
pre = """from .base import APIError
"""
template = """class %sError(APIError):
\"\"\"%s\"\"\"
"""
def error_name_to_hump(name: str) -> str:
return "".join([i.capitalize() for i in name.split("_")])
def gen_errors_py_files():
error_list = {}
with open("datas/errors.csv", "r", encoding="utf-8") as csvfile:
reader = csv.reader(csvfile)
for idx, row in enumerate(reader):
if idx == 0:
continue
if row:
error_list[row[0]] = row[1]
all_content = [template % (error_name_to_hump(i), value) for i, value in error_list.items()]
with open("../mipac/errors/errors.py", "w", encoding="utf-8") as f:
f.write(pre + "\n\n".join(all_content))
def gen_errors_csv():
with open("datas/v13_api.json", mode="r", encoding="utf-8") as f:
api: OpenAPI = json.load(f)
error_map = {}
for path_value in api["paths"].values():
for method_value in path_value.values():
for status_code, res_value in method_value["responses"].items():
if status_code == "200":
continue
if "content" not in res_value:
continue
for content_value in res_value["content"].values():
if content_value.get("schema", {}).get("$ref") != "#/components/schemas/Error":
continue
for error_value in content_value["examples"].values():
error_data = error_value["value"]["error"]
code = error_data["code"]
message = error_data["message"]
error_map[code] = message
sorted_error_map = sorted(error_map.items())
with open("datas/errors.csv", "w", encoding="utf-8") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["code", "message"])
for error in sorted_error_map:
writer.writerow(error)
if __name__ == "__main__":
gen_errors_csv()
gen_errors_py_files()
print("Done")

@ -1,37 +0,0 @@
pre = '''from .base import APIError
'''
template = '''class %sError(APIError):
\"\"\" %s \"\"\"
'''
def error_name_to_hump(name: str) -> str:
return ''.join([i.capitalize() for i in name.split('_')])
def gen_errors_py_files():
with open('errors.csv', 'r', encoding='utf-8') as f:
content = f.read()
content = content.split('\n')[1:]
error_list = {}
for i in content:
if i:
i = i.split(',')
error_list[i[0]] = i[1]
all_content = [
template % (error_name_to_hump(i), value)
for i, value in error_list.items()
]
with open('../../mipac/errors/errors.py', 'w', encoding='utf-8') as f:
f.write(pre + '\n\n'.join(all_content))
if __name__ == '__main__':
gen_errors_py_files()
print('Done')

@ -1,98 +0,0 @@
code,description
ACCESS_DENIED,アクセス権限がありません。
ALREADY_ADDED,
ALREADY_BLOCKING,すでにブロックしています。
ALREADY_CLIPPED,
ALREADY_EXPIRED,
ALREADY_FAVORITED,既にお気に入り登録されています。
ALREADY_FOLLOWING,すでにフォローしています。
ALREADY_INVITED,
ALREADY_LIKED,すでにいいねをつけています。
ALREADY_MUTING,すでにそのユーザーをミュートしています。
ALREADY_PINNED,指定されたノートは既にピン留めされています。
ALREADY_PROMOTED,
ALREADY_REACTED,既にリアクションしています。
ALREADY_VOTED,
AVATAR_NOT_AN_IMAGE,アバター画像に、画像ではないファイルが指定されました。
BANNER_NOT_AN_IMAGE,バナー画像に、画像ではないファイルが指定されました。
BLOCKED,ユーザーにブロックされています。
BLOCKEE_IS_YOURSELF,自分のブロックを解除しようとしました。
BLOCKING,ユーザーをブロックしています。
CANNOT_CREATE_ALREADY_EXPIRED_POLL,アンケートの期限の指定が誤っています。
CANNOT_RENOTE_TO_A_PURE_RENOTE,単純なRenoteを再度Renoteすることはできません。
CANNOT_REPLY_TO_A_PURE_RENOTE,単純なRenoteに返信することはできません。
CANNOT_REPORT_THE_ADMIN,管理者を通報しようとしました。
CANNOT_REPORT_YOURSELF,自身を通報しようとしました。
CONTENT_REQUIRED,
CREDENTIAL_REQUIRED,クレデンシャル必須のエンドポイントにクレデンシャル無しでリクエストされました。
FAILED_TO_RESOLVE_REMOTE_USER,リモートユーザーの検索に失敗しました。
FOLLOWEE_IS_YOURSELF,自分のフォローを解除しようとしました。
FOLLOWER_IS_YOURSELF,自分をフォロワー解除しようとしました。
FOLLOW_REQUEST_NOT_FOUND,フォローリクエストがありません。
FORBIDDEN,
GROUP_ACCESS_DENIED,
GTL_DISABLED,グローバルタイムラインが無効になっています。
HAS_CHILD_FILES_OR_FOLDERS,フォルダーが空ではありません。
INAPPROPRIATE,不適切なコンテンツを含んでいる可能性があると判定されました。
INTERNAL_ERROR,サーバー内部で問題が発生しました。引き続き問題が発生する場合は管理者にお問い合わせください。
INVALID_CHOICE,
INVALID_FILE_NAME,ファイル名が不正です。
INVALID_PARAM,リクエストパラメータに誤りがあります。
INVALID_REGEXP,正規表現が不正です。
INVALID_URL,
IS_OWNER,
LTL_DISABLED,ローカルタイムラインが無効になっています。
MO_SUCH_FILE,
MUTEE_IS_YOURSELF,自分に対してミュートを解除しようとしました。
NAME_ALREADY_EXISTS,同じURLにページがすでに存在します。
NOT_BLOCKING,ブロックしていないユーザーです。
NOT_FAVORITED,お気に入り登録されていません。
NOT_FOLLOWING,ユーザーにフォローされていません。
NOT_LIKED,いいねをつけていないページです。
NOT_MUTING,対象となるユーザーをそもそもミュートしていません。
NOT_REACTED,リアクションしていません。
NO_FOLLOW_REQUEST,ユーザーからのフォローリクエストがありません。
NO_FREE_SPACE,ドライブに空き容量がありません。
NO_POLL,
NO_SUCH_AD,
NO_SUCH_ANNOUNCEMENT,お知らせが存在しません。
NO_SUCH_ANTENNA,
NO_SUCH_APP,アプリが存在しません。
NO_SUCH_AVATAR,アバター画像のファイルが存在しません。
NO_SUCH_BANNER,バナー画像のファイルが存在しません。
NO_SUCH_CHANNEL,指定されたチャンネルが存在しないか、アクセスが許可されていません。
NO_SUCH_CLIP,
NO_SUCH_EMOJI,
NO_SUCH_FILE,ファイルが存在しません。
NO_SUCH_FOLDER,フォルダーが存在しません。
NO_SUCH_GROUP,
NO_SUCH_GROUP_MEMBER,
NO_SUCH_HASHTAG,ハッシュタグが存在しません。
NO_SUCH_INVITATION,
NO_SUCH_LIST,
NO_SUCH_MESSAGE,
NO_SUCH_NOTE,指定されたノートが存在しないか、アクセスが許可されていません。
NO_SUCH_NOTIFICATION,通知が存在しません。
NO_SUCH_OBJECT,
NO_SUCH_PAGE,ページが存在しません。
NO_SUCH_PARENT_FOLDER,親フォルダーが存在しません。
NO_SUCH_POST,
NO_SUCH_RENOTE_TARGET,Renoteに指定されたートが存在しないか、アクセスが許可されていません。
NO_SUCH_REPLY_TARGET,返信先に指定されたノートが存在しないか、アクセスが許可されていません。
NO_SUCH_SESSION,セッションが存在しません。
NO_SUCH_USER,ユーザーが存在しません。
NO_SUCH_USER_GROUP,
NO_SUCH_USER_LIST,
NO_SUCH_WEBHOOK,Webhookが存在しません。
PENDING_SESSION,
PERMISSION_DENIED,与えられたクレデンシャルには必要なパーミッションがありません。
PIN_LIMIT_EXCEEDED,これ以上ピン留めできません。
RATE_LIMIT_EXCEEDED,レートリミットによる制限のため一時的に利用できません。
REACTIONS_NOT_PUBLIC,リアクションが公開されていません。
RECIPIENT_IS_YOURSELF,
STL_DISABLED,ソーシャルタイムラインが無効になっています。
YOUR_ACCOUNT_SUSPENDED,アカウントが凍結されているため利用できません。
YOUR_PAGE,自身のページにいいねをつけようとしました。
YOUR_POST,
YOU_ARE_OWNER,
YOU_HAVE_BEEN_BLOCKED,ブロックされているユーザーのノートにリアクションは行えません。
1 code description
2 ACCESS_DENIED アクセス権限がありません。
3 ALREADY_ADDED
4 ALREADY_BLOCKING すでにブロックしています。
5 ALREADY_CLIPPED
6 ALREADY_EXPIRED
7 ALREADY_FAVORITED 既にお気に入り登録されています。
8 ALREADY_FOLLOWING すでにフォローしています。
9 ALREADY_INVITED
10 ALREADY_LIKED すでにいいねをつけています。
11 ALREADY_MUTING すでにそのユーザーをミュートしています。
12 ALREADY_PINNED 指定されたノートは既にピン留めされています。
13 ALREADY_PROMOTED
14 ALREADY_REACTED 既にリアクションしています。
15 ALREADY_VOTED
16 AVATAR_NOT_AN_IMAGE アバター画像に、画像ではないファイルが指定されました。
17 BANNER_NOT_AN_IMAGE バナー画像に、画像ではないファイルが指定されました。
18 BLOCKED ユーザーにブロックされています。
19 BLOCKEE_IS_YOURSELF 自分のブロックを解除しようとしました。
20 BLOCKING ユーザーをブロックしています。
21 CANNOT_CREATE_ALREADY_EXPIRED_POLL アンケートの期限の指定が誤っています。
22 CANNOT_RENOTE_TO_A_PURE_RENOTE 単純なRenoteを再度Renoteすることはできません。
23 CANNOT_REPLY_TO_A_PURE_RENOTE 単純なRenoteに返信することはできません。
24 CANNOT_REPORT_THE_ADMIN 管理者を通報しようとしました。
25 CANNOT_REPORT_YOURSELF 自身を通報しようとしました。
26 CONTENT_REQUIRED
27 CREDENTIAL_REQUIRED クレデンシャル必須のエンドポイントにクレデンシャル無しでリクエストされました。
28 FAILED_TO_RESOLVE_REMOTE_USER リモートユーザーの検索に失敗しました。
29 FOLLOWEE_IS_YOURSELF 自分のフォローを解除しようとしました。
30 FOLLOWER_IS_YOURSELF 自分をフォロワー解除しようとしました。
31 FOLLOW_REQUEST_NOT_FOUND フォローリクエストがありません。
32 FORBIDDEN
33 GROUP_ACCESS_DENIED
34 GTL_DISABLED グローバルタイムラインが無効になっています。
35 HAS_CHILD_FILES_OR_FOLDERS フォルダーが空ではありません。
36 INAPPROPRIATE 不適切なコンテンツを含んでいる可能性があると判定されました。
37 INTERNAL_ERROR サーバー内部で問題が発生しました。引き続き問題が発生する場合は管理者にお問い合わせください。
38 INVALID_CHOICE
39 INVALID_FILE_NAME ファイル名が不正です。
40 INVALID_PARAM リクエストパラメータに誤りがあります。
41 INVALID_REGEXP 正規表現が不正です。
42 INVALID_URL
43 IS_OWNER
44 LTL_DISABLED ローカルタイムラインが無効になっています。
45 MO_SUCH_FILE
46 MUTEE_IS_YOURSELF 自分に対してミュートを解除しようとしました。
47 NAME_ALREADY_EXISTS 同じURLにページがすでに存在します。
48 NOT_BLOCKING ブロックしていないユーザーです。
49 NOT_FAVORITED お気に入り登録されていません。
50 NOT_FOLLOWING ユーザーにフォローされていません。
51 NOT_LIKED いいねをつけていないページです。
52 NOT_MUTING 対象となるユーザーをそもそもミュートしていません。
53 NOT_REACTED リアクションしていません。
54 NO_FOLLOW_REQUEST ユーザーからのフォローリクエストがありません。
55 NO_FREE_SPACE ドライブに空き容量がありません。
56 NO_POLL
57 NO_SUCH_AD
58 NO_SUCH_ANNOUNCEMENT お知らせが存在しません。
59 NO_SUCH_ANTENNA
60 NO_SUCH_APP アプリが存在しません。
61 NO_SUCH_AVATAR アバター画像のファイルが存在しません。
62 NO_SUCH_BANNER バナー画像のファイルが存在しません。
63 NO_SUCH_CHANNEL 指定されたチャンネルが存在しないか、アクセスが許可されていません。
64 NO_SUCH_CLIP
65 NO_SUCH_EMOJI
66 NO_SUCH_FILE ファイルが存在しません。
67 NO_SUCH_FOLDER フォルダーが存在しません。
68 NO_SUCH_GROUP
69 NO_SUCH_GROUP_MEMBER
70 NO_SUCH_HASHTAG ハッシュタグが存在しません。
71 NO_SUCH_INVITATION
72 NO_SUCH_LIST
73 NO_SUCH_MESSAGE
74 NO_SUCH_NOTE 指定されたノートが存在しないか、アクセスが許可されていません。
75 NO_SUCH_NOTIFICATION 通知が存在しません。
76 NO_SUCH_OBJECT
77 NO_SUCH_PAGE ページが存在しません。
78 NO_SUCH_PARENT_FOLDER 親フォルダーが存在しません。
79 NO_SUCH_POST
80 NO_SUCH_RENOTE_TARGET Renoteに指定されたノートが存在しないか、アクセスが許可されていません。
81 NO_SUCH_REPLY_TARGET 返信先に指定されたノートが存在しないか、アクセスが許可されていません。
82 NO_SUCH_SESSION セッションが存在しません。
83 NO_SUCH_USER ユーザーが存在しません。
84 NO_SUCH_USER_GROUP
85 NO_SUCH_USER_LIST
86 NO_SUCH_WEBHOOK Webhookが存在しません。
87 PENDING_SESSION
88 PERMISSION_DENIED 与えられたクレデンシャルには必要なパーミッションがありません。
89 PIN_LIMIT_EXCEEDED これ以上ピン留めできません。
90 RATE_LIMIT_EXCEEDED レートリミットによる制限のため一時的に利用できません。
91 REACTIONS_NOT_PUBLIC リアクションが公開されていません。
92 RECIPIENT_IS_YOURSELF
93 STL_DISABLED ソーシャルタイムラインが無効になっています。
94 YOUR_ACCOUNT_SUSPENDED アカウントが凍結されているため利用できません。
95 YOUR_PAGE 自身のページにいいねをつけようとしました。
96 YOUR_POST
97 YOU_ARE_OWNER
98 YOU_HAVE_BEEN_BLOCKED ブロックされているユーザーのノートにリアクションは行えません。

@ -23,6 +23,7 @@ class OpenAPIPath(TypedDict):
tags: list[str]
security: list[dict[str, list[Any]]]
requestBody: OpenAPIRequestBody
responses: dict[str, Any]
class OpenAPIComponentProperty(TypedDict):
@ -44,5 +45,5 @@ class OpenAPI(TypedDict):
openapi: str
info: OpenAPIInfo
externalDocs: OpenAPIExternalDocs
paths: dict[str, dict[Literal['post', 'get'], OpenAPIPath]]
paths: dict[str, dict[Literal["post", "get"], OpenAPIPath]]
components: OpenAPIComponents

@ -2,388 +2,524 @@ from .base import APIError
class AccessDeniedError(APIError):
"""アクセス権限がありません。"""
"""Access denied."""
class AlreadyAddedError(APIError):
""" """
"""That user has already been added to that list."""
class AlreadyBlockingError(APIError):
"""すでにブロックしています。"""
"""You are already blocking that user."""
class AlreadyClippedError(APIError):
""" """
"""The note has already been clipped."""
class AlreadyEndedError(APIError):
"""That game has already ended."""
class AlreadyExpiredError(APIError):
""" """
"""The poll is already expired."""
class AlreadyFavoritedError(APIError):
"""既にお気に入り登録されています。"""
"""You have not favorited the list."""
class AlreadyFollowingError(APIError):
"""すでにフォローしています。"""
"""You are already following that user."""
class AlreadyInvitedError(APIError):
""" """
class AlreadyLikedError(APIError):
"""The flash has already been liked."""
class AlreadyLikedError(APIError):
"""すでにいいねをつけています。"""
class AlreadyMovedError(APIError):
"""Account was already moved to another account."""
class AlreadyMutingError(APIError):
"""すでにそのユーザーをミュートしています。"""
"""You are already muting that user."""
class AlreadyPinnedError(APIError):
"""指定されたノートは既にピン留めされています。"""
"""That note has already been pinned."""
class AlreadyPromotedError(APIError):
""" """
"""The note has already promoted."""
class AlreadyReactedError(APIError):
"""既にリアクションしています。"""
"""You are already reacting to that note."""
class AlreadyVotedError(APIError):
""" """
"""You have already voted."""
class AuthenticationFailedError(APIError):
"""Authentication failed. Please ensure your token is correct."""
class AvatarNotAnImageError(APIError):
"""アバター画像に、画像ではないファイルが指定されました。"""
"""The file specified as an avatar is not an image."""
class BannerNotAnImageError(APIError):
"""バナー画像に、画像ではないファイルが指定されました。"""
"""The file specified as a banner is not an image."""
class BirthdayDateFormatInvalidError(APIError):
"""Birthday date format is invalid."""
class BlockedError(APIError):
"""ユーザーにブロックされています。"""
"""You are blocked by that user."""
class BlockeeIsYourselfError(APIError):
"""自分のブロックを解除しようとしました。"""
"""Blockee is yourself."""
class BlockingError(APIError):
"""ユーザーをブロックしています。"""
"""You are blocking that user."""
class BothWithRepliesAndWithFilesError(APIError):
"""Specifying both withReplies and withFiles is not supported"""
class CannotCreateAlreadyExpiredPollError(APIError):
"""アンケートの期限の指定が誤っています。"""
"""Poll is already expired."""
class CannotRenoteDueToVisibilityError(APIError):
"""You can not Renote due to target visibility."""
class CannotRenoteOutsideOfChannelError(APIError):
"""Cannot renote outside of channel."""
class CannotRenoteToAPureRenoteError(APIError):
"""単純なRenoteを再度Renoteすることはできません。"""
"""You can not Renote a pure Renote."""
class CannotReplyToAnInvisibleNoteError(APIError):
"""You cannot reply to an invisible Note."""
class CannotReplyToAPureRenoteError(APIError):
"""単純なRenoteに返信することはできません。"""
"""You can not reply to a pure Renote."""
class CannotReportTheAdminError(APIError):
"""管理者を通報しようとしました。"""
"""Cannot report the admin."""
class CannotReportYourselfError(APIError):
"""自身を通報しようとしました。"""
"""Cannot report yourself."""
class ContentRequiredError(APIError):
""" """
class CanNotDeleteInviteCodeError(APIError):
"""You can't delete this invite code."""
class CredentialRequiredError(APIError):
"""クレデンシャル必須のエンドポイントにクレデンシャル無しでリクエストされました。"""
"""Credential required."""
class DestinationAccountForbidsError(APIError):
"""Destination account doesn't have proper 'Known As' alias, or has already moved."""
class DuplicateNameError(APIError):
"""Duplicate name."""
class EmptyFileError(APIError):
"""That file is empty."""
class ExceededLimitOfCreateInviteCodeError(APIError):
"""You have exceeded the limit for creating an invitation code."""
class ExtResourceHashDidntMatchError(APIError):
"""Hash did not match."""
class ExtResourceReturnedInvalidSchemaError(APIError):
"""External resource returned invalid schema."""
class FailedToResolveRemoteUserError(APIError):
"""リモートユーザーの検索に失敗しました。"""
"""Failed to resolve remote user."""
class FolloweeIsYourselfError(APIError):
"""自分のフォローを解除しようとしました。"""
"""Followee is yourself."""
class FollowerIsYourselfError(APIError):
"""自分をフォロワー解除しようとしました。"""
"""Follower is yourself."""
class FollowRequestNotFoundError(APIError):
"""フォローリクエストがありません。"""
"""Follow request not found."""
class ForbiddenError(APIError):
""" """
"""Forbidden."""
class GroupAccessDeniedError(APIError):
""" """
class ForbiddenToSetYourselfError(APIError):
"""You can't set yourself as your own alias."""
class GtlDisabledError(APIError):
"""グローバルタイムラインが無効になっています。"""
"""Global timeline has been disabled."""
class HasChildFilesOrFoldersError(APIError):
"""フォルダーが空ではありません。"""
"""This folder has child files or folders."""
class InappropriateError(APIError):
"""不適切なコンテンツを含んでいる可能性があると判定されました。"""
"""Cannot upload the file because it has been determined that it possibly contains inappropriate content."""
class IncorrectPasswordError(APIError):
"""Incorrect password."""
class InternalErrorError(APIError):
"""サーバー内部で問題が発生しました。引き続き問題が発生する場合は管理者にお問い合わせください。"""
"""Internal error occurred. Please contact us if the error persists."""
class InvalidChoiceError(APIError):
""" """
"""Choice ID is invalid."""
class InvalidDateTimeError(APIError):
"""Invalid date-time format"""
class InvalidFileNameError(APIError):
"""ファイル名が不正です。"""
"""Invalid file name."""
class InvalidParamError(APIError):
"""リクエストパラメータに誤りがあります。"""
"""Invalid param."""
class InvalidRegexpError(APIError):
"""正規表現が不正です。"""
"""Invalid Regular Expression."""
class InvalidUrlError(APIError):
""" """
class InvalidSeedError(APIError):
"""Provided seed is invalid."""
class IsOwnerError(APIError):
""" """
class InvalidUrlError(APIError):
"""Invalid URL"""
class LtlDisabledError(APIError):
"""ローカルタイムラインが無効になっています。"""
class IAmAiError(APIError):
"""You sent a request to Ai-chan, Misskey's showgirl, instead of the server."""
class MoSuchFileError(APIError):
""" """
class LtlDisabledError(APIError):
"""Local timeline has been disabled."""
class MuteeIsYourselfError(APIError):
"""自分に対してミュートを解除しようとしました。"""
"""Mutee is yourself."""
class NameAlreadyExistsError(APIError):
"""同じURLにページがすでに存在します。"""
"""Specified name already exists."""
class NotAssignedError(APIError):
"""Not assigned."""
class NotBlockingError(APIError):
"""ブロックしていないユーザーです。"""
"""You are not blocking that user."""
class NotFavoritedError(APIError):
"""お気に入り登録されていません。"""
"""You have not marked that note a favorite."""
class NotFollowingError(APIError):
"""ユーザーにフォローされていません。"""
"""The other use is not following you."""
class NotLikedError(APIError):
"""いいねをつけていないページです。"""
"""You have not liked that flash."""
class NotMutingError(APIError):
"""対象となるユーザーをそもそもミュートしていません。"""
"""You are not muting that user."""
class NotReactedError(APIError):
"""リアクションしていません。"""
"""You are not reacting to that note."""
class NotRootForbiddenError(APIError):
"""The root can't migrate."""
class NoFollowRequestError(APIError):
"""ユーザーからのフォローリクエストがありません。"""
"""No follow request."""
class NoFreeSpaceError(APIError):
"""ドライブに空き容量がありません。"""
"""Cannot upload the file because you have no free space of drive."""
class NoPollError(APIError):
""" """
"""The note does not attach a poll."""
class NoSecurityKeyError(APIError):
"""No security key."""
class NoSuchAdError(APIError):
""" """
"""No such ad."""
class NoSuchAnnouncementError(APIError):
"""お知らせが存在しません。"""
"""No such announcement."""
class NoSuchAntennaError(APIError):
""" """
"""No such antenna."""
class NoSuchAppError(APIError):
"""アプリが存在しません。"""
"""No such app."""
class NoSuchAvatarError(APIError):
"""アバター画像のファイルが存在しません。"""
"""No such avatar file."""
class NoSuchBannerError(APIError):
"""バナー画像のファイルが存在しません。"""
"""No such banner file."""
class NoSuchChannelError(APIError):
"""指定されたチャンネルが存在しないか、アクセスが許可されていません。"""
"""No such channel."""
class NoSuchClipError(APIError):
""" """
"""No such clip."""
class NoSuchEmojiError(APIError):
""" """
"""No such emoji."""
class NoSuchFileError(APIError):
"""ファイルが存在しません。"""
"""No such file."""
class NoSuchFolderError(APIError):
"""フォルダーが存在しません。"""
class NoSuchFlashError(APIError):
"""No such flash."""
class NoSuchGroupError(APIError):
""" """
class NoSuchFolderError(APIError):
"""No such folder."""
class NoSuchGroupMemberError(APIError):
""" """
class NoSuchGameError(APIError):
"""No such game."""
class NoSuchHashtagError(APIError):
"""ハッシュタグが存在しません。"""
"""No such hashtag."""
class NoSuchInvitationError(APIError):
""" """
class NoSuchInviteCodeError(APIError):
"""No such invite code."""
class NoSuchListError(APIError):
""" """
class NoSuchKeyError(APIError):
"""No such key."""
class NoSuchMessageError(APIError):
""" """
class NoSuchListError(APIError):
"""No such list."""
class NoSuchNoteError(APIError):
"""指定されたノートが存在しないか、アクセスが許可されていません。"""
class NoSuchNotificationError(APIError):
"""通知が存在しません。"""
"""No such note."""
class NoSuchObjectError(APIError):
""" """
"""No such object."""
class NoSuchPageError(APIError):
"""ページが存在しません。"""
"""No such page."""
class NoSuchParentFolderError(APIError):
"""親フォルダーが存在しません。"""
"""No such parent folder."""
class NoSuchPostError(APIError):
""" """
"""No such post."""
class NoSuchRegistrationError(APIError):
"""No such registration."""
class NoSuchRenoteTargetError(APIError):
"""Renoteに指定されたートが存在しないか、アクセスが許可されていません。"""
"""No such renote target."""
class NoSuchReplyTargetError(APIError):
"""返信先に指定されたノートが存在しないか、アクセスが許可されていません。"""
"""No such reply target."""
class NoSuchSessionError(APIError):
"""セッションが存在しません。"""
class NoSuchRoleError(APIError):
"""No such role."""
class NoSuchUserError(APIError):
"""ユーザーが存在しません。"""
class NoSuchSessionError(APIError):
"""No such session."""
class NoSuchUserGroupError(APIError):
""" """
class NoSuchUserError(APIError):
"""No such user."""
class NoSuchUserListError(APIError):
""" """
"""No such user list."""
class NoSuchWebhookError(APIError):
"""Webhookが存在しません。"""
"""No such webhook."""
class PendingSessionError(APIError):
""" """
class PermissionDeniedError(APIError):
"""与えられたクレデンシャルには必要なパーミッションがありません。"""
"""This session is not completed yet."""
class PinLimitExceededError(APIError):
"""これ以上ピン留めできません。"""
"""You can not pin notes any more."""
class RateLimitExceededError(APIError):
"""レートリミットによる制限のため一時的に利用できません。"""
"""Rate limit exceeded. Please try again later."""
class ReactionsNotPublicError(APIError):
"""リアクションが公開されていません。"""
"""Reactions of the user is not public."""
class RecursiveNestingError(APIError):
"""It can not be structured like nesting folders recursively."""
class RemoteUserNotAllowedError(APIError):
"""Not allowed to load the remote user's list"""
class RecipientIsYourselfError(APIError):
""" """
class RestrictedByRoleError(APIError):
"""This feature is restricted by your role."""
class SameNameEmojiExistsError(APIError):
"""Emoji that have same name already exists."""
class StlDisabledError(APIError):
"""ソーシャルタイムラインが無効になっています。"""
"""Hybrid timeline has been disabled."""
class YourAccountSuspendedError(APIError):
"""アカウントが凍結されているため利用できません。"""
class TargetIsYourselfError(APIError):
"""Target user is yourself."""
class YourPageError(APIError):
"""自身のページにいいねをつけようとしました。"""
class TooBigFileError(APIError):
"""That file is too big."""
class YourPostError(APIError):
""" """
class TooManyAntennasError(APIError):
"""You cannot create antenna any more."""
class TooManyClipsError(APIError):
"""You cannot create clip any more."""
class TooManyClipNotesError(APIError):
"""You cannot add notes to the clip any more."""
class TooManyMutedWordsError(APIError):
"""Too many muted words."""
class TooManyUserlistsError(APIError):
"""You cannot create user list any more."""
class YouAreOwnerError(APIError):
""" """
class TooManyUsersError(APIError):
"""You can not push users any more."""
class TooManyWebhooksError(APIError):
"""You cannot create webhook any more."""
class TwoFactorNotEnabledError(APIError):
"""2fa not enabled."""
class UnavailableError(APIError):
"""Translate of notes unavailable."""
class UnexpectedFileTypeError(APIError):
"""We need csv file."""
class UriNullError(APIError):
"""Local User ActivityPup URI is null."""
class UserIsDeletedError(APIError):
"""User is deleted."""
class UserNotFoundError(APIError):
"""User not found."""
class YourFlashError(APIError):
"""You cannot like your flash."""
class YourPageError(APIError):
"""You cannot like your page."""
class YourPostError(APIError):
"""You cannot like your post."""
class YouHaveBeenBlockedError(APIError):
"""ブロックされているユーザーのノートにリアクションは行えません。"""
"""You cannot push this user because you have been blocked by this user."""

Loading…
Cancel
Save