arghblargh / queuebot Goto Github PK
View Code? Open in Web Editor NEWQueue management bot for Twitch.tv chat
Queue management bot for Twitch.tv chat
I have tested out the username's case sensitive problem. In Twitch IRC, it sets all usernames to the lowercase but however your program will die when someone input the username in case sensitive and/or invalid username which is not found.
Using username: "himekyros" as this scenario:
[Case Sensitive Username]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue add
send: kyroskoh added to queue
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue new
send: New group: kyroskoh
:himekyros![email protected] PRIVMSG #loserfruit :!queue add
send: himekyros added to queue
:himekyros![email protected] PRIVMSG #loserfruit :!queue position
send: himekyros: #1 of 1
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue remove HimeKyros
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 389, in main
elif result[0] == 'R':
TypeError: 'NoneType' object is unsubscriptable
[Invalid Username/Username's not found]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue add
send: kyroskoh added to queue
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue new
send: New group: kyroskoh
:himekyros![email protected] PRIVMSG #loserfruit :!queue add
send: himekyros added to queue
:himekyros![email protected] PRIVMSG #loserfruit :!queue position
send: himekyros: #1 of 1
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue remove hime
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 389, in main
elif result[0] == 'R':
TypeError: 'NoneType' object is unsubscriptable
[Correct Input]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue add
send: kyroskoh added to queue
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue new
send: New group: kyroskoh
:himekyros![email protected] PRIVMSG #loserfruit :!queue add
send: himekyros added to queue
:himekyros![email protected] PRIVMSG #loserfruit :!queue position
send: himekyros: #1 of 1
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue remove himekyros
send: himekyros removed from queue
HOST="irc.twitch.tv"
PORT=6667
NICK="Fruit_Bot"
PASS="oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
IDENT="fruit"
REALNAME="LoserFruit's Queue Bot"
INIT_CHANNEL="#loserfruit"
ADMIN="KyrosKoh"
SAVE_FILE='data.xml'
MIN_DELAY=datetime.timedelta(0,2,500000) # 2.5 second delay between sent messages
When I have executed the script, the error occured:
-sh-4.1$ python QueueBot.py
Traceback (most recent call last):
File "QueueBot.py", line 438, in
main()
File "QueueBot.py", line 207, in main
load_data()
File "QueueBot.py", line 156, in load_data
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Since In Python 3.3, IOError became an alias for OSError, and FileNotFoundError is a subclass of OSError.
Line 156:
except FileNotFoundError:
print(" > load_data: file not found")
Line 156:
I have changed to:
except (OSError, IOError) as e:
print(" > load_data: file not found")
Result:
-sh-4.1$ python QueueBot.py
load_data: file not found
:tmi.twitch.tv 001 fruit_bot :Welcome, GLHF!
:tmi.twitch.tv 002 fruit_bot :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 fruit_bot :This server is rather new
:tmi.twitch.tv 004 fruit_bot :-
:tmi.twitch.tv 375 fruit_bot :-
:tmi.twitch.tv 372 fruit_bot :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 fruit_bot :>
Do you have your data.xml sample data? empty skeleton format?
i am unable to make the bot respond it chat or even get it to join. this is what the console outputs when i got it up and running
:tmi.twitch.tv 002 itsmeoskii :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 itsmeoskii :This server is rather new
:tmi.twitch.tv 004 itsmeoskii :-
:tmi.twitch.tv 375 itsmeoskii :-
:tmi.twitch.tv 372 itsmeoskii :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 itsmeoskii :>
PING :tmi.twitch.tv
PONG
PING :tmi.twitch.tv
PONG```
:ng224![email protected] PRIVMSG #loserfruit :!queue off
Traceback (most recent call last):
File "QueueBot.py", line 436, in
main()
File "QueueBot.py", line 335, in main
elif (queue_command=='off' and (admin_auth(user) or broadcaster_auth(channel, user) or trusted_auth(channel, user))):
File "QueueBot.py", line 188, in trusted_auth
return channel_info[channel].trusted(user)
TypeError: 'set' object is not callable
It could apply to "!queue on" too
The bot is not joining the channel as specified.
I received an error when I am performing !queue clear.
[Scenario 1]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue new
send: New group:
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue clear
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 422, in main
channel_info[channel].queue_clear()
File "QueueBot.py", line 100, in queue_clear
self.queue.clear()
AttributeError: 'list' object has no attribute 'clear'
[Scenario 2]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue add
send: kyroskoh added to queue
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue new
send: New group: kyroskoh
himekyros !himekyros @himekyros.tmi.twitch.tv PRIVMSG #loserfruit :!queue add
send: himekyros added to queue
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue remove
send: Replaced kyroskoh with himekyros
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue players
send: Current Player(s): himekyros
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue clear
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 422, in main
channel_info[channel].queue_clear()
File "QueueBot.py", line 100, in queue_clear
self.queue.clear()
AttributeError: 'list' object has no attribute 'clear'
May I know what is the steps to be taken to create a new group, add an user to the queue, choose someone from the queue to the group.
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 209, in main
readbuffer += s.recv(1024).decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xeb in position 60: ordinal not in range(128)
[Scenario: The user is a mod but not added to trusted, if the user type the following]
:evilserpentman![email protected] PRIVMSG #loserfruit :!queue show
Traceback (most recent call last):
File "QueueBot.py", line 433, in
main()
File "QueueBot.py", line 350, in main
elif (queue_command=='show' and (admin_auth(user) or broadcaster_auth(channel, user) or trusted_auth(channel, user))):
File "QueueBot.py", line 188, in trusted_auth
return channel_info[channel].trusted(user)
TypeError: 'set' object is not callable
[Scenario: Invalid variable data in the list]
:kyroskoh![email protected] PRIVMSG #loserfruit :!queue remove username
Traceback (most recent call last):
File "QueueBot.py", line 436, in
main()
File "QueueBot.py", line 392, in main
elif result[0] == 'R':
TypeError: 'NoneType' object is unsubscriptable
It could be applied to the Username Case Sensitive too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.