Skip to content

Commit

Permalink
add seperate bot for each device, add setup for copying bot folder
Browse files Browse the repository at this point in the history
  • Loading branch information
PizzaG committed Dec 23, 2023
1 parent 41d9c93 commit fd72873
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 75 deletions.
3 changes: 3 additions & 0 deletions Bot-ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ Initial Bot Release...
—Release Updates v0.02—
Add Bot ability to spawn messages to Telegram group subchannels(Topics)...

—Release Updates v0.03—
add seperate bot for each device...

11 changes: 9 additions & 2 deletions Moto-Common-Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ echo ""
echo "A-Team Moto-Common Setup Script"
echo ""
echo ""
echo "Setup Version: 0.10"
echo "Setup Update: 12-21-2023"
echo "Setup Version: 0.11"
echo "Setup Update: 12-22-2023"
echo ""
echo ""
echo "Current Date: $date"
Expand Down Expand Up @@ -174,6 +174,13 @@ echo "1/1..."
echo ""
cp -r $A_TEAM_PACKAGE_LOCATION/device/motorola/A-Team device/motorola
sleep 5
echo "Copying A-Team Telegram Bot Folder To Rom Root..."
echo ""
echo "1/1..."
echo ""
mkdir Telegram_Bots
cp -r $A_TEAM_PACKAGE_LOCATION/Telegram_Bots/* Telegram_Bots
sleep 5
## Patch CommonConfig.mk
echo "Patching CommonConfig.mk..."
echo ""
Expand Down
3 changes: 3 additions & 0 deletions Setup-ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ fix 2 typos, tweak spacing, setup script deletes itself after running...

—Release Updates v0.10—
add 3rd changelog location option that we hijack for custom changelogs...

—Release Updates v0.11—
add setup for copying bot folder...
73 changes: 0 additions & 73 deletions Telegram_Bot.sh

This file was deleted.

44 changes: 44 additions & 0 deletions Telegram_Bots/Telegram_Bot-Amogus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

#
# Copyright 2019-Present A-Team Digital Solutions
#
# A-Team Moto-Common Telegram Notification Bot Addon
#
# Bot Version: 0.03"
# Bot Update Date: 12-22-2023"
#


# Telegram Bot Variables - **User Adaptable**
export CHANNEL_ID='-1001881525724'
export BOT_TOKEN='6980538384:AAFwUFeMM1ML_Jal5N_d7-EDU793WMykgx4'


# Device Specific Thread Topic Variables - **User Adaptable**
export AMOGUS_THREAD_ID='4635'


# if the first argument is "-h" for help.
# display the usage information
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi

# Warn if the first argument is empty.
if [ -z "$1" ]; then
echo "Add message text as the second argument"
exit 0
fi

# Warn if more than one argument is passed to the script.
if [ "$#" -ne 1 ]; then
echo "You can pass only one argument. For string with spaces, put it on quotes"
exit 0
fi

# send a POST request to Telegram's API
# The '-s' = "silent" mode
# redirect outputs to /dev/null
curl -s --data "text=$1" --data "chat_id=$CHANNEL_ID" --data "message_thread_id=$AMOGUS_THREAD_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null. follow instructions to create bot & get token to access the HTTP API.
44 changes: 44 additions & 0 deletions Telegram_Bots/Telegram_Bot-Borneo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

#
# Copyright 2019-Present A-Team Digital Solutions
#
# A-Team Moto-Common Telegram Notification Bot Addon
#
# Bot Version: 0.03"
# Bot Update Date: 12-22-2023"
#


# Telegram Bot Variables - **User Adaptable**
export CHANNEL_ID='-1001881525724'
export BOT_TOKEN='6980538384:AAFwUFeMM1ML_Jal5N_d7-EDU793WMykgx4'


# Device Specific Thread Topic Variables - **User Adaptable**
export BORNEO_THREAD_ID='17716'


# if the first argument is "-h" for help.
# display the usage information
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi

# Warn if the first argument is empty.
if [ -z "$1" ]; then
echo "Add message text as the second argument"
exit 0
fi

# Warn if more than one argument is passed to the script.
if [ "$#" -ne 1 ]; then
echo "You can pass only one argument. For string with spaces, put it on quotes"
exit 0
fi

# send a POST request to Telegram's API
# The '-s' = "silent" mode
# redirect outputs to /dev/null
curl -s --data "text=$1" --data "chat_id=$CHANNEL_ID" --data "message_thread_id=$BORNEO_THREAD_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null. follow instructions to create bot & get token to access the HTTP API.
44 changes: 44 additions & 0 deletions Telegram_Bots/Telegram_Bot-Guamna.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

#
# Copyright 2019-Present A-Team Digital Solutions
#
# A-Team Moto-Common Telegram Notification Bot Addon
#
# Bot Version: 0.03"
# Bot Update Date: 12-22-2023"
#


# Telegram Bot Variables - **User Adaptable**
export CHANNEL_ID='-1001881525724'
export BOT_TOKEN='6980538384:AAFwUFeMM1ML_Jal5N_d7-EDU793WMykgx4'


# Device Specific Thread Topic Variables - **User Adaptable**
export GUAMNA_THREAD_ID='19416'


# if the first argument is "-h" for help.
# display the usage information
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi

# Warn if the first argument is empty.
if [ -z "$1" ]; then
echo "Add message text as the second argument"
exit 0
fi

# Warn if more than one argument is passed to the script.
if [ "$#" -ne 1 ]; then
echo "You can pass only one argument. For string with spaces, put it on quotes"
exit 0
fi

# send a POST request to Telegram's API
# The '-s' = "silent" mode
# redirect outputs to /dev/null
curl -s --data "text=$1" --data "chat_id=$CHANNEL_ID" --data "message_thread_id=$GUAMNA_THREAD_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null. follow instructions to create bot & get token to access the HTTP API.
44 changes: 44 additions & 0 deletions Telegram_Bots/Telegram_Bot-Milanf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

#
# Copyright 2019-Present A-Team Digital Solutions
#
# A-Team Moto-Common Telegram Notification Bot Addon
#
# Bot Version: 0.03"
# Bot Update Date: 12-22-2023"
#


# Telegram Bot Variables - **User Adaptable**
export CHANNEL_ID='-1001881525724'
export BOT_TOKEN='6980538384:AAFwUFeMM1ML_Jal5N_d7-EDU793WMykgx4'


# Device Specific Thread Topic Variables - **User Adaptable**
export MILANF_THREAD_ID='35'


# if the first argument is "-h" for help.
# display the usage information
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi

# Warn if the first argument is empty.
if [ -z "$1" ]; then
echo "Add message text as the second argument"
exit 0
fi

# Warn if more than one argument is passed to the script.
if [ "$#" -ne 1 ]; then
echo "You can pass only one argument. For string with spaces, put it on quotes"
exit 0
fi

# send a POST request to Telegram's API
# The '-s' = "silent" mode
# redirect outputs to /dev/null
curl -s --data "text=$1" --data "chat_id=$CHANNEL_ID" --data "message_thread_id=$MILANF_THREAD_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null. follow instructions to create bot & get token to access the HTTP API.
44 changes: 44 additions & 0 deletions Telegram_Bots/Telegram_Bot-Osaka.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

#
# Copyright 2019-Present A-Team Digital Solutions
#
# A-Team Moto-Common Telegram Notification Bot Addon
#
# Bot Version: 0.02"
# Bot Update Date: 12-22-2023"
#


# Telegram Bot Variables - **User Adaptable**
export CHANNEL_ID='-1001881525724'
export BOT_TOKEN='6980538384:AAFwUFeMM1ML_Jal5N_d7-EDU793WMykgx4'


# Device Specific Thread Topic Variables - **User Adaptable**
export OSAKA_THREAD_ID='5744'


# if the first argument is "-h" for help.
# display the usage information
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` \"text message\""
exit 0
fi

# Warn if the first argument is empty.
if [ -z "$1" ]; then
echo "Add message text as the second argument"
exit 0
fi

# Warn if more than one argument is passed to the script.
if [ "$#" -ne 1 ]; then
echo "You can pass only one argument. For string with spaces, put it on quotes"
exit 0
fi

# send a POST request to Telegram's API
# The '-s' = "silent" mode
# redirect outputs to /dev/null
curl -s --data "text=$1" --data "chat_id=$CHANNEL_ID" --data "message_thread_id=$OSAKA_THREAD_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null. follow instructions to create bot & get token to access the HTTP API.

0 comments on commit fd72873

Please sign in to comment.