-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
57 lines (41 loc) · 1.55 KB
/
bot.py
File metadata and controls
57 lines (41 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import lightbulb
from lightbulb.ext import tasks
from AzBot import AzBot
import json
from UseCase.TalkingTracker.TalkingTracker import TalkingTracker
from UseCase.TypingTracker.TypingTracker import TypingTracker
from WriteToFileTextOutputBoundary import WriteToFileTextOutputBoundary
def get_token() -> str:
with open("token.json") as f:
file = f.read()
token = json.loads(file)["token"]
return token
def main():
with open("Typing_Time.txt") as f:
typing_file = f.read()
starting_typing = json.loads(typing_file)
typing_output_boundary = WriteToFileTextOutputBoundary("Typing_Time.txt")
typing_tracker = TypingTracker(typing_output_boundary, starting_typing)
with open("Talking_Time.txt") as f:
talking_file = f.read()
starting_talking = json.loads(talking_file)
talking_output_boundary = WriteToFileTextOutputBoundary("Talking_Time.txt")
talking_tracker = TalkingTracker(talking_output_boundary, starting_talking)
Azbot = AzBot(get_token(), typing_tracker, talking_tracker
)
lightbulb.ext.tasks.load(Azbot.bot)
"""
@bot.command()
@lightbulb.command("group", "this is a group")
@lightbulb.implements(lightbulb.SlashCommandGroup)
async def my_group(ctx):
pass
@my_group.child
@lightbulb.command("subcommand", "this is a subcommand")
@lightbulb.implements(lightbulb.SlashSubCommand)
async def subcommand(ctx):
await ctx.respond("i am a subcommand")
"""
Azbot.bot.run()
if __name__ == "__main__":
main()