-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMPORTANT: Renamed indexes of the messages arrays! Also: fixed encoding!
Renamed the following indexes: uid > userid gid > groupid cmduser > usercmd cmdgroup > groupcmd improoved print_message_data (for messages) regex. and did some code cleanup. Did I mention: Fuck Yeah, got the f**k encoding working!!! fixed '\' crashing bot. fixed encoding like 'äöü'. It's 3 am... 😭
- Loading branch information
1 parent
c5915b6
commit 888ebf8
Showing
6 changed files
with
73 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
import re | ||
|
||
unread_user = re.compile("^User\ useri?d?\#(?P<user>[^#]+)\#?(?P<uid>\d+)?\:\ (?P<unread>\d+)\ unread", re.U) | ||
unread_chat = re.compile("^Chat\ chati?d?\#(?P<group>[^#]+)\#?(?P<gid>\d+)?\:\ (?P<unread>\d+)\ unread", re.U) | ||
chat_info_header = re.compile("^Chat\ chati?d?\#(?P<group>[^#]+)\#?(?P<gid>\d+)?\ members\:", re.U) | ||
chat_info_body = re.compile("^\t?\t?useri?d?\#(?P<user>[^#]+)\#?(?P<uid>\d+)?\ invited\ by\ useri?d?\#(?P<iuser>[^#]+)\#?(?P<iuid>\d+)?\ at \[(?P<yr>\d{4})\/(?P<mth>\d{2})\/(?P<day>\d{2})\ (?P<hr>\d{2})\:(?P<min>\d{2})\:(?P<sec>\d{2})\]", re.U|re.M|re.S) | ||
user_status_data = re.compile('^\[\d{2}\:\d{2}\]\ \ \{user_status\}\ User\ useri?d?\#(?P<user>[^#]+)\#?(?P<uid>\d+)?\ is\ now\ (?P<status>online|offline)', re.U) | ||
user_info_header = re.compile("^User\ useri?d?\#(?P<user>[^#]+)\#?(?P<uid>\d+)?\:", re.U) | ||
unread_user = re.compile("^User\ useri?d?\#(?P<user>[^#]+)\#?(?P<userid>\d+)?\:\ (?P<unread>\d+)\ unread", re.U) | ||
unread_chat = re.compile("^Chat\ chati?d?\#(?P<group>[^#]+)\#?(?P<groupid>\d+)?\:\ (?P<unread>\d+)\ unread", re.U) | ||
chat_info_header = re.compile("^Chat\ chati?d?\#(?P<group>[^#]+)\#?(?P<groupid>\d+)?\ members\:", re.U) | ||
chat_info_body = re.compile("^\t?\t?useri?d?\#(?P<user>[^#]+)\#?(?P<userid>\d+)?\ invited\ by\ useri?d?\#(?P<iuser>[^#]+)\#?(?P<iuserid>\d+)?\ at \[(?P<yr>\d{4})\/(?P<mth>\d{2})\/(?P<day>\d{2})\ (?P<hr>\d{2})\:(?P<min>\d{2})\:(?P<sec>\d{2})\]", re.U|re.M|re.S) | ||
user_status_data = re.compile('^\[\d{2}\:\d{2}\]\ \ \{user_status\}\ User\ useri?d?\#(?P<user>[^#]+)\#?(?P<userid>\d+)?\ is\ now\ (?P<status>online|offline)', re.U) | ||
user_info_header = re.compile("^User\ useri?d?\#(?P<user>[^#]+)\#?(?P<userid>\d+)?\:", re.U) | ||
user_info_peerid = re.compile("peer\ id\:\ (?P<peerid>\d+)", re.U) | ||
user_info_realname = re.compile("real\ name\:\ (?P<realname>.+)", re.U) | ||
user_info_phone = re.compile("phone\:\ (?P<phone>\d+)", re.U) | ||
contact_list_data = re.compile("^User\ \#(?P<uid>\d+)\:\ user\#(?P<user>.+)\#\d+\ \((?P<cmduser>[^\ ]+)\ (?P<phone>\d+).+", re.U) | ||
print_message_data = re.compile('^(?P<msgid>\d+)\ \[(?P<timestamp>.{5,6})\]\ \[?(?P<media>.+)?\]?\ ?(?P<geolink>https\:\/\/map\.google\.com\/\?=[\d\.\,])?\ \{print_message}\ (chati?d?\#(?P<chat>.+)\ )?useri?d?\#(?P<user>.+)\ (?P<dir>[<>«»]{3})\ (?P<message>.*)\{end_print_message\}', re.U|re.M|re.S) | ||
contact_list_data = re.compile("^User\ \#(?P<userid>\d+)\:\ user\#(?P<user>.+)\#\d+\ \((?P<usercmd>[^\ ]+)\ (?P<phone>\d+).+", re.U) | ||
print_message_data = re.compile('^(?P<msgid>\d+)\ \[(?P<timestamp>.{5,6})\]\ \[?(?P<media>.+)?\]?\ ?(?P<geolink>https\:\/\/map\.google\.com\/\?=[\d\.\,])?\ \{print_message}\ (chati?d?\#(?P<chat>.+)\#(?P<chatid>\d+)\ )?useri?d?\#(?P<user>.+)\#(?P<userid>\d+)\ (?P<dir>[<>«»]{3})\ (?P<message>.*)\{end_print_message\}', re.U|re.M|re.S) | ||
print_message_data_media = re.compile('^\[(?P<media>photo|video|audio|document|photo|cideo|geo|contact|unsupported)(?:\ (?P<caption>.+?))?(?:\:\ type (?P<type>.+))?\]$', re.U) | ||
service_message_data = re.compile("^(?P<msgid>\d+)\ \[(?P<timestamp>.+)\]\ \ ?\{service_message\}\ (chati?d?\#(?P<group>[^#]+)\#?(?P<gid>\d+)?\ )??useri?d?\#(?P<user>[^#]+)\#?(?P<uid>\d+)?\ (?P<action>changed\ title\ to|added\ user|deleted\ user)\ (?P<arg>.+)", re.U) | ||
service_message_data = re.compile("^(?P<msgid>\d+)\ \[(?P<timestamp>.+)\]\ \ ?\{service_message\}\ (chati?d?\#(?P<group>[^#]+)\#?(?P<groupid>\d+)?\ )??useri?d?\#(?P<user>[^#]+)\#?(?P<userid>\d+)?\ (?P<action>changed\ title\ to|added\ user|deleted\ user)\ (?P<arg>.+)", re.U) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters