Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from snoonetIRC/master+send-command-method
Browse files Browse the repository at this point in the history
Add send_command() to send irclib Message()
  • Loading branch information
linuxdaemon authored Jul 10, 2019
2 parents 30e069c + 9516066 commit 4e14613
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asyncirc/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ def send(self, text: AnyStr) -> None:
"""Send a raw line to the server"""
asyncio.run_coroutine_threadsafe(self._send(text), self.loop)

def send_command(self, msg: Message) -> None:
"""Send an irclib Message object to the server"""
return self.send(str(msg))

async def _send(self, text: AnyStr) -> None:
if not self.connected:
await self._connected_future
Expand Down

0 comments on commit 4e14613

Please sign in to comment.