fix: return exception when no admin/mod

This commit is contained in:
sim1222 2022-11-12 00:29:22 +09:00
parent 63b53b5096
commit b54127eaa2
No known key found for this signature in database
GPG Key ID: 04EF48D01BEB0298

View File

@ -14,6 +14,11 @@ export async function openReactionImportMenu(ev: MouseEvent, reaction: string):
const isCustom = reaction.startsWith(':');
const getEmojiObject = (emojiId): Promise<Record<string, any> | null> => new Promise<Record<string, any> | null>(async resolve => {
if (!($i?.isAdmin || $i?.isModerator)) {
resolve(null);
return;
}
const sinceId = await os.api('admin/emoji/list', {
limit: 1,
untilId: emojiId.id,