fix message fail when there is no nickname

master
BuildTools 3 years ago
parent af375d5cc3
commit 183b9dcb30
  1. 10
      plugins/bridge.py

@ -4,10 +4,10 @@ from ircked.message import *
hooks = ["READY", "MESSAGE_CREATE"]
# replace all this stuff and it should maybe probablyt just werk (tm)
_discord_webhook = "https://discord.com/api/webhooks/id/token"
_discord_channel = "id"
_irc_channel = "#channel"
_irc_nick = "nick"
_discord_webhook = "https://discord.com/api/webhooks/937542041678798969/U6_y4tw-Kjrjz4ivtiVqw4Sk8E4pFR51VtFD0nd8r_2jrwLtzFInqpfQBJJIkyoYdynk"
_discord_channel = "810037417871933521"
_irc_channel = "#station"
_irc_nick = "s00bridge"
dorfl = None
@ -34,5 +34,5 @@ def run(event, ctx, bot):
dorfl.run(event_handler = magic)
elif event == "MESSAGE_CREATE" and init == True and ctx["channel_id"] == _discord_channel and not(bool(ctx.get("webhook_id"))):
dorfl.sendraw(privmsg.build(_irc_nick, _irc_channel, ctx["member"]["nick"]+" (discord): "+ctx["content"]).msg)
dorfl.sendraw(privmsg.build(_irc_nick, _irc_channel, (ctx["author"]["username"] if ctx.get("member").get("nick") == None else ctx["member"]["nick"])+" (discord): "+ctx["content"]).msg)
Loading…
Cancel
Save