Skip to content

Commit

Permalink
Small changes to ABCs behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Jun 21, 2019
1 parent 8d63af9 commit c58bdea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions twitchio/abcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ async def send(self, content: str):
self.check_content(content)
self.check_bucket(channel=entity.name)

try:
name = entity.channel.name
except AttributeError:
name = entity.name

if not entity.__messageable_channel__:
await ws._websocket.send(f'PRIVMSG #jtv :/w {entity.name} {content}')
await ws._websocket.send(f'PRIVMSG #jtv :/w {name} {content}')
else:
await ws._websocket.send(f'PRIVMSG #{entity.name} :{content}\r\n')
await ws._websocket.send(f'PRIVMSG #{name} :{content}\r\n')

0 comments on commit c58bdea

Please sign in to comment.