From dd3e9bb3634cc57485eecfd11e80d76c2b5e0d5b Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 03:27:08 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #49 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Bot/issues/49 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..c25fe6f9 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Bot/issues/49 +Your prepared branch: issue-49-fd6cf7da +Your prepared working directory: /tmp/gh-issue-solver-1757809625345 + +Proceed. \ No newline at end of file From 306b15ef98e0abc33ed37c03dd6bf7c1c94d83b8 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 03:31:09 +0300 Subject: [PATCH 2/3] Remove karma command as requested in issue #49 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove KARMA pattern from patterns.py - Remove karma_message method from commands.py - Remove build_karma method from commands_builder.py - Remove karma command registration from __main__.py - Update documentation in README.md to remove karma command - Update tests.py to remove karma-specific test methods - Karma functionality is still available through the 'info' command 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- python/README.md | 2 -- python/__main__.py | 1 - python/modules/commands.py | 8 -------- python/modules/commands_builder.py | 16 ---------------- python/patterns.py | 2 -- python/tests.py | 10 ---------- 6 files changed, 39 deletions(-) diff --git a/python/README.md b/python/README.md index a50c2d69..6b83b475 100644 --- a/python/README.md +++ b/python/README.md @@ -20,7 +20,6 @@ | ✔️ | bottom | Вывести информацию о участниках беседы в порядке увеличения кармы. | | ✔️ | bottom [ЯЗЫКИ] | Вывести информацию о участниках беседы с указанными языками в порядке увеличения кармы. | | ✔️ | bottom [ЧИСЛО] | Вывести информацию об указанном числе участников беседы беседы в порядке увеличения кармы. | -| ✔️ | karma | Вывод своей кармы или кармы участника беседы из пересланного сообщения. | | ⭐ | info | Вывести общую информацию (карма (только для бесед с кармой), добавленные языки, ссылка на профиль github) о себе или участнике беседы из пересланного сообщения. | | ⭐ | update | Обновить информацию о вас (имя). Эта команда так же выводит информацию о вас как это делает команда info. | | ✔️ | + | Проголосовать за повышение кармы участника беседы из пересланного сообщения. | @@ -41,7 +40,6 @@ | people | люди | | top | топ | верх | | bottom | дно | низ | -| karma | карма| | info | инфо | | update | обновить | | what is | что такое | diff --git a/python/__main__.py b/python/__main__.py index cdcbf7f6..45fc1675 100644 --- a/python/__main__.py +++ b/python/__main__.py @@ -51,7 +51,6 @@ def __init__( lambda: self.commands.change_github_profile(True)), (patterns.REMOVE_GITHUB_PROFILE, lambda: self.commands.change_github_profile(False)), - (patterns.KARMA, self.commands.karma_message), (patterns.TOP, self.commands.top), (patterns.PEOPLE, self.commands.top), (patterns.BOTTOM, diff --git a/python/modules/commands.py b/python/modules/commands.py index 93d99817..f2a6851b 100644 --- a/python/modules/commands.py +++ b/python/modules/commands.py @@ -111,14 +111,6 @@ def change_github_profile( CommandsBuilder.build_github_profile(self.current_user, self.data_service), self.peer_id) - def karma_message(self) -> NoReturn: - """Shows user's karma.""" - if self.peer_id < 2e9 and not self.karma_enabled: - return - is_self = self.user.uid == self.from_id - self.vk_instance.send_msg( - CommandsBuilder.build_karma(self.user, self.data_service, is_self), - self.peer_id) def top( self, diff --git a/python/modules/commands_builder.py b/python/modules/commands_builder.py index 29dc739f..73444b00 100644 --- a/python/modules/commands_builder.py +++ b/python/modules/commands_builder.py @@ -92,22 +92,6 @@ def build_github_profile( return (f"[id{data.get_user_property(user, 'uid')}|{data.get_user_property(user, 'name')}], " f"Ваша страничка на GitHub — {profile}.") - @staticmethod - def build_karma( - user: BetterUser, - data: BetterBotBaseDataService, - is_self: bool - ) -> str: - """Sends user karma amount. - """ - if is_self: - return (f"[id{data.get_user_property(user, 'uid')}|" - f"{data.get_user_property(user, 'name')}], " - f"Ваша карма — {DataBuilder.build_karma(user, data)}.") - else: - return (f"Карма [id{data.get_user_property(user, 'uid')}|" - f"{data.get_user_property(user, 'name')}] — " - f"{DataBuilder.build_karma(user, data)}.") @staticmethod def build_not_enough_karma( diff --git a/python/patterns.py b/python/patterns.py index 1834c72c..97b21dea 100644 --- a/python/patterns.py +++ b/python/patterns.py @@ -15,8 +15,6 @@ UPDATE = recompile( r'\A\s*(обновить|update)\s*\Z', IGNORECASE) -KARMA = recompile( - r'\A\s*(карма|karma)\s*\Z', IGNORECASE) APPLY_KARMA = recompile( r'\A(\[id(?\d+)\|@\w+\])?\s*(?P\+|\-)(?P[0-9]*)\s*\Z') diff --git a/python/tests.py b/python/tests.py index 4be4241e..0872f11d 100644 --- a/python/tests.py +++ b/python/tests.py @@ -165,13 +165,6 @@ def test_change_github_profile( self.commands.match_command(patterns.REMOVE_GITHUB_PROFILE) self.commands.change_github_profile(False) - @ordered - def test_karma_message( - self - ) -> NoReturn: - self.commands.karma_message() - self.commands.user = db.get_user(2) - self.commands.karma_message() @ordered def test_top( @@ -203,7 +196,6 @@ def test_apply_user_carma( self.commands.user = db.get_user(1) self.commands.apply_user_karma(self.commands.user, 5) db.save_user(self.commands.user) - self.commands.karma_message() @ordered def test_apply_collective_vote( @@ -213,14 +205,12 @@ def test_apply_collective_vote( self.commands.user = db.get_user(1) self.commands.apply_collective_vote("opponents", config.NEGATIVE_VOTES_PER_KARMA, -1) db.save_user(self.commands.user) - self.commands.karma_message() @ordered def test_apply_karma_change( self ) -> NoReturn: self.commands.apply_karma_change('-', 6) - self.commands.karma_message() if __name__ == '__main__': From 9b98eb0a94ed2ca80fa754c05a6ead6a82f59c61 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 14 Sep 2025 03:31:58 +0300 Subject: [PATCH 3/3] Remove CLAUDE.md - Claude command completed --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index c25fe6f9..00000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Bot/issues/49 -Your prepared branch: issue-49-fd6cf7da -Your prepared working directory: /tmp/gh-issue-solver-1757809625345 - -Proceed. \ No newline at end of file