File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using DiscordRPC ;
2+ using DiscordRPC . Logging ;
3+ using YukkuriMovieMaker . Plugin ;
4+
5+ namespace YmmRPC
6+ {
7+ [ PluginDetails ( AuthorName = "namakemono-san" , ContentId = "" ) ]
8+ public class YmmRpcPlugin : IPlugin
9+ {
10+ public string Name => "YMM-RPC" ;
11+
12+ static YmmRpcPlugin ( )
13+ {
14+ var client = new DiscordRpcClient ( "1353376132732420136" ) ;
15+
16+ client . Logger = new ConsoleLogger ( ) { Level = LogLevel . Warning } ;
17+
18+ client . OnReady += ( sender , e ) =>
19+ {
20+ Console . WriteLine ( "Received Ready from user {0}" , e . User . Username ) ;
21+ } ;
22+
23+ client . OnPresenceUpdate += ( sender , e ) =>
24+ {
25+ Console . WriteLine ( "Received Update! {0}" , e . Presence ) ;
26+ } ;
27+
28+ client . Initialize ( ) ;
29+
30+ // TODO: 作業内容を表示したい。
31+ client . SetPresence ( new RichPresence ( )
32+ {
33+ Assets = new Assets ( )
34+ {
35+ LargeImageKey = "icon" ,
36+ LargeImageText = "YMM-RPC v0.1.0"
37+ }
38+ } ) ;
39+ }
40+ }
41+ }
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <TargetFramework >net9.0-windows10.0.19041.0</TargetFramework >
5+ <UseWPF >true</UseWPF >
6+ <RootNamespace >YmmRPC</RootNamespace >
7+ <ImplicitUsings >enable</ImplicitUsings >
8+ <Nullable >enable</Nullable >
9+ </PropertyGroup >
10+
11+ <ItemGroup >
12+ <Reference Include =" YukkuriMovieMaker.Plugin" HintPath =" ..\..\libs\YukkuriMovieMaker.Plugin.dll" Private =" true" />
13+ <Reference Include =" YukkuriMovieMaker.Controls" HintPath =" ..\..\libs\YukkuriMovieMaker.Controls.dll" Private =" true" />
14+ </ItemGroup >
15+
16+ <ItemGroup >
17+ <PackageReference Include =" DiscordRichPresence" Version =" 1.2.1.24" />
18+ </ItemGroup >
19+
20+ </Project >
You can’t perform that action at this time.
0 commit comments