用python编写的简单twitch聊天包装
twitch_chat_wrapper的Python项目详细描述
这是一个用python编写的简单twitch聊天包装器,我用来 快速构建简单的机器人。
安装
pip intall twitch_chat_wrapper
获取Twitch OAuth密码令牌
按照此链接https://twitchapps.com/tmi/并保存标记
用法
fromtwitch_chat_wrapperimportTwitchChatWrapperviewers_greetings=[]defmessage_handler(chat,username,message):print("@{}: {}".format(username,message))ifusernamenotinviewers_greetings:chat.send_message("@{} welcome to the stream".format(username))viewrs_greetings.append(username)twitch=TwitchChatWrapper(bot_nickname="AwesomeBot",oauth_pass="oauth:r1xxk1111111111112222222222xwd",channel="hardlydifficult")twitch.events.on_message+=message_handlertwitch.loop()
大声呼喊
去https://www.twitch.tv/hardlydifficult建造一个令人敬畏的 Gamedev Twitch社区