<commit_before>package Groups;

use strict;
use warnings;

sub new {
	my ($class, $myid) = @_;
	my $self = {myid => $myid, groups => []};
	bless $self, $class;
}

sub process {
	my ($self, $message) = @_;
	if (defined $message->{new_chat_participant}
			and $message->{new_chat_participant}->{id} eq $self->{myid}) {
		push @{$self->{groups}}, $message->{chat}->{id};
	} elsif (defined $message->{left_chat_participant}
			and $message->{left_chat_participant}->{id} eq $self->{myid}) {
		$self->{groups} = grep { $_ ne $message->{chat}->{id} } @{$self->{groups}};
	}
}

1;<commit_msg>bug in groups fixed<commit_after>package Groups;

use strict;
use warnings;

sub new {
	my ($class, $myid) = @_;
	my $self = {myid => $myid, groups => []};
	bless $self, $class;
}

sub process {
	my ($self, $message) = @_;
	if (defined $message->{new_chat_participant}
			and $message->{new_chat_participant}->{id} eq $self->{myid}) {
		push @{$self->{groups}}, $message->{chat}->{id};
	} elsif (defined $message->{left_chat_participant}
			and $message->{left_chat_participant}->{id} eq $self->{myid}) {
		my @groups = grep { $_ ne $message->{chat}->{id} } @{$self->{groups}};
		$self->{groups} = \@groups;
	}
}

1;
{'fraction_non_alphanumeric': 0.23064113238967526, 'fraction_numerical': 0.0016652789342214821, 'mean_word_length': 4.590697674418605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '430768', 'n_tokens_mistral': 507, 'n_tokens_neox': 482, 'n_words': 99}