Skip to content

Instantly share code, notes, and snippets.

@ltlapy
Last active March 2, 2024 16:03
Show Gist options
  • Save ltlapy/8ee9b9821d0022e8dc7203dfa40ccfae to your computer and use it in GitHub Desktop.
Save ltlapy/8ee9b9821d0022e8dc7203dfa40ccfae to your computer and use it in GitHub Desktop.
Misskey의 모든 이모지에 설정된 로컬 전용을 해제
/// @ 0.15.0
// ***실행 전 API 제한을 해제할 것(0%)***
var Emojis = []
var LastFetchedId = 'zzzzzzzzzzzzzzzzzzzzz'
<: '이모지 가져오는 중...'
loop {
let res = Mk:api("admin/emoji/list", {
allowPartial: true
limit: 30
untilId: LastFetchedId
})
if (res.len == 0) break
Emojis = Emojis.concat(res)
LastFetchedId = res[res.len - 1].id
if (Emojis.len % 300 == 0) {
<: `{Emojis.len} 개 가져왔습니다. 계속해서 탐색합니다...`
}
}
<: `확정: {Emojis.len}개`
// Mk:save('adminEmojis', Emojis)
// Emojis = Mk:load('adminEmojis')
<: '로컬 한정 이모지를 찾습니다...'
let LocalEmojis = []
each(let emoji, Emojis) {
if (emoji.localOnly == true) {
LocalEmojis.push(emoji)
}
}
<: `{LocalEmojis.len} 개의 이모지가 로컬 한정입니다.`
each(let emoji, LocalEmojis) {
<: `{emoji.id}: {emoji.name}`
emoji.localOnly = false
Mk:api('admin/emoji/update', emoji)
}
<: '완료'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment