JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
Apache License 2.0
11.06k stars 1.04k forks source link

Add ability to send group messages for plugin developers #3069

Closed tre3p closed 9 months ago

tre3p commented 9 months ago

Checklist

Changes

New functionality

I've added the following functionality: 1) Add LeaveChatRoomGroup method as PublicAPI, which allow bot to leave from specific group chat 2) Add GetClanChatInfo method as PublicAPI, which allow bot to retrieve a bit more information about group than it was in GetClanChatGroupID method(GetClanChatGroupID was internal method, which main purpose was to retrieve chat_group_id, which is not enough to send group message).

Changed functionality

I've changed the following: 1) Make JoinChatRoomGroup method as PublicAPI in order to allow bot to send message to group chat. If a bot tries to send a message to the group chat without joining the chat (not group!) - it gets EResult.AccessDenied message.

Removed functionality

I've removed the following: 1) Delete entire GetClanChatGroupID method, but it's functionality was moved to GetClanChatInfo method with the only addition - ability to retrieve default_chat_id

Additional info

Hi! Thought I'd post here about why I made this change in general. I had a goal - to teach bots to write messages in group chats, but unfortunately, the functionality that would allow me to get the necessary information about the group - was internal methods, and provided only part of the required information. So I decided to slightly augment the existing code to make sending messages to group chat possible.

I have tested the sending and all the added/modified methods work fully.

JustArchi commented 9 months ago

Thanks! :trophy: