Skip to content

Commit

Permalink
[OneBot] Changed pattern of ignore self message
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Feb 12, 2024
1 parent d74d08b commit 2fb8770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.OneBot/Core/Message/MessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ private void OnFriendMessageReceived(BotContext bot, FriendMessageEvent e)

private void OnGroupMessageReceived(BotContext bot, GroupMessageEvent e)
{
if (_config.GetValue<bool>("Message:IgnoreSelf") && e.Chain.FriendUin == bot.BotUin) return; // ignore self message

var record = (MessageRecord)e.Chain;
_context.GetCollection<MessageRecord>().Insert(new BsonValue(record.MessageHash), record);

if (_config.GetValue<bool>("Message:IgnoreSelf") && e.Chain.FriendUin == bot.BotUin) return; // ignore self message

var segments = Convert(e.Chain);
var request = new OneBotGroupMsg(bot.BotUin, e.Chain.GroupUin ?? 0, segments, ToRawMessage(segments),
Expand Down

0 comments on commit 2fb8770

Please sign in to comment.