Added basic user class
This commit is contained in:
parent
5290447531
commit
ba66b7935b
15
tbot.py
15
tbot.py
@ -4,7 +4,7 @@ import re
|
||||
import json
|
||||
|
||||
with open(".twitchcreds") as file:
|
||||
botSettings = json.loads(file.read())
|
||||
botSettings = json.loads(file.read())#
|
||||
|
||||
UserID = botSettings[0]['OAUTH']
|
||||
PREFIX = '!'
|
||||
@ -17,11 +17,14 @@ userstats = {}
|
||||
|
||||
permitURL = []
|
||||
|
||||
class UserData:
|
||||
def __init__(self, username):
|
||||
self.username = username
|
||||
self.mod = username in botSettings[1]["MODS"]
|
||||
|
||||
def isURL(message):
|
||||
rule = re.compile("http(|s)[;:]\/\/.*\..*")
|
||||
if rule.findall(message):
|
||||
return True
|
||||
return False
|
||||
return rule.findall(message)
|
||||
|
||||
|
||||
def handle_message(message: twitch.chat.Message) -> None:
|
||||
@ -80,7 +83,7 @@ def handle_message(message: twitch.chat.Message) -> None:
|
||||
else:
|
||||
pass
|
||||
|
||||
print(userstats)
|
||||
# print(userstats)
|
||||
|
||||
def main():
|
||||
chat = twitch.Chat(channel='#aztecdude1',
|
||||
@ -94,5 +97,5 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
print(botSettings)
|
||||
#print(isURL("https://google.com"))
|
||||
print(test.mod)
|
||||
Loading…
x
Reference in New Issue
Block a user