Skip to content

Instantly share code, notes, and snippets.

@salano-ym
Last active October 24, 2023 09:37
Show Gist options
  • Save salano-ym/8d128649391d59fb0e4c942c5557328e to your computer and use it in GitHub Desktop.
Save salano-ym/8d128649391d59fb0e4c942c5557328e to your computer and use it in GitHub Desktop.
Misskeyプラグイン AiScript0.12.4移植版

Misskeyプラグイン AiScript0.12.4移植版

説明

Misskey Plugins & CSS (By HiSubway)に載ってるMisskeyプラグインをAiScript0.12.4用に移植しました。 動作チェックは全部したわけではないので動かなかったらすみません。 Plugin:register_note_post_interruptorにバグがあるっぽいのでこれを使っているものは動かないかも…… バグ報告とかは@salano_ym@misskey.ioまでお願いします。

プラグイン

(๑❛ㅿ❛๑)۶よっ

出典

ソースコード
/// @ 0.12.4
### {
  name: "(๑❛ㅿ❛๑)۶よっ (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: syuilo)"
  description: "ノートメニューから、投稿者に対する (๑❛ㅿ❛๑)۶よっ を投稿します"
  permissions: ["write:notes"]
}

Plugin:register_note_action("(๑❛ㅿ❛๑)۶よっ" @(note) {
  Mk:api("notes/create" {
    text: `あ{note.user.name}さんだ(๑❛ㅿ❛๑)۶よっ`
  })
})

anti twitter.misskey.dev

出典

ソースコード
/// @ 0.12.4
### {
  name: "anti twitter.misskey.dev (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: Ebise Lutica)"
  description: "twitter.misskey.dev → twitter.com"
  permissions: []
  config: null
}

Plugin:register_note_view_interruptor(@(note) {
  if note.text != null {
    note.text = note.text.replace("twitter.misskey.dev" "twitter.com")
  }
  if !((note.renote == null) || (note.renote.text == null)) {
    note.renote.text = note.renote.text.replace("twitter.misskey.dev" "twitter.com")
  }
  if !((note.reply == null) || (note.reply.text == null)) {
    note.reply.text = note.reply.text.replace("twitter.misskey.dev" "twitter.com")
  }
  note
})

Catify

出典

https://github.com/saki-lere/Misskey-Extras/blob/master/plugins/catify.plugin

DeepL Translate

出典

https://github.com/saki-lere/Misskey-Extras/blob/master/plugins/deepl-translate.plugin

Denyanify

出典

https://github.com/saki-lere/Misskey-Extras/blob/master/plugins/de-nyanify.aiscript

𝑭𝒖𝒄𝒌

出典

ソースコード
/// @ 0.12.4
### {
  id: "b227173c-21af-42e0-bcb6-681b71640245"
  name: "𝑭𝒖𝒄𝒌 (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: syuilo)"
  description: "𝑻𝒉𝒊𝒔 𝒑𝒍𝒖𝒈𝒊𝒏 𝒎𝒂𝒌𝒆𝒔 𝒚𝒐𝒖𝒓 𝒏𝒐𝒕𝒆'𝒔 𝒕𝒆𝒙𝒕 𝒕𝒐 𝒇𝒖𝒄𝒌𝒊𝒏 𝒆𝒍𝒆𝒈𝒂𝒏𝒕"
}

@main() {
  Mk:register_post_form_action("𝑭𝒖𝒄𝒌" @(form update) {
    let text = form.text.replace("A", "𝑨").replace("a", "𝒂").replace("B", "𝑩").replace("b", "𝒃").replace("C", "𝑪").replace("c", "𝒄").replace("D", "𝑫").replace("d", "𝒅").replace("E", "𝑬").replace("e", "𝒆").replace("F", "𝑭").replace("f", "𝒇").replace("G", "𝑮").replace("g", "𝒈").replace("H", "𝑯").replace("h", "𝒉").replace("I", "𝑰").replace("i", "𝒊").replace("J", "𝑱").replace("j", "𝒋").replace("K", "𝑲").replace("k", "𝒌").replace("L", "𝑳").replace("l", "𝒍").replace("M", "𝑴").replace("m", "𝒎").replace("N", "𝑵").replace("n", "𝒏").replace("O", "𝑶").replace("o", "𝒐").replace("P", "𝑷").replace("p", "𝒑").replace("Q", "𝑸").replace("q", "𝒒").replace("R", "𝑹").replace("r", "𝒓").replace("S", "𝑺").replace("s", "𝒔").replace("T", "𝑻").replace("t", "𝒕").replace("U", "𝑼").replace("u", "𝒖").replace("V", "𝑽").replace("v", "𝒗").replace("W", "𝑾").replace("w", "𝒘").replace("X", "𝑿").replace("x", "𝒙").replace("Y", "𝒀").replace("y", "𝒚").replace("Z", "𝒁").replace("z", "𝒛")
    update("text" text)
  })
}

main()

Note MFM Toggle

出典

https://github.com/saki-lere/Misskey-Extras/blob/master/plugins/note-mfm-toggle.aiscript

SauceNao Image Search

出典

https://github.com/saki-lere/Misskey-Extras/blob/master/plugins/sauce-nao.aiscript

존함 - 게시용

出典

https://gist.github.com/saki-lere/46e539ef3ef47d41effd92a6131dba7b

あけおめ

出典

ソースコード
/// @ 0.12.4
### {
  name: "あけおめ (AS0.12.4版)"
  version: "2.0.7.7"
  author: "@salano_ym (Original: 𝐢)"
  description: ""
  permissions: []
  config: null
}

@random() {
  let exc = if (Math:rnd(1, 2) == 1) "!" else "!"
  let ex = Core:range(0 Math:rnd(0, 10)).map(@(v){ exc }).join("")
  match Math:rnd(1, 3) {
    1 => `あけおめ{ match Math:rnd(1, 3) { 1 => "です" 2 => "~" 3 => "" } }{ex}`
    2 => `あけましておめでとうございます{ex}`
    3 => `ことよろ~`
  }
}

@effect(note) {
  note.text = random()
  note
}

@handler(note_) {
  var note = effect(note_)
  if Obj:has(note, "renote") { note.renote = effect(note.renote) }
  if Obj:has(note, "reply") { note.reply = effect(note.reply) }
  note
}

Plugin:register_note_view_interruptor(handler)

いまのなし

出典

https://gist.github.com/saki-lere/a771ee15806dad19f1849955ac52ec4e#file-04_imanonashi-is

ノートするやつ全部「うんち!」

出典

ソースコード
/// @ 0.12.4
### {
  name: "ノートするやつ全部「うんち!」 (AS0.12.4版)"
  author:  "@salano_ym (Original: Midra)"
  version: "1.0.0"
  description: "タイトル通りです。"
  permission: []
  config: {
    post_unchi: {
      type: "boolean"
      label: "「うんち!」でノートする?"
    }
  }
}

@replaceUnchi(note) {
  if Plugin:config.post_unchi && Obj:has(note, "text") {
    Obj:set(note, "text", "うんち!")
  }
  note
}

Plugin:register_note_post_interruptor(replaceUnchi)

なくそう偏見

出典

ソースコード
/// @ 0.12.4
### {
  name: "なくそう偏見 (AS0.12.4版)"
  version: "1.0.1"
  author: "@salano_ym (Original: 𝐢)"
  description: ""
  permissions: []
  config: null
}

@delete_feature(note) {
  note.user.avatarUrl = `https:{"/"}{"/"}misskey.io/avatar/{note.user.id}`
  note.user.name = note.user.username
  note.createdAt = "2000-01-01T00:00:00.000Z"
  note.reactions = {}
  note.renoteCount = 0
  note.replyCount = 0
  note.visibility = "followers"
  note
}

@effect(note_) {
  var note = delete_feature(note_)
  if Obj:has(note, "renote") { note.renote = delete_feature(note.renote) }
  if Obj:has(note, "reply") { note.reply = delete_feature(note.reply) }
  note
}

Plugin:register_note_view_interruptor(effect)

なんでも実況M

出典

ソースコード
/// @ 0.12.4
### {
  name: "なんでも実況M (AS0.12.4版)"
  version: "1.0.2"
  author: "@salano_ym (Original: 𝐢)"
  description: ""
  permissions: []
  config: null
}

@effect(note) {
  if (note.text != null) {
    note.text = match Math:rnd(1, 5) {
      1 => `ワイ、{note.text}`
      2 => if Obj:has(note, "renote") `{note.text}やろ` else `{note.text}ンゴ`
      3 => if Obj:has(note, "renote") `{note.text}やぞ` else `{note.text}定期`
      4 => `{note.text}😭`
      5 => `なお{note.text}模様`
    }
  }
  note
}

Plugin:register_note_view_interruptor(effect)

パクるプラグイン

出典

https://gist.github.com/saki-lere/a771ee15806dad19f1849955ac52ec4e#file-01_pakuru-is

バズる

出典

ソースコード
/// @ 0.12.4
### {
  id: "10101010-0202-3456-aaaa-12344321abcd"
  name: "bazu (AS0.12.4版)"
  version: "1.0.0"
  author: "@salano_ym (Original: i)"
  description: "バズる"
  permissions: []
  config: null
}

@effect(note) {
  note.renoteCount = Math:rnd(1, 1000000)
  note
}

Plugin:register_note_view_interruptor(effect)

ピザプラグイン

出典

