Add opts
parent
58617e078b
commit
e94955f468
|
@ -1 +1 @@
|
|||
venv
|
||||
env
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import argparse
|
||||
import irc.bot
|
||||
import time
|
||||
import re
|
||||
|
@ -47,12 +48,22 @@ class PlayBot(irc.bot.SingleServerIRCBot):
|
|||
# Set the bot's nickname back to its original nickname
|
||||
connection.nick(self._nickname)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
channel = "#playhouse"
|
||||
nickname = "PlayBot"
|
||||
server = "localhost"
|
||||
port = 6667
|
||||
play_file = "play.txt"
|
||||
parser = argparse.ArgumentParser(description='PlayBot - an IRC bot for performing plays')
|
||||
parser.add_argument('-c', '--channel', default='#playhouse', help='the IRC channel to join')
|
||||
parser.add_argument('-n', '--nickname', default='PlayBot', help='the nickname for the bot')
|
||||
parser.add_argument('-s', '--server', default='localhost', help='the IRC server to connect to')
|
||||
parser.add_argument('-p', '--port', default='6667', help='the port to connect to on the IRC server')
|
||||
parser.add_argument('-f', '--file', default="play.txt", dest='play_file', help='the file containing the play script')
|
||||
args = parser.parse_args()
|
||||
|
||||
channel = args.channel
|
||||
nickname = args.nickname
|
||||
server = args.server
|
||||
port = int(args.port)
|
||||
play_file = args.play_file
|
||||
|
||||
bot = PlayBot(channel, nickname, server, port, play_file)
|
||||
bot.start()
|
||||
|
Loading…
Reference in New Issue