Skip to content

Instantly share code, notes, and snippets.

@Hoto-Cocoa
Forked from ltlapy/timestamp_purge.aiscript
Last active March 28, 2024 14:12
Show Gist options
  • Save Hoto-Cocoa/c542e4b26f53349b24a06a1c300cb380 to your computer and use it in GitHub Desktop.
Save Hoto-Cocoa/c542e4b26f53349b24a06a1c300cb380 to your computer and use it in GitHub Desktop.
AiScript 모음
var lastId = '0000000000'
var emojis = []
loop {
let res = Mk:api('admin/emoji/list', {
limit: 100,
sinceId: lastId,
})
if (res.len == 0) break
emojis = emojis.concat(res)
lastId = emojis[emojis.len - 1].id
<: `{emojis.len}개의 이모지를 탐색했습니다. 계속해서 탐색합니다...`
}
<: `{emojis.len}개의 이모지를 탐색했습니다.`
Mk:api('admin/emoji/delete-bulk', {
ids: emojis.map(@(emoji) { emoji.id })
})
<: `{emojis.len}개의 이모지를 삭제했습니다.`
let host = 'misskey.kr'
var offset = 0
var accounts = []
<: `{host}의 계정을 탐색합니다...`
loop {
let res = Mk:api('admin/show-users', {
hostname: host,
limit: 30,
offset: offset,
sort: '+createdAt',
state: 'all'
})
if (res.len == 0) break
accounts = accounts.concat(res)
offset = offset + res.len
if ((offset % 100) == 0) {
<: `{offset}번째 계정을 탐색했습니다. 계속해서 탐색합니다... ({accounts.len})`
}
}
each(let account, accounts) {
Mk:api('admin/delete-account', {
userId: account.id
})
}
<: `{accounts.len}개의 계정 삭제 요청을 보냈습니다.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment