35 lines
984 B
Bash
35 lines
984 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Variables
|
||
|
ROCKET_CHAT_URL="https:///chat.koozali.org" # Replace with your Rocket.Chat URL
|
||
|
TOKEN="LwSxku5012GVjT5GKukvCiAE3jmxzNREsJ3ZO87oP1D" # Replace with your user token
|
||
|
DISCUSSION_ID="X2Wk3W5taM9PJYP4R" # Replace with the discussion ID
|
||
|
CHANNEL_ID="66bdc31d984a39b87c64b400" # Replace with the channel ID
|
||
|
USER_ID="9RmjfwmQZc9pYrC9G"
|
||
|
|
||
|
# Function to fetch channel history
|
||
|
fetch_channel_history() {
|
||
|
response=$(curl --request GET --url "$ROCKET_CHAT_URL/channels.history?roomName=Gitea" \
|
||
|
-H "X-Auth-Token: $TOKEN" \
|
||
|
-H "X-User-Id: $USER_ID" \
|
||
|
-H "Content-Type: application/json")
|
||
|
|
||
|
echo "Channel History:"
|
||
|
echo "$response"
|
||
|
}
|
||
|
|
||
|
|
||
|
get_channel_list() {
|
||
|
curl -s -X GET "$ROCKET_CHAT_URL/api/v1/channels.list" \
|
||
|
-H "X-Auth-Token: $TOKEN" \
|
||
|
-H "X-User-Id: $USER_ID" \
|
||
|
-H "Content-Type: application/json"
|
||
|
}
|
||
|
|
||
|
# Main Logic
|
||
|
#channels=$(get_channel_list)
|
||
|
#echo $channels
|
||
|
#exit 1
|
||
|
|
||
|
fetch_channel_history
|