<s> """<STR_LIT>""" <EOL> import re <EOL> import logging <EOL> import json <EOL> logger = logging . getLogger ( __name__ ) <EOL> def on_message ( msg , server ) : <EOL> text = msg . get ( "<STR_LIT:text>" , "<STR_LIT>" ) <EOL> logger . debug ( text ) <EOL> match = re . findall ( r"<STR_LIT>" , text ) <EOL> if not match : <EOL> match = re . findall ( r'<STR_LIT>' , text ) <EOL> if not match : <EOL> return <EOL> helptopic = match [ <NUM_LIT:0> ] . strip ( ) <EOL> if helptopic : <EOL> return server . hooks [ "<STR_LIT>" ] . get ( helptopic , <EOL> "<STR_LIT>" . format ( helptopic ) ) <EOL> else : <EOL> helpdict = server . hooks . get ( "<STR_LIT>" , { } ) <EOL> attachments = sorted ( [ attach for attach in helpdict . values ( ) ] ) <EOL> kwargs = { <EOL> '<STR_LIT>' : json . dumps ( attachments ) , <EOL> '<STR_LIT:text>' : '<STR_LIT>' <EOL> } <EOL> server . slack . post_message ( <EOL> msg [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' , <EOL> as_user = server . slack . server . username , <EOL> ** kwargs ) <EOL> def on_channel_joined ( msg , server ) : <EOL> return "<STR_LIT>" </s>