ソースコード
/// @ 0.12.4
###{
  id: "082df082-83ec-43d5-a894-a611c1082a91"
  name: "@ピザ (AS0.12.4版)"
  version: "1.0.0"
  author: "@salano_ym (Original: futchitwo)"
  description: "@ピザ"
  permissions: []
  config: {
    pizza_url: {
      type: "string"
      label: "ピザサイトのURL"
      default: "http://info.nicovideo.jp/pizza/"
    }
  }
}

@open_pizza_site(note){
  if Str:incl(note.text "@ピザ") Plugin:open_url(Plugin:config.pizza_url)
  elif Str:incl(note.text "@ピザ") Plugin:open_url(Plugin:config.pizza_url)
  note
}

Plugin:register_note_post_interruptor(open_pizza_site)

ほぼプレビュープラグイン

出典

ソースコード
/// @ 0.12.4
### {
  id: "7ffc037f-ba45-4072-86b2-fb9632ebf6ff"
  name: "ほぼプレビュー (AS0.12.4版)"
  version: "1.0.0"
  author:  "@salano_ym (Original: futchitwo)"
  description: "中央に寄るのは仕様です"
  permission: []
  config: {
    show_when_posting: {
      type: "boolean"
      label: "投稿時の確認表示"
    }
  }
}

@preview(note) {
  Mk:dialog("" note.text "")
  note
}

@preview_with_confirm(note) {
  if Mk:confirm("投稿確認" `{note.text}{Str:lf}この内容で投稿します`) {
    return note
  }
  null
}

Plugin:register_post_form_action("ほぼプレビュー" preview)
if Plugin:config.show_when_posting { 
  Plugin:register_note_post_interruptor(preview_with_confirm)
}

強制猫化プラグイン

出典

ソースコード
/// @ 0.12.4
### {
  id: "6586fbf9-800f-41b3-b4f6-fb094c2a9015"
  name: "強制猫化プラグイン (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: syuilo)"
  description: "強制的に猫にします"
  permissions: []
  config: null
}

Plugin:register_note_view_interruptor(@(note) {
  note.user.isCat = true
  if note.renote != null {
    note.renote.user.isCat = true
  }
  if note.reply != null {
    note.reply.user.isCat = true
  }
  note
})

強制非猫化プラグイン

出典

ソースコード
/// @ 0.12.4
### {
  id: "6586fbf9-800f-41b3-b4f6-fb094c2a9015"
  name: "強制非猫化プラグイン (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: syuilo)"
  description: "強制的に猫耳をちぎります"
  permissions: []
  config: null
}

Plugin:register_note_view_interruptor(@(note) {
  note.user.isCat = false
  if note.renote != null {
    note.renote.user.isCat = false
  }
  if note.reply != null {
    note.reply.user.isCat = false
  }
  note
})

香川タイマー

出典

ソースコード
/// @ 0.12.4
### {
  id: "4d396388-4ccf-480b-9909-1f0c2d419967"
  name: "香川タイマー (AS0.12.4版)"
  version: "1.0.0"
  author: "@salano_ym (Original: Xeltica)"
  description: "1時間経ったら警告します"
}

@handle() {
  Mk:dialog("1時間経過しました。", "お住まいの地域では条例に基づき、1時間以上のMisskey の使用を制限しています。ただちにこのタブを閉じてください。", "error")
}

Async:timeout(3600000, handle)

数字引用プラグイン

出典

https://gist.github.com/saki-lere/a771ee15806dad19f1849955ac52ec4e#file-02_numberquote-is

地震プラグイン

出典

ソースコード
/// @ 0.12.4
### {
  id: "19191919-9012-3456-aaaa-12344321abcd"
  name: "Earthquake (AS0.12.4版)"
  version: "1.0.0"
  author: "@salano_ym (Original: i)"
  description: ""
  permissions: []
  config: null
}

let L = 10000
@effect(note) {
  note.text = note.text.split().map(@(x) { `[shake.speed={(Math:floor((L * (Math:rnd() * 2))) / L)}s {x}]` }).join()
  note
}

@handler(note_) {
  var note = effect(note_)
  if Obj:has(note, "renote") { note.renote = effect(note.renote) }
  if Obj:has(note, "reply") { note.reply = effect(note.reply) }
  note
}

Json:stringify(Plugin:register_note_view_interruptor(handler))

投稿フォームに濁点を追加するボタンを追加するプラグイン

出典

ソースコード
/// @ 0.12.4
### {
  id: "5f9f1949-f245-4229-bfeb-6e01a53df984"
  name: "Example Plugin (AS0.12.4版)"
  version: "0.0.0"
  author: "@salano_ym (Original: syuilo)"
}

@main() {
  Mk:register_post_form_action("fujiwara" @(form update) {
    let text = `{form.text.split().join("゛")}゛`
    update("text" text)
  })
}

main()

投稿時刻を表示するプラグイン

出典

https://gist.github.com/saki-lere/a771ee15806dad19f1849955ac52ec4e#file-03_viewdate-is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment