Skip to content

Commit

Permalink
[OneBot] Use uin from BotContext(虽然可能会导致更多问题)
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Nov 11, 2023
1 parent 003cb8e commit 0ad7633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Lagrange.OneBot/Core/Network/LagrangeWebSvcCollection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Lagrange.Core;
using Lagrange.OneBot.Core.Network.Service;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
Expand All @@ -11,9 +12,9 @@ public class LagrangeWebSvcCollection : Dictionary<string, ILagrangeWebService>,

public event EventHandler<MsgRecvEventArgs> OnMessageReceived = delegate { };

public LagrangeWebSvcCollection(IConfiguration global, ILogger<LagrangeApp> logger)
public LagrangeWebSvcCollection(BotContext context, IConfiguration global, ILogger<LagrangeApp> logger)
{
uint uin = global.GetValue<uint>("Account:Uin");
uint uin = context.BotUin;

if (global.GetSection("Implementations").Exists())
{
Expand Down
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Network/Service/ReverseWSService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ReverseWSService(IConfiguration config, ILogger<LagrangeApp> logger, uint
SetRequestHeader(socket, new Dictionary<string, string>
{
{ "X-Client-Role", "Universal" },
{ "X-Self-ID", Config.GetValue<uint>("Account:Uin").ToString() },
{ "X-Self-ID", uin.ToString() },
{ "User-Agent", Constant.OneBotImpl }
});
socket.Options.KeepAliveInterval = TimeSpan.FromSeconds(5);
Expand Down

0 comments on commit 0ad7633

Please sign in to comment.