-
Notifications
You must be signed in to change notification settings - Fork 0
/
party.py
137 lines (124 loc) · 3.87 KB
/
party.py
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import subprocess, time
text_lines = [
"There's a party goin' on right here",
"A celebration to last throughout the years",
"So bring your good times and your laughter too",
"We gonna celebrate your party with you",
"Come on now, celebration",
"Let's all celebrate and have a good time",
"Celebration",
"We gonna celebrate and have a good time",
"Yahoo!",
"Celebration",
"Yahoo!",
"This is your celebration",
"Celebrate good times, come on!",
"(Let's celebrate)",
"Celebrate good times, come on!",
"(Let's celebrate)",
"There's a party goin' on right here",
"A celebration to last throughout the years",
"So bring your good times and your laughter too",
"We gonna celebrate your party with you",
"Come on now, celebration",
"Let's all celebrate and have a good time",
"Celebration",
"We gonna celebrate and have a good time",
"It's time to come together",
"It's up to you, what's your pleasure?",
"Everyone around the world come on!",
"Yahoo!",
"It's a celebration",
"Yahoo!",
"Celebrate good times, come on!",
"(It's a celebration)",
"Celebrate good times, come on!",
"(Let's celebrate)",
"There's a party goin' on right here",
"A dedication to last throughout the years",
"So bring your good times and your laughter too",
"We gonna celebrate and party with you",
"Come on now, celebration",
"Let's all celebrate and have a good time, yeah yeah",
"Celebration",
"We gonna celebrate and have a good time",
"It's time to come together",
"It's up to you, what's your pleasure?",
"Everyone around the world come on!",
"Yahoo!",
"It's a celebration",
"Yahoo!",
"It's a celebration",
"Celebrate good times, come on!",
"(Let's celebrate come on now)",
"Celebrate good times, come on!",
"(Let's celebrate)",
"We're gonna have a good time tonight",
"Let's celebrate, it's all right",
"We're gonna have a good time tonight",
"Let's celebrate, it's all right, baby",
"We're gonna have a good time tonight",
"(Celebration)",
"Let's celebrate, it's all right",
"We're gonna have a good time tonight",
"(Celebration)",
"Let's celebrate, it's all right",
"Yahoo!",
"Yahoo!",
"Celebrate good times, come on!",
"(Let's celebrate)",
"Celebrate good times, come on!",
"(It's a celebration)",
"Celebrate good times, come on!",
"(Let's celebrate)",
"(Come on and celebrate tonight)",
"Celebrate good times, come on!",
"('Cause everything's gonna be alright, let's celebrate)",
"Celebrate good times, come on!",
"(Let's celebrate)",
"Celebrate good times, come on!",
]
emojis = [
"tada",
"partyparrot",
"man_dancing",
"dancer",
"mirror_ball",
"partying_face",
"clinking_glasses",
"champagne",
]
class Roller:
inner = None
state = 0
def __init__(self, inner):
self.inner = inner
def next(self):
self.state += 1
if self.state >= len(self.inner):
self.state = 0
return self.inner[self.state]
song_roller = Roller(text_lines)
emoji_roller = Roller(emojis)
seconds = 10
pic = False
picture_path = f"/root/output.png"
ror = "/root/ror"
slack_update = "/root/.cargo/bin/slack_update"
def set_slack(pic=False):
if pic:
subprocess.call([ror,"--background","255,0,129","--color","255,217,102", "--output", picture_path])
subprocess.call([slack_update, "photo", picture_path])
else:
subprocess.call([slack_update, "status", "-e", ':{}:'.format(emoji_roller.next()), "-t", '"{}"'.format(song_roller.next())])
for x in range(0, 10000):
# wait some time
time.sleep(seconds)
try:
pic = not pic
set_slack(pic)
except e:
print("Error", e)
if e == "ratelimited":
time.sleep(seconds * 2)
pass