#NEWLINE# @ utils . cached_slot_property ( '_clean_content' ) #NEWLINE# def clean_content( self ) : #NEWLINE# #INDENT# 'A property that returns the content in a "cleaned up"\n        manner. This basically means that mentions are transformed\n        into the way the client shows it. e.g. ``<#id>`` will transform\n        into ``#name``.\n\n        This will also transform @everyone and @here mentions into\n        non-mentions.\n        ' #NEWLINE# transformations = { re . escape ( '<#{0.id}>' . format ( channel ) ) : ( '#' + channel . name ) for channel in self . channel_mentions } #NEWLINE# mention_transforms = { re . escape ( '<@{0.id}>' . format ( member ) ) : ( '@' + member . display_name ) for member in self . mentions } #NEWLINE# second_mention_transforms = { re . escape ( '<@!{0.id}>' . format ( member ) ) : ( '@' + member . display_name ) for member in self . mentions } #NEWLINE# transformations . update ( mention_transforms ) #NEWLINE# transformations . update ( second_mention_transforms ) #NEWLINE# if ( self . server is not None ) : #NEWLINE# #INDENT# role_transforms = { re . escape ( '<@&{0.id}>' . format ( role ) ) : ( '@' + role . name ) for role in self . role_mentions } #NEWLINE# transformations . update ( role_transforms ) #NEWLINE# #UNINDENT# def repl( obj ) : #NEWLINE# #INDENT# return transformations . get ( re . escape ( obj . group ( 0 ) ) , '' ) #NEWLINE# #UNINDENT# pattern = re . compile ( '|' . join ( transformations . keys ( ) ) ) #NEWLINE# result = pattern . sub ( repl , self . content ) #NEWLINE# transformations = { #NEWLINE# #INDENT# '@everyone' : '@\u200beveryone' , #NEWLINE# '@here' : '@\u200bhere' , #NEWLINE# #UNINDENT# } #NEWLINE# def repl2( obj ) : #NEWLINE# #INDENT# return transformations . get ( obj . group ( 0 ) , '' ) #NEWLINE# #UNINDENT# pattern = re . compile ( '|' . join ( transformations . keys ( ) ) ) #NEWLINE# return pattern . sub ( repl2 , result )