Skip to content

Commit

Permalink
feat(plugins/qqstatplugin/): 依赖KonataPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Jan 14, 2023
1 parent 2f92295 commit 3a71964
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
11 changes: 5 additions & 6 deletions plugins/QQStatPlugin/QQStatPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
using Konata.Core;
using Konata.Core.Events.Model;
using Konata.Core.Interfaces.Api;
using QQBotHub.Sdk.IPlugins;
using QQStatPlugin.Utils;
using Konata.Core.Message.Model;
using Konata.Core.Common;
using System.Text;
using QQBotHub.Sdk;
using Konata.Core.Message;
using System.Collections.Generic;
using KonataPlugin;

namespace QQStatPlugin
{
Expand Down Expand Up @@ -201,21 +200,21 @@ public async Task ExecuteAsync()
try
{
SettingsModel settingsModel = PluginCore.PluginSettingsModelFactory.Create<SettingsModel>(nameof(QQStatPlugin));
if (QQBotStore.Bot != null && QQBotStore.Bot.IsOnline())
if (KonataBotStore.Bot != null && KonataBotStore.Bot.IsOnline())
{
var groupList = await QQBotStore.Bot.GetGroupList(forceUpdate: true);
var groupList = await KonataBotStore.Bot.GetGroupList(forceUpdate: true);
foreach (var group in groupList)
{
if (settingsModel.ChartGroups.Contains(group.Uin.ToString()))
{
SendStackedArea((QQBotStore.Bot, null), message: "#折线", groupUin: group.Uin, settingsModel: settingsModel);
SendStackedArea((KonataBotStore.Bot, null), message: "#折线", groupUin: group.Uin, settingsModel: settingsModel);

List<BaseChain> baseChains = new List<BaseChain>()
{
TextChain.Create("发送 #帮助 获取更多信息")
};

await QQBotStore.Bot.SendGroupMessage(groupUin: group.Uin, baseChains.ToArray());
await KonataBotStore.Bot.SendGroupMessage(groupUin: group.Uin, baseChains.ToArray());
}
}

Expand Down
11 changes: 1 addition & 10 deletions plugins/QQStatPlugin/QQStatPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@
</PackageReference>-->
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.115.5" />
</ItemGroup>

<!-- 方便开发debug,与发布到nuget -->
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="QQBotHub.Sdk" Version="0.1.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<ProjectReference Include="..\..\src\QQBotHub.Sdk\QQBotHub.Sdk.csproj">
<ProjectReference Include="..\KonataPlugin\KonataPlugin.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
Expand Down
2 changes: 1 addition & 1 deletion plugins/QQStatPlugin/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"DisplayName": "QQ消息统计分析",
"Description": "QQ消息等数据收集, 分析",
"Author": "yiyun",
"Version": "0.4.0",
"Version": "1.0.0",
"SupportedVersions": [ "0.0.1" ]
}

0 comments on commit 3a71964

Please sign in to comment.