This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/util/ircformat.py

29 lines
742 B
Python
Raw Normal View History

2013-09-06 08:57:26 +02:00
def rep(format_string):
2013-09-06 08:59:07 +02:00
"""Replace based irc formatting"""
stuff = {}
stuff['col'] = {'[white]':'\x030',
'[black]':'\x031',
'[dblue]':'\x032',
'[dgreen]':'\x033',
'[dred]':'\x034',
'[brown]':'\x035',
'[purple]':'\x036',
'[gold]':'\x037',
'[yellow]':'\x038',
'[green]':'\x039',
'[cyan]':'\x0310',
'[lblue]':'\x0311',
'[blue]':'\x0312',
'[pink]':'\x0313',
'[gray]':'\x0314',
'[lgray]':'\x0315',}
stuff['style'] = {'[b]':'\x02'}
stuff['sym'] = {'[point]':'\x07'}
2013-09-06 08:54:50 +02:00
stuff['text'] = {'[url]':'http://'}
final = {}
for x in stuff:
final.update(x)
for x in final:
2013-09-06 08:59:07 +02:00
format_string = format_string.replace(x,final[x])
2013-09-06 08:12:21 +02:00
return format_string