Fix the " bug on discord side.

This commit is contained in:
Nova Cat 2024-12-31 21:09:18 -08:00
parent d2946bc4ee
commit f9e60d6070

View file

@ -367,8 +367,8 @@ async def on_message(message):
if message.content[:3] == "/me" or message.content[:4] == "b$me":
await message.delete()
hook(gilwebhook, json={"content": "***[" + message.author.display_name + "] (Guilded) " + " ".join(message.content.split(" ")[1:]), "username": "SweeBridge Guilded", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-guilded.png"})
if discord_enable: hook(discwebhook, json={"content": "***[" + message.author.display_name + "] (Discord) " + " ".join(message.content.split(" ")[1:]), "username": "SweeBridge Guilded", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-guilded.png"})
if libera_enable: libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Guilded) " + " ".join(message.content.split(" ")[1:]).replace("\n","(Newline)"))
if discord_enable: hook(discwebhook, json={"content": "***[" + message.author.display_name + "] (Discord) " + message.content, "username": "SweeBridge Guilded", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-guilded.png"})
if libera_enable: libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Guilded) " + message.content.replace("\n","(Newline)"))
else:
if pfp != None:
if discord_enable: hook(discwebhook, json={"content": message.content, "username": message.author.display_name, "avatar_url": pfp})
@ -438,16 +438,16 @@ class MyClient(discord.Client):
await message.delete()
if guilded_enable: hook(gilwebhook, json={"content": "***[" + message.author.display_name + "] (Guilded) " + message.content[3:]})
hook(discwebhook, json={"content": "***[" + message.author.display_name + "] (Discord) " + message.content[3:]})
libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Discord) " + message.content.replace("\\","\\\\").replace("\n","(Newline)").replace("\"","\\\"")[3:])
libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Discord) " + " ".join(message.content.replace("\n","(Newline)").split(" ")[1:]))
elif message.content[0] == "_" and libera_enable:
if guilded_enable: hook(gilwebhook, json={"content": "***[" + message.author.display_name + "] (Guilded) " + message.content[1:-1]})
libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Discord) " + message.content.replace("\\","\\\\").replace("\n","(Newline)").replace("\"","\\\"")[1:-1])
libera.send_irc(libera_channel, "***[" + message.author.display_name +"] (Discord) " + message.content.replace("\n","(Newline)")[1:-1])
else:
if pfp != None:
if guilded_enable: hook(gilwebhook, json={"content": message.content, "username": message.author.display_name.replace("_", " "), "avatar_url": pfp})
else:
if guilded_enable: hook(gilwebhook, json={"content": message.content, "username": message.author.display_name.replace("_", " ")})
if libera_enable: libera.send_irc(libera_channel, "[" + message.author.display_name +"] (Discord): " + message.content.replace("\\","\\\\").replace("\n","(Newline)").replace("\"","\\\""))
if libera_enable: libera.send_irc(libera_channel, "[" + message.author.display_name +"] (Discord): " + message.content.replace("\n","(Newline)"))
if message.content[:13] == "b$liberausers":
if libera_enable:
temp = ""