martmists-gh / asynctwitch Goto Github PK
View Code? Open in Web Editor NEWasynchronous twitch chat lib
License: BSD 3-Clause "New" or "Revised" License
asynchronous twitch chat lib
License: BSD 3-Clause "New" or "Revised" License
Traceback (most recent call last): File "bot.py", line 8, in <module> prefix = "!", File "/usr/local/lib/python3.5/dist-packages/asynctwitch-2.0.0-py3.5.egg/asynctwitch.py", line 606, in __init__ File "/usr/local/lib/python3.5/dist-packages/asynctwitch-2.0.0-py3.5.egg/asynctwitch.py", line 140, in __init__ AttributeError: module 'asyncio' has no attribute 'ProactorEventLoop'
I get this error when running something developed with this on Linux. On a quick check of the documentation, it seems that may be Windows only
add_timer calls create_timer(message, time) without a channel. You just need to pass channel into that function and it should fix the prolbme
Thanks
File "C:\Users\honglouis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asynctwitch\bots.py", line 758, in _tcp_echo_client
yield from self.event_message(messageobj)
File "C:\Users\honglouis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asynctwitch\bots.py", line 1103, in event_message
yield from self.parse_commands(m)
File "C:\Users\honglouis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asynctwitch\bots.py", line 1127, in parse_commands
yield from self.commands[w].run(rm)
File "C:\Users\honglouis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asynctwitch\dataclasses.py", line 510, in run
if self.has != '':
AttributeError: 'Command' object has no attribute 'has'
Python Version: 3.6
bot.whisper is passed message, but uses msg
corrected:
def whisper(self, user, message):
"""
Send a private message to a user
Parameters
----------
user : :class:`User`
The user to send a message to.
message : str
The message to send.
"""
yield from self._send_privmsg(user.channel, ".w {} {}".format(user.name, message))
After the latest patch my commands have stopped working. I have been trying to debug why but i do not know your code so it is hard to do. This is what i have gathered so far however:
The bot is definitely still receiving the commands. I put a little print in my command to check that it is running. It is therefor the bot.say which is not returning anything.
It did work before the update. I also tried reducing the amount of channels in my list to 1. Still the same. Tried using a simple string variable for the channel to use the system that only uses one channel, same thing happened.
My best guess is that somewhere along the way the channel the message is supposed to send to gets lost. Could also be a variable type missmatch or a simple typo.
Subcommands are currently not working
Traceback (most recent call last):
File "/var/bots/twitch/asynctwitch/bots.py", line 758, in _tcp_echo_client
yield from self.event_message(messageobj)
File "/var/bots/twitch/asynctwitch/bots.py", line 1103, in event_message
yield from self.parse_commands(m)
File "/var/bots/twitch/asynctwitch/bots.py", line 1127, in parse_commands
yield from self.commands[w].run(rm)
File "/var/bots/twitch/asynctwitch/dataclasses.py", line 549, in run
yield from self.subcommands[subcomm].run(message)
File "/var/bots/twitch/asynctwitch/dataclasses.py", line 511, in run
args = message.content[len(self.bot.prefix):].split(" ")[1:]
AttributeError: 'SubCommand' object has no attribute 'bot'
Even with your example it's the same error. Any ideas?
idk how to fix this
I've just discovered my bots weren't saying anything is because you have to change this
# Example command:
@bot.command('example', alias=['moreexample','anothaone'], desc='example command')
async def example(message, word1:str, number1:int, rest:str):
bot.say('wow');
to this
# Example command:
@bot.command('example', alias=['moreexample','anothaone'], desc='example command')
async def example(message, word1:str, number1:int, rest:str):
await bot.say('channel', 'wow');
Could a multiple channel connections be implemented into this library? It would be nice to say use a list instead of a string variable for the channels and have the bot automatically work in each channel. Would it be more efficient than running a new instance of the bot for each channel or am i better off just making a new bot object for each channel i would like to connect to?
I get the following error when running it:
Traceback (most recent call last):
File "D:\Projects\Python Projects\asynctwitch-master\bot.py", line 25, in
@say.subcommand('this')
File "D:\Projects\Python Projects\asynctwitch-master\asynctwitch\dataclasses.py", line 498, in subcommand
return SubCommand(self, *args, **kwargs)
TypeError: init() missing 1 required positional argument: 'desc'
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.