From 95513d21a1e95bdd3a461447d34ae98d6b21614a Mon Sep 17 00:00:00 2001 From: Mallory Hancock Date: Wed, 7 Feb 2018 10:33:30 -0800 Subject: [PATCH] made imports clearer --- README.md | 8 ++++---- README.rst | 8 ++++---- examples/irc/dicebot.py | 4 ++-- examples/twitch/dicebot.py | 8 ++++++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c8e3786..3887fa7 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ $ pip install pinhook To create the bot, just create a python file with the following: ```python -import pinhook.bot +from pinhook.bot import Bot -bot = pinhook.bot.Bot( +bot = Bot( channels=['#foo', '#bar'], nickname='ph-bot', server='irc.freenode.net' @@ -36,9 +36,9 @@ Optional arguments are: Pinhook has a baked in way to connect directly to a twitch channel ```python -import pinhook.bot +from pinhook.bot import TwitchBot -bot = pinhook.bot.TwitchBot( +bot = TwitchBot( nickname='ph-bot', channel='#channel', token='super-secret-oauth-token' diff --git a/README.rst b/README.rst index 25a2d42..525ef6a 100644 --- a/README.rst +++ b/README.rst @@ -20,9 +20,9 @@ To create the bot, just create a python file with the following: .. code:: python - import pinhook.bot + from pinhook.bot import Bot - bot = pinhook.bot.Bot( + bot = Bot( channels=['#foo', '#bar'], nickname='ph-bot', server='irc.freenode.net' @@ -53,9 +53,9 @@ Pinhook has a baked in way to connect directly to a twitch channel .. code:: python - import pinhook.bot + from pinhook.bot import TwitchBot - bot = pinhook.bot.TwitchBot( + bot = TwitchBot( nickname='ph-bot', channel='#channel', token='super-secret-oauth-token' diff --git a/examples/irc/dicebot.py b/examples/irc/dicebot.py index 9c2d181..6ceb294 100644 --- a/examples/irc/dicebot.py +++ b/examples/irc/dicebot.py @@ -1,6 +1,6 @@ -import pinhook.bot +from pinhook.bot import Bot -ph = pinhook.bot.Bot( +ph = Bot( channels=['#dicechannel'], nickname='dicebot', server='irc.freenode.net', diff --git a/examples/twitch/dicebot.py b/examples/twitch/dicebot.py index eeb0a11..686a1bb 100644 --- a/examples/twitch/dicebot.py +++ b/examples/twitch/dicebot.py @@ -1,4 +1,8 @@ -import pinhook.bot +from pinhook.bot import TwitchBot -bot = pinhook.bot.TwitchBot('dicebot', '#dicechannel', 'supersecrettokenhere') +bot = TwitchBot( + nickname='dicebot', + channel='#dicechannel', + token='supersecrettokenhere' +) bot.start() \ No newline at end of file