Skip to content

Instantly share code, notes, and snippets.

@OmegaV1105
Forked from steve02081504/_main.md
Last active February 22, 2022 10:47
Show Gist options
  • Save OmegaV1105/4694b850ae6c78ae888dc90611334342 to your computer and use it in GitHub Desktop.
Save OmegaV1105/4694b850ae6c78ae888dc90611334342 to your computer and use it in GitHub Desktop.
How to get your ghost to support Discord Rich Presence

步骤1:
前往discord app开发面板新建app
图片 步骤2:
填写app名称
图片 上传Discord Rich Presence所需资源
图片 步骤3:
安装或更新Discord Rich Presence PLUGIN到至少1.1.2.1
步骤4:
让你的ghost对OnDiscordPluginCustom[Notify]OnDiscordPluginCustomEnd[Notify]进行反应
这两个事件是Notify,因为如果它们是GET会打断ghost的启动/终止对话
但是你应当保证你的ghost在OnDiscordPluginCustom发生后用以下方式更新Discord Rich Presence的内容,并且在OnDiscordPluginCustomEnd发生后不再对Discord Rich Presence内容进行更新
你可以通过

OnDiscordPluginCustomAppid
OnDiscordPluginCustomState
OnDiscordPluginCustomDetail
OnDiscordPluginCustomLargeImageKey
OnDiscordPluginCustomLargeImageText
OnDiscordPluginCustomSmallImageKey
OnDiscordPluginCustomSmallImageText
OnDiscordPluginCustomALL

以上任何事件更新Discord Rich Presence的内容,例子如下
\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomALL,902362898960117830,,,kikka_eye_open,github.com/Taromati2,]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageKey,"simple_hollow_red_heart"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageText,"Developer"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomDetail,"发呆。"]\0\s[0]好的,Discord个人资料已经更新了\n 图片
除了OnDiscordPluginCustomALL,其他任何事件都是只会对第一个参数作出反应的事件
OnDiscordPluginCustomALL接受的参数依次为AppidCustomDetailCustomStateLargeImageKeyLargeImageTextSmallImageKeySmallImageText
步骤5:
丰富ghost的反应
你可以在任何时间更新你的ghost的Discord Rich Presence,比如最小化时
图片
被抚摸时
图片
有时你还可以在Discord Rich Presence中附加更多信息,比如如果你的ghost有音乐播放功能,你可以在Discord Rich Presence中展现现在正在听的歌曲
图片
或者你的ghost有小游戏功能,你可以在玩游戏时更新Discord Rich Presence中显示的分数
图片
能做的事情很多,而你只需要使用raiseplugin就好

Step 1.
Go to the discord app development panel to create a new app
image Step 2.
Fill in the app name
image Upload the required resources for Discord Rich Presence
Image Step 3.
Install or update Discord Rich Presence PLUGIN to at least 1.1.2.1
Step 4.
Get your ghost to react to OnDiscordPluginCustom[Notify] and OnDiscordPluginCustomEnd[Notify]
These two events are Notify, because if they were GET they would interrupt the start/end conversation of ghost
But you should ensure that your ghost updates the contents of the Discord Rich Presence after OnDiscordPluginCustom occurs with the following, and that it does not update the contents of the Discord Rich Presence after OnDiscordPluginCustomEnd occurs
You can update the contents of a Discord Rich Presence with

OnDiscordPluginCustomAppid
OnDiscordPluginCustomState
OnDiscordPluginCustomDetail
OnDiscordPluginCustomLargeImageKey
OnDiscordPluginCustomLargeImageText
OnDiscordPluginCustomSmallImageKey
OnDiscordPluginCustomSmallImageText
OnDiscordPluginCustomALL

Any of the above events update the contents of the Discord Rich Presence, examples are as follows
\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomALL,902362898960117830,,,kikka_eye_open,github.com/Taromati2,]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageKey,"simple_hollow_red_heart"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageText,"Developer"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomDetail,"Daze."]\0\s[0]Okay.The Discord profile has been updated\n Image
Any event other than OnDiscordPluginCustomALL is an event that only reacts to the first parameter
and OnDiscordPluginCustomALL accepts the parameters Appid, CustomDetail, CustomState, LargeImageKey, LargeImageText, SmallImageKey, SmallImageText
Step 5.
Enriching ghost's response
You can update your ghost's Discord Rich Presence at any time, for example when minimized
image
When being stroked
Image
Sometimes you can also attach more information to the Discord Rich Presence, for example if your ghost has music player function, you can show the listening song in the Discord Rich Presence
image
Or if your ghost has a mini-game function, you can update the score displayed in Discord Rich Presence while playing the game
image
There's a lot you can do, and all you need is use raiseplugin

ステップ1.
Discordのアプリ開発パネルにアクセスし、新規アプリを作成します。 image ステップ2.
アプリ名を入力します。
image Discord Rich Presenceに必要なリソースをアップロードします。
Image ステップ3.
Discord Rich Presence PLUGIN を 1.1.2.1 以降をインストールまたはアップデートしてください。
ステップ4.
OnDiscordPluginCustom[Notify]OnDiscordPluginCustomEnd[Notify] に反応するゴーストを取得する。
この2つのイベントはNotifyであり、もしGETであれば、ゴーストの開始と終了の会話を中断することになるからです。
ただし、OnDiscordPluginCustomが発生した後にあなたのゴーストがDiscord Rich Presenceの内容を次のように更新し、OnDiscordPluginCustomEndが発生した後にDiscord Rich Presenceの内容を更新しないようにする必要があります。 そしてDiscord Rich Presenceの内容を更新することができます。

OnDiscordPluginCustomAppid
OnDiscordPluginCustomState
OnDiscordPluginCustomDetail
OnDiscordPluginCustomLargeImageKey
OnDiscordPluginCustomLargeImageText
OnDiscordPluginCustomSmallImageKey
OnDiscordPluginCustomSmallImageText
OnDiscordPluginCustomALL

上記のいずれかのイベントが発生すると、Discord Rich Presenceの内容が更新されます。例としては、以下のようなものがあります。
\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomALL,902362898960117830,,,kikka_eye_open,github.com/Taromati2,]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageKey,"simple_hollow_red_heart"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomSmallImageText,"Developer"]\![raiseplugin,Discord Rich Presence,OnDiscordPluginCustomDetail,"Daze."]\0\s[0]Okay.The Discord profile has been updated\n Image
OnDiscordPluginCustomALL 以外のイベントは、最初のパラメーターにのみ反応するイベントです。
OnDiscordPluginCustomALL は、パラメータ AppidCustomDetailCustomStateLargeImageKeyLargeImageTextSmallImageKeyLargeImageTextSmallImageKeySmallImageTextを受け付けます。
ステップ5.
ゴーストの反応を豊かにする
ゴーストの Discord Rich Presence は、最小化したときなど、いつでも更新することができます。
image
撫でられる時
Image
例えば、あなたのゴーストが音楽を流している場合、今聴いている曲を Discord Rich Presence に表示することができます。
image
また、ゴーストにミニゲーム機能があれば、ゲームをプレイしながらDiscord Rich Presenceに表示されるスコアを更新することができます。
image
できることはたくさんあり、必要なのはraisepluginを使うことです。

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