-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmusik.py
231 lines (213 loc) · 13.1 KB
/
musik.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
import discord
import random
import math
import asyncio
import variables
client = discord.Client()
userset = set()
imageonly = False
flag = True
react = 0
oldperm = dict() # {"channel id" : {"roleid", perm}}
qmessage = False
qflag = False
alphabet = {"🇦":"A","🇧":"B","🇨":"C","🇩":"D","🇪":"E","🇫":"F","🇬":"G","🇭":"H","🇮":"I","🇯":"J","🇰":"K","🇱":"L","🇲":"M","🇳":"N","🇴":"O","🇵":"P","🇶":"Q","🇷":"R","🇸":"S","🇹":"T","🇼":"W","🇺":"U","🇻":"V","🇽":"X","🇾":"Y","🇿":"Z"}
count = 0
letter = False
@client.event
async def on_ready():
print('musik is online')
@client.event
async def on_message(message):
if message.content.startswith("anh "):# and message.author.id in [233290361877823498,455301777055547394,627265323720114188]:
global oldperm
roles = [variables.killereliteID, variables.patron1, variables.patron2, variables.patron3,variables.eliteID,variables.nightmareID,variables.hurtID,variables.imtooID,variables.torquefestID,variables.adventurerID,variables.ndaID]
msg = message.content.lower().split()
if msg[1] == "endcycle":
global react
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(1)
await client.get_channel(variables.hotlineID).send("!mute <@838174410987798558>")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(2)
await client.get_channel(variables.hotlineID).send("RECURSIVE ERROR DETECTED :: FAILSAFE ACTIVATED")
await client.get_channel(variables.hotlineID).trigger_typing()
await client.get_channel(variables.hotlineID).send("RUNNING DIAGNOSTIC")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(2)
await client.get_channel(variables.hotlineID).send("MULTIPLE CRITICAL ERRORS DETECTED :: LOADING RECOVERY TOOLS")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(2)
react = await client.get_channel(variables.hotlineID).send("CONFIRM RECOVERY :: SOME DATA MAY BE DAMAGED OR LOST\n**REQUIRES {0} <:cacopog:697621015337107466> REACTS TO BEGIN\n@everyone**".format(variables.react_number))
emoji = client.get_emoji(697621015337107466)
await react.add_reaction(emoji)
elif msg[1] == "realstart":
await asyncio.sleep(2)
server = message.guild
for channel in server.channels:
if channel.id != variables.hotlineID and channel.category:
daux = dict()
daux["everyone"] = channel.overwrites_for(message.guild.default_role).read_messages
overwrite = channel.overwrites_for(message.guild.default_role)
overwrite.read_messages = False
await channel.set_permissions(message.guild.default_role, overwrite=overwrite)
for role in roles:
overwrite = channel.overwrites_for(message.guild.get_role(role))
daux[str(role)] = overwrite.read_messages
if overwrite.read_messages:
overwrite.read_messages = False
await channel.set_permissions(message.guild.get_role(role), overwrite=overwrite)
oldperm[str(channel.id)] = daux
await message.guild.get_channel(variables.modchatID).send("anh endcycle")
elif msg[1] == "normal":
server = message.guild
for channel in server.channels:
if channel.id != variables.hotlineID and channel.category:
overwrite = channel.overwrites_for(message.guild.default_role)
overwrite.read_messages = oldperm[str(channel.id)]["everyone"]
await channel.set_permissions(message.guild.default_role, overwrite=overwrite)
for role in roles:
overwrite = channel.overwrites_for(message.guild.get_role(role))
if overwrite.read_messages == False and overwrite.read_messages != oldperm[str(channel.id)][str(role)]:
overwrite.read_messages = oldperm[str(channel.id)][str(role)]
await channel.set_permissions(message.guild.get_role(role), overwrite=overwrite)
def checkletter(w,l):
if l not in w:
return False, -1
for i in range(len(w)):
if w[i] == l:
return True, i
@client.event
async def on_reaction_add(reaction, user):
global react
global qmessage
global alphabet
global count
global letter
global qflag
savior = reaction.message.guild.get_role(variables.new_saviorID)
cacopog = client.get_emoji(697621015337107466)
if reaction.message == react and reaction.emoji == cacopog:
await user.add_roles(savior,reason="cacopog reaction", atomic=True)
if reaction.count == variables.react_number:
await asyncio.sleep(5)
proc = await reaction.message.channel.send("```RESTORATION INITIATED...\n|____________________| 0%```")
await asyncio.sleep(2)
await proc.edit(content="```RESTORATION INITIATED...\n|███_________________| 13%```")
await asyncio.sleep(1)
await proc.edit(content="```RESTORATION INITIATED...\n|█████████___________| 45%```")
await asyncio.sleep(3)
await proc.edit(content="```RESTORATION INITIATED...\n|██████████████______| 70%```")
await asyncio.sleep(2)
await proc.edit(content="```RESTORATION INITIATED...\n|█████████████████___| 85%```")
await asyncio.sleep(3)
await proc.edit(content="```RESTORATION INITIATED...\n|████████████████████| 100%```")
await asyncio.sleep(2)
trivia = [] # ("initial_title","word_to_be_completed","empty_word","final_title","description","final_description","image_url")
trivia.append(("INCOMPLETE DATA :: THE FIRST MEMBER BANNED WAS","LUSHDEATH","_________","DATA SUCCESSFULLY RETRIEVED :: THE FIRST MEMBER BANNED WAS","","",""))
trivia.append(("INCOMPLETE DATA :: WHAT WORD FROM GROUP B BELONGS TO GROUP A?","TOWER"," ","DATA SUCCESSFULLY RETRIEVED :: TOWER BELONGS TO GROUP A","A) FRONT, SKI, MELON, FALL\nB) ROAD, TIRE, TOWER, CLIFF\n\n\n","Explanation: Each word in group A can pair with water",""))
trivia.append(("INCOMPLETE DATA :: WORD THAT DESCRIBES JARID","_RINGE","C_____","DATA SUCCESSFULLY RETRIEVED :: THE WORD THAT DESCRIBES JARID IS","","","",))
trivia.append(("FILE CORRUPTED :: PLEASE IDENTIFY THE SUBJECT OF THIS PICTURE","JAR JAR BINKS","___ ___ _____","FILE RECOVERED :: JARJARBINKS.JPG", "", "", "https://imgur.com/oxzx3jG.png"))
trivia.append(("CORRUPTED METADATA :: PLEASE IDENTIFY THIS IMAGE","AMONG US", "_____ __","METADATA COLLECTED :: AMONG_US.PNG", "","","https://i.imgur.com/cUx4AAo.png"))
for entry in trivia:
word = entry[1]
blank = entry[2]
embed = discord.Embed(title= entry[0], description= entry[4] + "``" + blank + "``", color=0xff0000)
if entry[6]:
embed.set_image(url= entry[6])
qmessage = await reaction.message.channel.send(embed= embed)
i = 3
usedletters = []
wrongletterlist = []
wrongletters = "Letters not present in this word: "
while True:
await asyncio.sleep(1)
if not(word):
embed = discord.Embed(title= entry[3], description=blank + "\n\n" + entry[4] + entry[5], color=0x00ff00)
if entry[6]:
embed.set_image(url= entry[6])
await qmessage.edit(content="", embed= embed)
break
if qflag:
content = "```\nCOUNTING THE MOST REACTED LETTER...\n" + str(i) + "```"
i-=1
await qmessage.edit(content= content)
if i == -1:
fixedletter = letter
await qmessage.clear_reactions()
count = 0
i = 3
if fixedletter not in usedletters:
check,index = checkletter(word,fixedletter)
usedletters.append(fixedletter)
if check:
new_word = ""
new_blank = ""
for l in range(len(list(word))):
if word[l] != word[index]:
new_word += word[l]
new_blank += blank[l]
else:
new_blank += word[l]
new_word += "_"
blank = new_blank
word = new_word
if wrongletterlist:
description = "``" + blank + "``\n\n" + wrongletters
else:
description = "``" + blank + "``"
embed = discord.Embed(title= entry[0], description= entry[4] + description, color=0xff0000)
if entry[6]:
embed.set_image(url= entry[6])
await qmessage.edit(embed= embed)
tempflag = True
for x in word:
if x != "_" and x != " ":
tempflag = False
break
if tempflag:
word = False
else:
if wrongletterlist:
if fixedletter not in wrongletterlist:
wrongletterlist.append(fixedletter)
wrongletters += ", " + fixedletter
description = "``" + blank + "``\n\n" + wrongletters
embed = discord.Embed(title= entry[0], description= entry[4] + description, color=0xff0000)
if entry[6]:
embed.set_image(url= entry[6])
await qmessage.edit(embed= embed)
else:
wrongletterlist.append(fixedletter)
wrongletters += fixedletter
description = "``" + blank + "``\n\n" + wrongletters
embed = discord.Embed(title= entry[0], description= entry[4] + description, color=0xff0000)
if entry[6]:
embed.set_image(url= entry[6])
await qmessage.edit(embed= embed)
await asyncio.sleep(2)
qmessage = False
qflag = False
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(1)
await client.get_channel(variables.hotlineID).send("``RECOVERY COMPLETE``")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(2)
await client.get_channel(variables.hotlineID).send("``CRITICAL ERRORS: 0``")
await client.get_channel(variables.hotlineID).trigger_typing()
await client.get_channel(variables.hotlineID).send("``WARNINGS: 1``")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(2)
await client.get_channel(variables.hotlineID).send("``WARNING LOG: DISCORDPY ERROR -- C:/ELSECRETO LINE 211 MISMATCH WITH RECOVERY``")
await client.get_channel(variables.hotlineID).trigger_typing()
await client.get_channel(variables.hotlineID).send("``LINE 211:`` ||htt||||p:||||//y||||ouw||||ill||||lov||||eea||||cho||||the||||r.c||||om/||||el-||||sec||||ret||||o-2||||021||||-pa||||rt-||||one||")
await client.get_channel(variables.hotlineID).trigger_typing()
await asyncio.sleep(1)
await client.get_channel(variables.hotlineID).send("``SEE DOCUMENTATION FOR NON-CRITICAL ERROR RESOLUTION``")
await client.get_channel(variables.modchatID).send("anh normal")
if reaction.message == qmessage and reaction.emoji in alphabet:
qflag = True
if reaction.count > count:
count = reaction.count
letter = alphabet[reaction.emoji]
client.run(variables.musik)