summaryrefslogtreecommitdiff
path: root/hack_of_all_hacks
diff options
context:
space:
mode:
authorJoseph Graham <joseph@colossus-debian-08-2016.home>2016-08-28 16:30:12 +0100
committerJoseph Graham <joseph@colossus-debian-08-2016.home>2016-08-28 16:30:12 +0100
commit9a2fe3f52d4f31fc8514b8b3628b1edab92b8c41 (patch)
tree66b119c8e3f5d8b66b5fb2d4e2cd9e92cc432f2b /hack_of_all_hacks
parent4e7a1f0b4de2009ae2b25880a3d307f856085986 (diff)
Removed that rediculous announcements feature
The idea of the announcements feature was that pbot sais something every time someone logs in. This feature is completely stupid and no-one uses it. Removed.
Diffstat (limited to 'hack_of_all_hacks')
-rw-r--r--hack_of_all_hacks20
1 files changed, 0 insertions, 20 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks
index 2020021..2a31a4c 100644
--- a/hack_of_all_hacks
+++ b/hack_of_all_hacks
@@ -119,30 +119,10 @@ function l33t_codes
if ! [[ -d "announcements/people/${personoslashlower}" ]]
then
mkdir -p "announcements/people/${personoslashlower}"
- touch "announcements/people/${personoslashlower}/phrases"
- cat << EOF > "announcements/people/${personoslashlower}/settings"
-enabled=yes
-locked=no
-EOF
fi
the_time_now=$(date +%s)
- # If this person has announcements enabled and there is at least one
- # phrase in their file and their seen log exists.
- if grep 'enabled=yes' "announcements/people/${personoslashlower}/settings" > \
- /dev/null && (( $( wc -l "announcements/people/${personoslashlower}/phrases" | cut -d ' ' -f 1 ) )) && [[ -f "announcements/people/${personoslashlower}/seen" ]]
- then
- # Check if they were last present more than three hours ago.
- if (( ( $( stat -c %Y "announcements/people/${personoslashlower}/seen" ) +
- 10800 ) < the_time_now ))
- then
- send_msg "${channel_it_came_from}" \
- "$( shuf "announcements/people/${personoslashlower}/phrases" | head -1 )"
- fi
-
- fi
-
# If someone has sent this person a message then echo it to
# them.
if [[ -f "announcements/people/${personoslashlower}/messages" ]]