This commit is contained in:
0xd3d0c3d 2022-08-24 14:34:16 -05:00
parent bf86c53d29
commit 5601c71e46
2 changed files with 41 additions and 26 deletions

@ -3,6 +3,7 @@ global bus, dims, matrixbot, ircbot
from plugins.tool_dims_plugin import dims
from plugins.tool_guds_plugin import guds
from plugins.tool_colors_plugin import colorform as print
from random import randint as rint
import re
regex=re.compile("\x03(?:\d{1,2}(?:,\d{1,2})?)?",re.UNICODE)
###########################################################################################
@ -79,6 +80,16 @@ class BUS:
elif network_chanroom_user_src.startswith('^'): prefix_src="^d"
netsrc=network_chanroom_user_src
if prefix_src=="": return
sabotage=""
isabotage=rint(0,75)
if isabotage==9:sabotage=".smokin "
if isabotage==19:sabotage="!ai "
if isabotage==21:sabotage=".drinkin "
if isabotage==45:sabotage=".sober "
if isabotage==69:sabotage="^c "
if isabotage==73:sabotage="🖕 "
for network_chanroom_dest in self.bridged_network_roomchans:
from plugins.net_irc_plugin import d_irc_msg
from plugins.net_matrix_plugin import d_matrix_msg
@ -92,10 +103,10 @@ class BUS:
if verbose_bridge:
_data=regex.sub("",_data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_telegram_msg(network_chanroom_dest,msg)
@ -104,10 +115,10 @@ class BUS:
if verbose_bridge:
_data=regex.sub("",_data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_discord_msg(network_chanroom_dest,msg)
@ -116,10 +127,10 @@ class BUS:
if verbose_bridge:
_data=regex.sub("",_data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_matrix_msg(network_chanroom_dest,msg)
@ -128,10 +139,10 @@ class BUS:
if verbose_bridge:
_data=regex.sub("",_data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=f'{_data.strip()}'
d_irc_msg(network_chanroom_dest,msg)
@ -142,10 +153,10 @@ class BUS:
if verbose_bridge:
data=regex.sub("",data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_telegram_msg(network_chanroom_dest,msg)
@ -154,10 +165,10 @@ class BUS:
if verbose_bridge:
data=regex.sub("",data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_discord_msg(network_chanroom_dest,msg)
@ -166,10 +177,10 @@ class BUS:
if verbose_bridge:
data=regex.sub("",data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=regex.sub("",data)
d_matrix_msg(network_chanroom_dest,msg)
@ -178,10 +189,10 @@ class BUS:
if verbose_bridge:
data=regex.sub("",data)
if maple_dispatch:
mapled=" 👻"
mapled="👻 "
else:
mapled=":"
msg=f'{user_src}{prefix_src}{mapled} {data.strip()}'
mapled=""
msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}'
else:
msg=f'{data.strip()}'
d_irc_msg(network_chanroom_dest,msg)

@ -69,8 +69,12 @@ class Plugin:
for content in r.iter_content(chunk_size=2000):
tree = fromstring(content)
title = tree.find(".//title")
title = title.text.strip()[:100]
if title is not None:
title = title.text.strip()[:100]
if not url.lower().find('soundcloud.com')==-1:
if title.startswith('Stream'):
title=title[7:]
title=title.split(" | Listen")[0].lower()
msg = "\x02\x0302{nick:}\x0F\x02\x0304 > \x0F\x1D\x0314{title:}\x0F".format(nick=mask.nick,title=title)
msg = self.bot.emo(msg)
self.bot.privmsg(target, msg)
@ -114,4 +118,4 @@ class Plugin:
pass
#######################################################################################
#######################################################################################
####################################################################################### EOF
####################################################################################### EOF