mirror of
https://github.com/osmarks/autobotrobot
synced 2024-06-25 22:43:15 +00:00
revert code back to original state
This commit is contained in:
parent
abc1eb15be
commit
cfa0d6e552
|
@ -58,18 +58,13 @@ async def initialize():
|
||||||
|
|
||||||
async def on_bridge_message(channel_name, msg):
|
async def on_bridge_message(channel_name, msg):
|
||||||
if channel_name in util.config["irc"]["channels"]:
|
if channel_name in util.config["irc"]["channels"]:
|
||||||
|
|
||||||
if channel_name not in joined: conn.join(channel_name)
|
if channel_name not in joined: conn.join(channel_name)
|
||||||
|
|
||||||
# if its a reply
|
# if its a reply
|
||||||
if msg.replyee:
|
if msg.replyee:
|
||||||
conn.privmessage (channel_name, f"Replying to @{random_color(msg.replyee.id)}{msg.replyee.name}{color_code('')}:")
|
conn.privmessage(channel_name, f"Replying to @{random_color(msg.replyee.id)}{msg.replyee.name}{color_code('')}:")
|
||||||
|
|
||||||
# ping fix - zero width space embedded in messages
|
# ping fix - zero width space embedded in messages
|
||||||
line = f"<{random_color(msg.author.id)}{msg.author.name[0]}\u200B{msg.author.name[1:]}{color_code('')}> " + render_formatting(msg.message)[:400]
|
line = f"<{random_color(msg.author.id)}{msg.author.name[0]}\u200B{msg.author.name[1:]}{color_code('')}> " + render_formatting(msg.message)[:400]
|
||||||
|
|
||||||
conn.privmsg(channel_name, line)
|
conn.privmsg(channel_name, line)
|
||||||
|
|
||||||
for at in msg.attachments:
|
for at in msg.attachments:
|
||||||
conn.privmsg(channel_name, f"-> {at.filename}: {at.proxy_url}")
|
conn.privmsg(channel_name, f"-> {at.filename}: {at.proxy_url}")
|
||||||
|
|
||||||
|
|
|
@ -114,29 +114,10 @@ class Telephone(commands.Cog):
|
||||||
if (msg.author == self.bot.user and msg.content[0] == "<") or msg.author.discriminator == "0000": return
|
if (msg.author == self.bot.user and msg.content[0] == "<") or msg.author.discriminator == "0000": return
|
||||||
channel_id = msg.channel.id
|
channel_id = msg.channel.id
|
||||||
|
|
||||||
msg = eventbus.Message(
|
msg = eventbus.Message(eventbus.AuthorInfo(msg.author.name, msg.author.id, str(msg.author.avatar_url), msg.author.bot),
|
||||||
eventbus.AuthorInfo(
|
parse_formatting(self.bot, msg.content), ("discord", channel_id), msg.id,
|
||||||
msg.author.name,
|
eventbus.AuthorInfo(msg.reference.cached_message.author.name, msg.reference.cached_message.author.id, str(msg.reference.cached_message.author.avatar_url), msg.reference.cached_message.author.bot),
|
||||||
msg.author.id,
|
[ at for at in msg.attachments if not at.is_spoiler() ])
|
||||||
str(msg.author.avatar_url),
|
|
||||||
msg.author.bot
|
|
||||||
),
|
|
||||||
|
|
||||||
parse_formatting (self.bot, msg.content),
|
|
||||||
|
|
||||||
("discord", channel_id),
|
|
||||||
|
|
||||||
msg.id,
|
|
||||||
|
|
||||||
eventbus.AuthorInfo(
|
|
||||||
msg.reference.cached_message.author.name,
|
|
||||||
msg.reference.cached_message.author.id,
|
|
||||||
str(msg.reference.cached_message.author.avatar_url),
|
|
||||||
msg.reference.cached_message.author.bot
|
|
||||||
),
|
|
||||||
|
|
||||||
[ at for at in msg.attachments if not at.is_spoiler() ]
|
|
||||||
)
|
|
||||||
|
|
||||||
await eventbus.push(msg)
|
await eventbus.push(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user