diff --git a/src/matrix_applicationbot/classes/bot.py b/src/matrix_applicationbot/classes/bot.py index 8451160..e9fe101 100644 --- a/src/matrix_applicationbot/classes/bot.py +++ b/src/matrix_applicationbot/classes/bot.py @@ -174,6 +174,15 @@ class ApplicationBot: f"Failed to invite user {user_id} to protected room {protected_room}: {invite_response}" ) + await self.client.room_send( + self.operator_room_id, + "m.room.message", + { + "msgtype": "m.text", + "body": f"Failed to invite user {user_id} to protected room {protected_room}", + }, + ) + await self.client.room_send( room.room_id, "m.room.message", @@ -201,6 +210,15 @@ class ApplicationBot: f"Failed to kick user {user_id} from monitored room {monitored_room}: {kick_response}" ) + await self.client.room_send( + self.operator_room_id, + "m.room.message", + { + "msgtype": "m.text", + "body": f"Failed to kick user {user_id} from monitored room {monitored_room}", + }, + ) + async def get_user_id_from_ticket_room(self, room_id): # Find the user associated with the ticket id based on the room id response = await self.client.room_get_state(self.operator_room_id) @@ -222,6 +240,24 @@ class ApplicationBot: await self.set_monitored_rooms(monitored_rooms) logging.info(f"Added room {room_id} to monitored rooms") + await self.client.room_send( + room_id, + "m.room.message", + { + "msgtype": "m.text", + "body": "This room is now being monitored for applications.", + }, + ) + + await self.client.room_send( + self.operator_room_id, + "m.room.message", + { + "msgtype": "m.text", + "body": f"Room {room_id} is now being monitored for applications.", + }, + ) + async def remove_monitored_room(self, room_id): monitored_rooms = await self.get_monitored_rooms() if room_id in monitored_rooms: @@ -364,7 +400,7 @@ class ApplicationBot: "m.room.message", { "msgtype": "m.text", - "body": f"New ticket #{ticket_id} created by {sender}", + "body": f"New application #{ticket_id} created by {sender}", }, ) @@ -396,12 +432,23 @@ class ApplicationBot: if isinstance(response, RoomGetStateEventResponse): operator_room_id = response.content["operator_room"] + customer_room_id = response.content["customer_room"] + + await self.client.room_send( + customer_room_id, + "m.room.message", + { + "msgtype": "m.text", + "body": "A moderator would like to join the room to discuss your application.", + }, + ) + await self.client.room_invite(operator_room_id, sender) else: await self.client.room_send( room.room_id, "m.room.message", - {"msgtype": "m.text", "body": f"Ticket #{ticket_id} does not exist."}, + {"msgtype": "m.text", "body": f"Application #{ticket_id} does not exist."}, ) async def close_ticket(self, room, sender, command):