copygirl / cord

IRC and Discord Chatbot Framework
Other
9 stars 3 forks source link

Relay others' messages via other user? #9

Open Lombra opened 7 years ago

Lombra commented 7 years ago

Hi,

Maybe bit of a specific (and confusing?) thing, but would there be any way to set a bridge up so that messages that I send myself are always relayed via my personal user on either client, but messages sent by other users are relayed by some bot user that I have on both clients.

I feel like the ignore option could work for the bot portion if I ignore myself, but on the "personal user" bridge I would need to ignore everyone that isn't myself.

copygirl commented 7 years ago

Yeah, this is indeed confusing. I don't know what you mean. Perhaps explaining why you want to do this could help wrap my head around your request?

Lombra commented 7 years ago

Right, so if I use my real user for the cord sockets on both ends of the bridge, messages that I send will be relayed using my real user on the other end, so it's completely seamless, appearing exactly as though I had sent it on the other end. All good.

Now, if a different user sends a message, it will be relayed in my name, of course.

Lombra: hello Lombra: < Intruder > hi

My idea was that I'd have one bot user for each client that would relay messages sent by users other than myself. Those messages would be sent by a more neutral entity, which hopefully would make it more clear that they are relayed messages, and not something I'm typing.

Lombra: hello bot: < Intruder > hi

copygirl commented 7 years ago

If I get what you're saying... you're using the Discord account as the bot? Does that bridge messages correctly? Why don't you just run one instance of cord and let it bridge messages like normal, as in, just have the bot user be cord and bridge messages?

copygirl commented 7 years ago

I was just trying to make it work, but that's just opening another can of worms. I wanted to have cord work with messages that were sent from the bot's account but not the bot itself. Unfortunately there's no way to know if a message received from the Discord API was one you sent or someone else did (through an identifier for example) without hackily trying to compare sent messages with received ones. At least, there wasn't before, not sure if there is now.

Lombra commented 7 years ago

Actually, I wasn't using my Discord account for the Discord socket (I thought I did, maybe?), but yes, that's what I meant to do. Perhaps that would not be strictly in line with their bot rules. Anyway, basically I just wanted it to be more clear that messages weren't written by me by having a bot account send them.

I may have spoken too soon with the seamlessness, though. When I send a message in the IRC chat from the same user as the IRC socket uses, it gets relayed to Discord by my Discord bot as it should, but my IRC user name is not prefixed, so it very much looks like the bot sent the message. Is that intended?

copygirl commented 7 years ago

Is that intended?

Not intended as in intentional but that would be the preferred behavior, as any message the bot sends to channels itself are also bridged. So the bot recognizes the message was sent from itself and bridges it like it would do, say, a response to a command being used.

It would be nice if this worked for the Discord end as well but.. nope.