Best Python code snippet using autotest_python
main.py
Source:main.py
...26def url_encode(data):27 return (parse.quote(data).replace('/', '%2F'))28async def lifetime(msg,user):29 chat_id = msg.channel.id30 now = log_append(chat_id, str(msg.content), "lifetime",0)31 dup_num = user.lifetime_enable(now)32 if dup_num[0] < 3:33 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)34 text = mention_user(user.user_id)+" "+quadra_lifetime.checkSwitch(now)35 await bot.send_message(msg.channel,text)36 else:37 user.mody(love = -10)38 text = mention_user(user.user_id)+" "+quadra_lifetime.checkSwitch2(now, user.love_level())39 await bot.send_message(msg.channel,text)40async def dialog_how(msg,user):41 chat_id = msg.channel.id42 log_append(chat_id, str(msg.content), "d_how",0)43 target = re.search('^ì¬ì½ì ((?:(?! ì´ë).)*) ì´ë', str(msg.content))44 target = target.groups()45 user_list = msg.mentions46 47 if target[0] == "ë":48 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¡°ê¸ë§ 기ë¤ë ¤ì¤! ìê°ì´ ì¢ ê±¸ë ¤!")49 level_stat = user.level50 cash_stat = user.cash51 if level_stat == quadra_user_module.MAX_LEVEL:52 req_exp = quadra_user_module.REQ_EXP[level_stat-1] - quadra_user_module.REQ_EXP[level_stat-2]53 cur_exp = user.exp - quadra_user_module.REQ_EXP[level_stat-1]54 elif level_stat != 0 :55 req_exp = quadra_user_module.REQ_EXP[level_stat] - quadra_user_module.REQ_EXP[level_stat-1]56 cur_exp = user.exp - quadra_user_module.REQ_EXP[level_stat-1]57 else :58 req_exp = quadra_user_module.REQ_EXP[level_stat]59 cur_exp = user.exp60 if level_stat != quadra_user_module.MAX_LEVEL:61 exp_bar = ""62 exp_perc = (cur_exp / req_exp)63 exp_perc *= 10064 exp_perc_str = "(%3d %%)"%(exp_perc)65 for i in range(0,10,1):66 if exp_perc >= 10:67 exp_bar += "â "68 exp_perc -= 1069 else: exp_bar += "â¡"70 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì íë¡í!",description="Lv."+str(level_stat)+" ( "+str(cur_exp)+" / "+str(req_exp)+" )\n"+exp_bar+exp_perc_str, colour=discord.Colour.blue())71 else : 72 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì íë¡í!",description="Lv."+str(level_stat)+" ( "+str(cur_exp)+" )\nâ â â â â â â â â â (ìµëë 벨)", colour=discord.Colour.blue())73 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)74 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")75 em.add_field(name="ë", value=str(cash_stat), inline=True)76 em.add_field(name="í¸ê°ë", value=user.love_short(), inline=True)77 if level_stat == 100: em.add_field(name="ëì ê²½íì¹",value=str(user.exp),inline=False)78 else : em.add_field(name="ëì ê²½íì¹",value=str(user.exp)+" / "+str(quadra_user_module.REQ_EXP[level_stat]),inline=False)79 ranking = user.user_rank()80 em.add_field(name="ìì",value=str(ranking[0])+" / "+str(ranking[1]),inline=True)81 await bot.send_message(msg.channel,mention_user(user.user_id)+",\n"+user.love_text(),embed = em)82 elif len(user_list) == 1 and user_list :83 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¡°ê¸ë§ 기ë¤ë ¤ì¤! ìê°ì´ ì¢ ê±¸ë ¤!")84 if user_list[0].bot == False :85 trg_user = quadra_user(user_list[0].id)86 level_stat = trg_user.level87 cash_stat = trg_user.cash88 if level_stat == quadra_user_module.MAX_LEVEL:89 req_exp = quadra_user_module.REQ_EXP[level_stat-1] - quadra_user_module.REQ_EXP[level_stat-2]90 cur_exp = trg_user.exp - quadra_user_module.REQ_EXP[level_stat-1]91 elif level_stat != 0 :92 req_exp = quadra_user_module.REQ_EXP[level_stat] - quadra_user_module.REQ_EXP[level_stat-1]93 cur_exp = trg_user.exp - quadra_user_module.REQ_EXP[level_stat-1]94 else :95 req_exp = quadra_user_module.REQ_EXP[level_stat]96 cur_exp = trg_user.exp97 if level_stat != quadra_user_module.MAX_LEVEL:98 exp_bar = ""99 exp_perc = (cur_exp / req_exp)100 exp_perc *= 100101 exp_perc_str = "(%3d %%)"%(exp_perc)102 for i in range(0,10,1):103 if exp_perc >= 10:104 exp_bar += "â "105 exp_perc -= 10106 else: exp_bar += "â¡"107 em = discord.Embed(title=user_list[0].name+"#"+str(user_list[0].discriminator)+" ì íë¡í!",description="Lv."+str(level_stat)+" ( "+str(cur_exp)+" / "+str(req_exp)+" )\n"+exp_bar+exp_perc_str, colour=discord.Colour.blue())108 else : 109 em = discord.Embed(title=user_list[0].name+"#"+str(user_list[0].discriminator)+" ì íë¡í!",description="Lv."+str(level_stat)+" ( "+str(cur_exp)+" )\nâ â â â â â â â â â (ìµëë 벨)", colour=discord.Colour.blue())110 if user_list[0].avatar_url: em.set_thumbnail(url=user_list[0].avatar_url)111 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")112 em.add_field(name="ë", value=str(cash_stat), inline=True)113 em.add_field(name="í¸ê°ë", value=trg_user.love_short(), inline=True)114 if level_stat == 100: em.add_field(name="ëì ê²½íì¹",value=str(trg_user.exp),inline=False)115 else : em.add_field(name="ëì ê²½íì¹",value=str(trg_user.exp)+" / "+str(quadra_user_module.REQ_EXP[level_stat]),inline=False)116 ranking = trg_user.user_rank()117 em.add_field(name="ìì",value=str(ranking[0])+" / "+str(ranking[1]),inline=True)118 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+user_list[0].name+"#"+str(user_list[0].discriminator)+"ì ëí´ì 묻ëê±°ì§?",embed = em)119 else :120 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+user_list[0].name+"#"+str(user_list[0].discriminator)+"ë ë´ì´ìì!" )121 elif target[0] in quadra_search_vocab.dis_list: 122 text=random.choice(quadra_dialog_list.dialog_dis_how)123 user.mody(love = 2, love_time = True, exp = 5, exp_time = True)124 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)125 elif target[0] in quadra_search_vocab.adult_list:126 text=random.choice(quadra_dialog_list.dialog_hentai_how)127 inc = - 10 - 5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)128 user.mody(love = inc, exp = 5, exp_time = True)129 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)130 else:131 text="미ì. ë¬´ì¨ ë§ì¸ì§ ëª¨ë¥´ê² ì´."132 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)133 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)134async def dialog_please(msg,user):135 chat_id = msg.channel.id136 log_append(chat_id, str(msg.content), "d_plz",0)137 target = re.search('^ì¬ì½ì ((?:(?! (í´ì¤|í ë)).)*) (í´ì¤|í ë)', str(msg.content))138 target = target.groups()139 140 if target[0] == "ìëë¡ë":141 game_name = onGame(user.user_id)142 if game_name == "ë¡ë를":143 user_in = [10,10,10,10,10,10]144 for i in range(0,6,1):145 swt = True146 while(swt):147 temp = random.randrange(1,36)148 if temp in user_in:149 continue150 else:151 user_in[i] = temp152 swt = False153 user_in.sort()154 data = quadra_lotto.check(user.user_id)155 result = quadra_lotto.gameManager(user_in,data[0],data[1])156 user_in_text = ""157 for i in user_in:158 user_in_text += str(i)+" "159 log_append(chat_id,"player : "+user_in_text, "lt","p_at")160 text2 = mention_user(user.user_id)+", "161 text = ""162 for i in data[0]:163 text += str(i)+" "164 comp_in_text = text+": "+str(data[1])165 log_append(chat_id,"rank "+str(result)+", answer is "+text+": "+str(data[1]), "lt","p_cor")166 dif_cash = 0167 dif_love = 0168 dif_exp = 0169 if result == 1:170 text2 += "1ë±ì´ë¤! ì¶íí´!! 8,145,060 ë¶ì 1ì íë¥ ì¸ë°, ë무 ëë¨í걸?"171 dif_love = 10172 dif_exp = 100173 dif_cash = 2500000000174 elif result == 2:175 text2 += "2ë±ì´ì¼. 1ë±ì´ ìëë¼ ìì½ê² ì§ë§, ê·¸ëë ì¶íí´!"176 dif_love = 5177 dif_exp = 50178 dif_cash = 10000000179 elif result == 3:180 text2 += "3ë±. ì´ì ëë©´ 꽤ë ì´ì´ ì¢ì걸?"181 dif_love = 4182 dif_exp = 25183 dif_cash = 3000000184 elif result == 4:185 text2 += "4ë±. 733ëª
ì¤ íëª
. ì¶íí´."186 dif_love = 3187 dif_exp = 25188 dif_cash = 50000189 elif result == 5:190 dif_love = 2191 dif_exp = 25192 dif_cash = 5000193 text2 += "5ë±. 45ëª
ì¤ì íëª
ì´ì¼. ê·¸ëë 본ì ì ë½ììë ¤ë?"194 else: text2 += "ì§ëì¹ ëë°ì ì¢ì§ ìë¤êµ¬. ê²°êµ ë¤ ìì´ë²ë¦¬ìì.."195 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ë¡ë ê²°ê³¼!",colour=discord.Colour.blue())196 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)197 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")198 em.add_field(name="ë°©ì",value="ìë",inline=True)199 if result <= 5: em.add_field(name="ë±ì",value=str(result)+"ë±",inline=True)200 else : em.add_field(name="ë±ì",value="--",inline=True)201 em.add_field(name="ë¹ì²¨ê¸",value=str(dif_cash)+" ì",inline=False)202 em.add_field(name="íë ì´ì´", value=user_in_text, inline=False)203 em.add_field(name="ë¹ì²¨ë²í¸", value=comp_in_text, inline=False)204 await bot.send_message(msg.channel,text2,embed = em)205 quadra_lotto.end(user.user_id)206 user.mody(love = dif_love, exp = dif_exp, cash = dif_cash)207 else: 208 log_append(chat_id,"there are no game playing", "gm","p_no")209 await bot.send_message(msg.channel,mention_user(user.user_id)+", ê²ìì ìíê³ ìëê²ê°ìë°?")210 elif target[0] in quadra_search_vocab.dis_list: 211 out_text = random.choice(quadra_dialog_list.dialog_dis_please)212 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)213 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+out_text)214 elif target[0] in quadra_search_vocab.adult_list:215 out_text = random.choice(quadra_dialog_list.dialog_hentai_please)216 inc = -10-5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)217 user.mody(love = inc, exp = 5, exp_time = True)218 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+out_text)219 else:220 out_text = "미ì. ë í´ë¬ë¼ëê±´ì§ ëª¨ë¥´ê² ì´."221 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)222 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+out_text)223async def dialog_do(msg,user):224 chat_id = msg.channel.id225 target = re.search('^ì¬ì½ì ((?:(?! íì).)*) íì', str(msg.content))226 target = target.groups()227 228 if target[0] == "ì¼êµ¬ê²ì":229 if onGame(user.user_id) == "ì¼êµ¬ê²ìì":230 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ë¯¸ íë ì´ì¤ì¸ê±° ê°ìë°?\n3ì리 ì를 ìê°í´ì \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤.\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤.")231 elif onGame(user.user_id) !="" :232 out_text=mention_user(user.user_id)+", ì´ë¯¸ "+onGame(user.user_id)+" íë ì´ì¤ì¸ê±° ê°ìë°?"233 await bot.send_message(msg.channel,out_text)234 else:235 log_append(chat_id,str(msg.content), "bb","start1")236 temp = quadra_baseball.start(user.user_id)237 log_append(chat_id,str(user.user_id)+" "+str(temp), "bb","start2")238 out_text=mention_user(user.user_id)+", ì¢ì! ì´ì ììí´ë³´ì~\n \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"239 await bot.send_message(msg.channel,out_text)240 elif target[0] == "ì
ë¤ì´":241 if onGame(user.user_id) == "ì
ë¤ì´ì":242 out_text=mention_user(user.user_id)+", ì´ë¯¸ íë ì´ì¤ì¸ê±° ê°ìë°?\n3ì리 ì를 ìê°í´ì \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤.\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤."243 await bot.send_message(msg.channel,out_text)244 elif onGame(user.user_id)!= "" :245 out_text=mention_user(user.user_id)+", ì´ë¯¸ "+onGame(user.user_id)+" íë ì´ì¤ì¸ê±° ê°ìë°?"246 await bot.send_message(msg.channel,out_text)247 else:248 log_append(chat_id, str(msg.content), "ud","start1")249 temp = quadra_updown.start(user.user_id)250 log_append(chat_id,str(user.user_id)+" "+str(temp), "ud","start2")251 out_text=mention_user(user.user_id)+", ì¢ì! ì´ì ììí´ë³´ì~\n \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"252 await bot.send_message(msg.channel,out_text)253 elif target[0] == "ë¡ë":254 if onGame(user.user_id) == "ë¡ë를":255 out_text=mention_user(user.user_id)+", ì´ë¯¸ íë ì´ì¤ì¸ê±° ê°ìë°?\n1ë¶í° 35ê¹ì§ì ì ì¤ 6ê°ë¥¼ 골ë¼ì \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤. ì를 ë¤ë©´ \"ì¬ì½ì 1 3 4 16 21 34 ë§ì?\" ëëì¼ë¡ ì¨ì£¼ë©´ ë¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤.\n\"ì¬ì½ì ìëë¡ë í´ì¤\"ë¼ê³ ë§íë©´ ìëì¼ë¡ í´ë³¼ê²!."256 await bot.send_message(msg.channel,out_text)257 elif onGame(user.user_id)!= "" :258 out_text=mention_user(user.user_id)+", ì´ë¯¸ "+onGame(user.user_id)+" íë ì´ì¤ì¸ê±° ê°ìë°?"259 await bot.send_message(msg.channel,out_text)260 else:261 if user.cash >= quadra_config.LOTTO_CHARGE :262 log_append(chat_id, str(msg.content), "lt","start1")263 temp = quadra_lotto.start(user.user_id)264 log_append(chat_id,str(user.user_id)+" "+str(temp), "lt","start2")265 out_text=mention_user(user.user_id)+", ì¢ì! ì´ì ììí´ë³´ì~\n 1ë¶í° 35ê¹ì§ì ì ì¤ 6ê°ë¥¼ 골ë¼ì \"ì¬ì½ì ~ ë§ì?\" ë¼ê³ ë§í´ì¤. ì를 ë¤ë©´ \"ì¬ì½ì 1 3 4 16 21 34 ë§ì?\" ëëì¼ë¡ ì¨ì£¼ë©´ ë¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!\n\"ì¬ì½ì ìëë¡ë í´ì¤\"ë¼ê³ ë§íë©´ ìëì¼ë¡ í´ë³¼ê²!."266 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+", ë¡ë 구매 ììì¦ì´ì¼!",colour=discord.Colour.blue())267 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)268 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")269 past_cash = user.cash270 user.mody(cash = (-1)*quadra_config.LOTTO_CHARGE)271 future_cash = user.cash272 em.add_field(name="ì¬ì©ì ", value=str(past_cash), inline=True)273 em.add_field(name="ë¹ì©", value="1000", inline=True)274 em.add_field(name="ì¬ì©í", value=str(future_cash), inline=True)275 await bot.send_message(msg.channel,out_text,embed = em)276 else:277 log_append(chat_id,str(user.user_id)+" don't have enough money", "lt","nocs")278 out_text=mention_user(user.user_id)+", ë¡ë를 íë ¤ë©´ 1000ìì´ íìí´!"279 await bot.send_message(msg.channel,out_text)280 else:281 log_append(chat_id, str(msg.content), "d_do",0)282 if target[0] in quadra_search_vocab.dis_list: 283 out_text=mention_user(user.user_id)+", "+random.choice(quadra_dialog_list.dialog_dis_do)284 await bot.send_message(msg.channel,out_text)285 user.mody(love = 2,love_time = True, exp = 5, exp_time = True)286 elif target[0] in quadra_search_vocab.adult_list:287 out_text=mention_user(user.user_id)+", "+random.choice(quadra_dialog_list.dialog_hentai_do)288 await bot.send_message(msg.channel,out_text)289 inc = - 10 - 5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)290 user.mody(love = inc, exp = 1, exp_time = True)291 else:292 out_text=mention_user(user.user_id)+", 미ì. ë íìëê±´ì§ ëª¨ë¥´ê² ì´."293 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)294 await bot.send_message(msg.channel,out_text)295async def game_prog(msg,user):296 chat_id = msg.channel.id297 log_append(chat_id, str(msg.content), "gm","prog")298 game_name = onGame(user.user_id)299 if game_name == "ì¼êµ¬ê²ìì":300 target = re.search('^ì¬ì½ì ((?:(?! ë§ì\?).)*) ë§ì\?', str(msg.content))301 target = target.groups()302 if len(target[0]) != 3:303 log_append(chat_id,"you have to give answer 000 ~ 999", "bb","p_e1")304 out_text = mention_user(user.user_id)305 out_text+=", í¹ì íëë§ì¸ë°, ìë 3ìë¦¬ë¡ ì¨ì¼í´. ê¹ë¨¹ìê±´ ìëì§?\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"306 await bot.send_message(msg.channel,out_text)307 else:308 data = quadra_baseball.check(user.user_id)309 temp_bool = quadra_baseball.check_equal(int(target[0]))310 if temp_bool:311 result = quadra_baseball.gameManager(int(target[0]),int(data[0]))312 data[0] = int(data[0])313 if result[0] == 3:314 log_append(chat_id,"answer is "+str(data[0]), "bb","p_cor")315 out_text=mention_user(user.user_id)+", ì ëµì´ì¼! "+str(int(data[1])+1)+"ë²ë§ì ë§ì·ë걸!"316 quadra_baseball.end(user.user_id)317 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ì¼êµ¬ê²ì ê²°ê³¼!",colour=discord.Colour.blue())318 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)319 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")320 em.add_field(name="íì", value=str(int(data[1])+1)+"í", inline=True)321 em.add_field(name="ëµì", value=target[0], inline=True)322 em.add_field(name="ê²°ê³¼", value="ê²ì ì±ê³µ!", inline=False)323 temp_num = int(data[1])+1324 inc = 0325 if temp_num < 4 :326 inc = 100327 dif_love = 4328 elif temp_num < 6 :329 inc = 90330 dif_love = 3331 elif temp_num < 8 :332 inc = 75333 dif_love = 3334 elif temp_num < 11 :335 inc = 60336 dif_love = 2337 else:338 inc = 50339 dif_love = 1340 em.add_field(name="íë ê²½íì¹", value=str(inc), inline=False)341 await bot.send_message(msg.channel,out_text,embed = em)342 user.mody(love = dif_love, exp = inc)343 else:344 log_append(chat_id,str(result[0])+"-"+str(result[1])+", answer is "+str(data[0]), "bb","p_no")345 out_text=mention_user(user.user_id)+", ìíê³ ìì´! \nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"346 quadra_baseball.lose(user.user_id)347 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ì¼êµ¬ê²ì ê²°ê³¼!",colour=discord.Colour.blue())348 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)349 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")350 strike = int(result[0])351 ball = int(result[1])352 result_view = "S "353 for i in range(0,2,1):354 if strike > 0:355 strike -= 1356 result_view += 'â'357 else : result_view += 'â'358 result_view += "\nB "359 for i in range(0,3,1):360 if ball > 0:361 ball -= 1362 result_view += 'â'363 else : result_view += 'â'364 result_view += "\n ( "+str(result[0])+" - " + str(result[1]) + " )"365 em.add_field(name="íì", value=str(int(data[1])+1)+"í", inline=True)366 em.add_field(name="ëµì", value=target[0], inline=True)367 em.add_field(name="ê²°ê³¼", value=result_view, inline=False)368 await bot.send_message(msg.channel,out_text,embed = em)369 else:370 log_append(chat_id,"there are duplication", "bb","p_e2")371 out_text = mention_user(user.user_id)372 out_text+=", í¹ì íëë§ì¸ë°, ê° ì리ìì ê°ì ì«ìê° ë¤ì´ê°ë©´ ìë¼. ê¹ë¨¹ìê±´ ìëì§?\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"373 await bot.send_message(msg.channel,out_text)374 elif game_name == "ì
ë¤ì´ì":375 target = re.search('^ì¬ì½ì ((?:(?! ë§ì\?).)*) ë§ì\?', str(msg.content))376 target = target.groups()377 if int(target[0]) < 0 or int(target[0]) > 100:378 log_append(chat_id,"you have to give answer 000 ~ 99", "ud","p_e1")379 out_text=mention_user(user.user_id)+", í¹ì íëë§ì¸ë°, ìë 100 미ë§ì ìì°ìë¡ ì¨ì¼í´. ê¹ë¨¹ìê±´ ìëì§?\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"380 await bot.send_message(msg.channel,out_text)381 else:382 data = quadra_updown.check(user.user_id)383 result = quadra_updown.gameManager(int(target[0]),int(data[0]))384 if result == 0:385 log_append(chat_id,"answer is "+str(data[0]), "ud","p_cor")386 out_text=mention_user(user.user_id)+", ì ëµì´ì¼! "+str(int(data[1])+1)+"ë²ë§ì ë§ì·ë걸!"387 quadra_updown.end(user.user_id)388 389 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ì
ë¤ì´ ê²°ê³¼!",colour=discord.Colour.blue())390 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)391 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")392 em.add_field(name="íì°¨", value=str(int(data[1])+1)+"í", inline=True)393 em.add_field(name="ëµì", value=str(int(target[0])), inline=True)394 em.add_field(name="ê²°ê³¼", value="ì ëµ!", inline=False)395 temp_num = int(data[1])+1396 inc = 0397 if temp_num < 4 :398 inc = 75399 dif_love = 3400 elif temp_num < 6 :401 inc = 65402 dif_love = 3403 elif temp_num < 8 :404 inc = 60405 dif_love = 2406 else:407 inc = 50408 dif_love = 1409 em.add_field(name="íë ê²½íì¹", value=str(inc), inline=False)410 await bot.send_message(msg.channel,out_text,embed = em)411 user.mody(love = dif_love, exp = inc)412 elif result == 1:413 log_append(chat_id,"down, answer is "+str(data[0]), "ud","p_no")414 out_text=mention_user(user.user_id)+", ë¤ì´! ì ëµì ê·¸ê±°ë³´ë¤ ë®ì ìì¼! ì´ë²ì´ "+str(int(data[1])+1)+"ë²ì§¸ì¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"415 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ì
ë¤ì´ ê²°ê³¼!",colour=discord.Colour.blue())416 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)417 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")418 em.add_field(name="íì°¨", value=str(int(data[1])+1)+"í", inline=True)419 em.add_field(name="ëµì", value=str(int(target[0])), inline=True)420 em.add_field(name="ê²°ê³¼", value="ë¤ì´! (ì ëµì ë ë®ìì!)", inline=False)421 await bot.send_message(msg.channel,out_text,embed = em)422 quadra_updown.lose(user.user_id)423 elif result == -1:424 log_append(chat_id,"up, answer is "+str(data[0]), "ud","p_no")425 out_text=mention_user(user.user_id)+", ì
! ì ëµì ê·¸ê±°ë³´ë¤ ëì ìì¼! ì´ë²ì´ "+str(int(data[1])+1)+"ë²ì§¸ì¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"426 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ì
ë¤ì´ ê²°ê³¼!",colour=discord.Colour.blue())427 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)428 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")429 em.add_field(name="íì°¨", value=str(int(data[1])+1)+"í", inline=True)430 em.add_field(name="ëµì", value=str(int(target[0])), inline=True)431 em.add_field(name="ê²°ê³¼", value="ì
! (ì ëµì ë ëìì!)", inline=False)432 await bot.send_message(msg.channel,out_text,embed = em)433 quadra_updown.lose(user.user_id)434 elif game_name == "ë¡ë를":435 target = re.search('^ì¬ì½ì ((?:(?! ë§ì\?).)*) ë§ì\?', str(msg.content))436 target = target.groups()437 temp1 = target[0].split(" ")438 user_in = []439 swt = 0440 for i in temp1:441 user_in.append(int(i))442 if len(user_in) != 6 :443 log_append(chat_id,"you have to give answer 6 prices", "lt","p_e1")444 out_text=mention_user(user.user_id)+", í¹ì íëë§ì¸ë°, ë¡ëë 6ê°ì ìë¡ íëê±°ì¼. ê¹ë¨¹ìê±´ ìëì§?\nì를 ë¤ë©´ \"ì¬ì½ì 1 3 4 16 21 34 ë§ì?\" ëëì¼ë¡ ì¨ì£¼ë©´ ë¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"445 swt = 1446 await bot.send_message(msg.channel,out_text)447 elif quadra_lotto.check_equal(user_in) == False:448 log_append(chat_id,"there are duplicated", "lt","p_e2")449 out_text=mention_user(user.user_id)+", í¹ì íëë§ì¸ë°, ê°ê°ì ìë ë¬ë¼ì¼ í´.\nì를 ë¤ë©´ \"ì¬ì½ì 1 3 4 16 21 34 ë§ì?\" ëëì¼ë¡ ì¨ì£¼ë©´ ë¼!\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"450 swt = 1451 await bot.send_message(msg.channel,out_text)452 else:453 for i in user_in:454 if i < 1 or i > 35:455 swt = 1456 log_append(chat_id,"you have to give answer 1 ~ 35", "lt","p_e3")457 out_text=mention_user(user.user_id)+", í¹ì íëë§ì¸ë°, ê°ê°ì ë²í¸ë 1~35 ì¤ì ìë¡ ì¨ì¼í´. ê¹ë¨¹ìê±´ ìëì§?\nê·¸ë§íê³ ì¶ë¤ë©´ \"ì¬ì½ì ê·¸ë§í ë\"ë¼ê³ ë§í´ì¤!"458 await bot.send_message(msg.channel,out_text)459 if swt == 0:460 data = quadra_lotto.check(user.user_id)461 result = quadra_lotto.gameManager(user_in,data[0],data[1])462 user_in_text = ""463 for i in user_in:464 user_in_text += str(i)+" "465 text2 = mention_user(user.user_id)+", "466 text = ""467 for i in data[0]:468 text += str(i)+" "469 comp_in_text = text+": "+str(data[1])470 log_append(chat_id,"rank "+str(result)+", answer is "+text+": "+str(data[1]), "lt","p_cor")471 dif_cash = 0472 dif_love = 0473 dif_exp = 0474 if result == 1:475 text2 += "1ë±ì´ë¤! ì¶íí´!! 8,145,060 ë¶ì 1ì íë¥ ì¸ë°, ë무 ëë¨í걸?"476 dif_love = 10477 dif_exp = 100478 dif_cash = 2500000000479 elif result == 2:480 text2 += "2ë±ì´ì¼. 1ë±ì´ ìëë¼ ìì½ê² ì§ë§, ê·¸ëë ì¶íí´!"481 dif_love = 5482 dif_exp = 50483 dif_cash = 10000000484 elif result == 3:485 text2 += "3ë±. ì´ì ëë©´ 꽤ë ì´ì´ ì¢ì걸?"486 dif_love = 4487 dif_exp = 25488 dif_cash = 3000000489 elif result == 4:490 text2 += "4ë±. 733ëª
ì¤ íëª
. ì¶íí´."491 dif_love = 3492 dif_exp = 25493 dif_cash = 50000494 elif result == 5:495 dif_love = 2496 dif_exp = 25497 dif_cash = 5000498 text2 += "5ë±. 45ëª
ì¤ì íëª
ì´ì¼. ê·¸ëë 본ì ì ë½ììë ¤ë?"499 else: text2 += "ì§ëì¹ ëë°ì ì¢ì§ ìë¤êµ¬. ê²°êµ ë¤ ìì´ë²ë¦¬ìì.."500 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+" ì ë¡ë ê²°ê³¼!",colour=discord.Colour.blue())501 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)502 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")503 em.add_field(name="ë°©ì",value="ìë",inline=True)504 if result <= 5: em.add_field(name="ë±ì",value=str(result)+"ë±",inline=True)505 else : em.add_field(name="ë±ì",value="--",inline=True)506 em.add_field(name="ë¹ì²¨ê¸",value=str(dif_cash)+" ì",inline=False)507 em.add_field(name="íë ì´ì´", value=user_in_text, inline=False)508 em.add_field(name="ë¹ì²¨ë²í¸", value=comp_in_text, inline=False)509 await bot.send_message(msg.channel,text2,embed = em)510 quadra_lotto.end(user.user_id)511 user.mody(love = dif_love, exp = dif_exp, cash = dif_cash)512 else: 513 log_append(chat_id,"there are no game playing", "gm","p_no")514 out_text=mention_user(user.user_id)+", ê²ìì ìíê³ ìëê²ê°ìë°?"515 await bot.send_message(msg.channel,out_text)516async def game_end(msg,user):517 chat_id = msg.channel.id518 log_append(chat_id, str(msg.content), "bb","end")519 out_text = mention_user(user.user_id)+", "520 game_name = onGame(user.user_id)521 if game_name == "ì¼êµ¬ê²ìì":522 data = quadra_baseball.check(user.user_id)523 data[0] = int(data[0])524 log_append(chat_id,"answer is "+str(data[0]), "bb","end2")525 out_text += "ì¼êµ¬ê²ìì ê·¸ë§íë ¤ê³ ? íëììì§. ì ëµì "+str(data[0])+"ì´ìê³ , ëë "+str(data[1])+"ë² ìëíì´!"526 quadra_baseball.end(user.user_id)527 elif game_name == "ì
ë¤ì´ì":528 data = quadra_updown.check(user.user_id)529 log_append(chat_id,"answer is "+str(data[0]), "ud","end2")530 out_text += "ì
ë¤ì´ì ê·¸ë§íë ¤ê³ ? íëììì§. ì ëµì "+str(data[0])+"ì´ìê³ , ëë "+str(data[1])+"ë² ìëíì´!"531 quadra_updown.end(user.user_id)532 elif game_name == "ë¡ë를":533 data = quadra_lotto.check(user.user_id)534 text = ""535 for i in data[0]:536 text += str(i)+" "537 log_append(chat_id,"answer is "+text+": "+str(data[1]), "lt","p_cor")538 text2 = " ì ëµì "+text+" ì ë³´ëì¤ë²í¸ "+str(data[1])+" ì´ìì´!"539 log_append(chat_id,"answer is "+str(data[0]), "lt","end2")540 out_text += "ë¡ë를 ê·¸ë§íë ¤ê³ ? íëììì§."+text2541 quadra_lotto.end(user.user_id)542 else:543 log_append(chat_id,str(user.user_id)+" isn't playing baseball", "gm","e_e")544 out_text += "ì ì´ì ìíê³ ììë ê² ê°ìë°.. ê²ìì íê³ ì¶ë¤ë©´ 먼ì \"ì¬ì½ì (ê²ìì´ë¦) íì\" ë¼ê³ ë§í´ì¤!"545 await bot.send_message(msg.channel,out_text)546async def get_supply(msg,user):547 chat_id = msg.channel.id548 log_append(chat_id, str(msg.content), "bb","end")549 if user.canSupply():550 out_text = mention_user(user.user_id)+", "+user.supply_text()551 inc_array = quadra_config.SUPPLY_ARRAY552 past_cash = user.cash553 inc = inc_array[user.love_level()-1]554 swt = 0555 if user.cash + inc > quadra_user_module.CASH_SOFTCAP:556 if user.cash > quadra_user_module.CASH_SOFTCAP: swt = 2557 else: swt = 1558 if swt == 0 : user.mody(cash = inc, cash_time=True)559 elif swt == 1 : user.mody(cash = quadra_user_module.CASH_SOFTCAP - user.cash, cash_time=True)560 if swt <= 1:561 future_cash = user.cash562 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+", ì§ìê¸ ìë ¹ ìë£!",colour=discord.Colour.blue())563 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)564 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")565 em.add_field(name="ìë ¹ì ", value=str(past_cash), inline=True)566 em.add_field(name="ì§ìê¸", value=str(inc), inline=True)567 em.add_field(name="ìë ¹í", value=str(future_cash), inline=True)568 await bot.send_message(msg.channel,out_text,embed = em)569 else:570 out_text = mention_user(user.user_id)+", 미ìí´. ë무 ëì ë§ì´ ê°ì§ê³ ìë ê² ê°ì."571 em = discord.Embed(title=msg.author.name+"#"+str(msg.author.discriminator)+", ì§ìê¸ ìë ¹ ë¶ê°",colour=discord.Colour.blue())572 if msg.author.avatar_url: em.set_thumbnail(url=msg.author.avatar_url)573 else : em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")574 em.add_field(name="ìë ¹ì ", value=str(past_cash), inline=True)575 em.add_field(name="ì§ìê¸", value="0", inline=True)576 em.add_field(name="ìë ¹í", value=str(past_cash), inline=True)577 await bot.send_message(msg.channel,out_text,embed = em)578 else:579 out_text = mention_user(user.user_id)+", ë´ì¼ ë¤ì ìì¤!"580 await bot.send_message(msg.channel,out_text)581 582async def searching(msg,user,perm):583 chat_id = msg.channel.id584 target = re.search('^ì¬ì½ì (?:((?:(?!ìì).)*)ìì )?((?:(?! (ìë ¤ì¤|ì°¾ìì¤)).)*) (ìë ¤ì¤|ì°¾ìì¤)', str(msg.content))585 target = target.groups()586 if target[0] == 'ì¤í':587 search_target = target[1].lower()588 term_switch = 0589 game_dict = quadra_game_list.game_synonym.items()590 for i in game_dict :591 if search_target in i[1]:592 term_switch = 1593 game_real_name = i[0]594 if search_target == i[0]:595 term_switch = 1596 game_real_name = i[0]597 if term_switch == 0:598 log_append(chat_id, str(msg.content), "sch", "g_e")599 text="미ìí´. ë¬´ì¨ ê²ìì¸ì§ ì 몰ë¼ì ëì ê²ìí´ì¤ê²! ( " + quadra_search_list.search_engine["ì¤í"] + url_encode(target[1]) + " )"600 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)601 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)602 else : 603 log_append(chat_id, str(msg.content), "sch", "g")604 game_target = quadra_game_list.game_number[game_real_name]605 if game_target[0] == 0:606 text="í¹ì ì´ ê²ì ì°¾ì¼ë ¤ëê±° ë§ì? ( " + quadra_game_list.steam_shop+game_target[1] + " )"607 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)608 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)609 else :610 text=game_target[0]+" ( " + quadra_game_list.steam_shop+game_target[1] + " )"611 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)612 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)613 elif target[0] in quadra_search_list.search_engine:614 if target[1] in quadra_search_vocab.adult_list:615 log_append(chat_id, str(msg.content), "sch", "ad")616 text="ë³í.. ì´ë°ê±°ê¹ì§ ì°¾ìì¤ì¼í´? ( " + quadra_search_list.search_engine[target[0]] + url_encode(target[1]) + " )"617 inc = - 5 - 5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)618 user.mody(love = inc, exp = 5, exp_time = True)619 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)620 elif target[1] in quadra_search_vocab.dis_list:621 log_append(chat_id, str(msg.content), "sch", "dis")622 text="... ì´ë°ê±¸ ìê°ì¤ì´ë¼ë©´ ê·¸ë§ë¬. ..ë´ê° ëë í¨ê» ìì´ì¤í
ëê¹. ( " + quadra_search_list.search_engine[target[0]] + url_encode(target[1]) + " )"623 user.mody(love = 2,love_time = True, exp = 5, exp_time = True)624 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)625 elif target[1] in quadra_search_vocab.wonder_list:626 log_append(chat_id, str(msg.content), "sch", "won")627 text=quadra_search_vocab.wonder_list[target[1]] + " ( " + quadra_search_list.search_engine[target[0]] + url_encode(target[1]) + " )"628 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)629 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)630 else:631 log_append(chat_id, str(msg.content), "sch", 0)632 text="ì´ê±° ì°¾ì¼ë ¤ëê±° ë§ì§? ( " + quadra_search_list.search_engine[target[0]] + url_encode(target[1]) + " )"633 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)634 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)635 elif target[1] in quadra_search_list.hentai_url:636 log_append(chat_id, str(msg.content), "sch", "d_ad")637 text="ëë ì ë§ ìµì
ì ë³í구ë.. ì, ì¬ê¹ì´. ( " + quadra_search_list.hentai_url[target[1]] + " )"638 inc = - 5 - 5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)639 user.mody(love = inc, exp = 5, exp_time = True)640 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)641 elif target[1] in quadra_search_list.direct_url:642 log_append(chat_id, str(msg.content), "sch", "d")643 text="거기ë¼ë©´ ëë ìê³ ìì´! ë°ë¡ ë³´ë´ì¤ê»! ( " + quadra_search_list.direct_url[target[1]] + " )"644 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)645 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)646 elif target[0] == "ê²ë¶ë£¨":647 if perm >= 2 :648 log_append(chat_id, str(msg.content), "sch", "g")649 temp_pid = str(random.randrange(0,1000))650 if target[1] == "ì무거ë":651 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&json=1"652 tag_raw = "ì무거ë"653 elif target[1] == "ì¼íê±°":654 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&tags=rating:explicit&json=1"655 tag_raw = "ì¼íê±°"656 elif target[1] == "ìì¼íê±°":657 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&tags=rating:safe&json=1"658 tag_raw = "ìì¼íê±°"659 else:660 tag_list = target[1].split(" ")661 tag_raw = ""662 for i in range(0,len(tag_list),1):663 if tag_list[i] == "ì¼íê±°": tag_list[i] = "rating:explicit"664 elif tag_list[i] == "ìì¼íê±°": tag_list[i] = "rating:safe"665 if i == len(tag_list)-1 : tag_raw += tag_list[i]666 else : tag_raw += tag_list[i]+"+"667 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&tags="+tag_raw+"&json=1"668 try:669 log_append(chat_id,"target : \""+ tag_raw+"\"", "sch", "g")670 r = requests.get(temp_url)671 r = r.text672 data = json.loads(r)673 file = data[0]["file_url"]674 embed=discord.Embed(title="íê·¸:"+tag_raw)675 embed.set_image(url=file)676 log_append(chat_id,"transmit success!", "sch", "g")677 await bot.send_message(msg.channel, embed=embed)678 except Exception as ex:679 text="ì¤ë¥ê° ë°ìíì´! 미ìí´."680 log_append(chat_id,"error occured!", "sch", "g")681 log_append(chat_id,ex, "sch", "g")682 if str(ex) == "list index out of range": text+=" ê·¸ í그를 ê°ì§ ê·¸ë¦¼ì´ ì¶©ë¶í ìë ê² ê°ì."683 else: text+=" ê·¸ í그를 ê°ì§ ê·¸ë¦¼ì´ ìì´!"684 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)685 else :686 log_append(chat_id, str(msg.content), "sch", "g")687 temp_pid = str(random.randrange(0,1000))688 if target[1] == "ì무거ë":689 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&tags=rating:safe&json=1"690 tag_raw = "rating:safe"691 else:692 tag_list = target[1].split(" ")693 if "rating:safe" in tag_list:694 tag_raw = ""695 else:696 tag_raw = "rating:safe+"697 for i in range(0,len(tag_list),1):698 if i == len(tag_list)-1 : tag_raw += tag_list[i]699 else : tag_raw += tag_list[i]+"+"700 temp_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=1&pid="+temp_pid+"&tags="+tag_raw+"&json=1"701 try:702 log_append(chat_id,"target : \""+ tag_raw+"\"", "sch", "g")703 r = requests.get(temp_url)704 r = r.text705 data = json.loads(r)706 file = data[0]["file_url"]707 embed=discord.Embed(title="íê·¸:"+tag_raw)708 embed.set_image(url=file)709 log_append(chat_id,"transmit success!", "sch", "g")710 await bot.send_message(msg.channel, embed=embed)711 except Exception as ex:712 text="ì¤ë¥ê° ë°ìíì´! 미ìí´."713 log_append(chat_id,"error occured!", "sch", "g")714 log_append(chat_id,ex, "sch", "g")715 if str(ex) == "list index out of range": text+=" ê·¸ í그를 ê°ì§ ê·¸ë¦¼ì´ ì¶©ë¶í ìë ê² ê°ì."716 else: text+=" ê·¸ í그를 ê°ì§ ê·¸ë¦¼ì´ ìì´!"717 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)718 else:719 if target[1] in quadra_search_vocab.adult_list:720 log_append(chat_id, str(msg.content), "sch", "n_ad")721 text=target[1] + "ë¼ë... ë³í! ì´ë°ê±°ê¹ì§ ì°¾ìì¤ì¼í´? ( " + quadra_search_list.search_engine["구ê¸"] + url_encode(target[1]) + " )"722 inc = - 5 - 5*(quadra_user_module.MAX_LOVE - quadra_user_module.MIN_LOVE - user.love) / (quadra_user_module.MAX_LOVE-quadra_user_module.MIN_LOVE)723 user.mody(love = inc, exp = 5, exp_time = True)724 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)725 elif target[1] in quadra_search_vocab.dis_list:726 log_append(chat_id, str(msg.content), "sch", "n_dis")727 text=target[1] + "ê°ì걸 ìê°ì¤ì´ë¼ë©´ ê·¸ë§ë¬. ..ë´ê° ëë í¨ê» ìì´ì¤í
ëê¹. ( " + quadra_search_list.search_engine['구ê¸'] + url_encode( target[1]) + " )"728 user.mody(love = 2,love_time = True, exp = 5, exp_time = True)729 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)730 elif target[1] in quadra_search_vocab.wonder_list:731 log_append(chat_id, str(msg.content), "sch", "n_won")732 text=quadra_search_vocab.wonder_list[target[1]] + " ( " + quadra_search_list.search_engine['구ê¸'] + url_encode(target[1]) + " )"733 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)734 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)735 else:736 log_append(chat_id, str(msg.content), "sch", "n")737 text="ì´ê±° ì°¾ì¼ë ¤ëê±° ë§ì§? ( " + quadra_search_list.search_engine["구ê¸"] + url_encode(target[1]) + " )"738 user.mody(love = 1,love_time = True, exp = 5, exp_time = True)739 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+text)740async def dialog_lone(msg,user):741 chat_id = msg.channel.id742 log_append(chat_id, str(msg.content), "d_lone",0)743 text = mention_user(user.user_id)+", "744 text += random.choice(quadra_dialog_list.dialog_lone_list)745 user.mody(love = 2,love_time = True, exp = 5, exp_time = True)746 await bot.send_message(msg.channel,text) 747async def memo_append(msg,user):748 chat_id = msg.channel.id749 log_append(chat_id, str(msg.content), "mm_add",0)750 text = mention_user(user.user_id)+", "751 target = re.search('^ì¬ì½ì ((?:(?! 기ìµí´ì¤).)*) 기ìµí´ì¤', str(msg.content))752 target = target.groups()753 memo_status = quadra_memo(user.user_id)754 temp_swt = memo_status.append(str(target[0]))755 if temp_swt == 0:756 text += "ë©ëª¨ë¡ 기ë¡í ê»! "+str(memo_status.memo_num + 1)+"ë²ì§¸ ë©ëª¨ì¼!"757 log_append(chat_id, "add success! : current num = "+str(memo_status.memo_num + 1), "mm_add",0)758 await bot.send_message(msg.channel,text)759 if temp_swt == 1:760 text += "ë무 길ì´ì ê¸°ìµ ëª»íê² ì´!"761 log_append(chat_id, "add failed! : string stack overflow", "mm_add",0)762 await bot.send_message(msg.channel,text)763 if temp_swt == 2:764 text += "ì´ë¯¸ ë무 ë§ì´ 기ìµíê³ ìì´!"765 log_append(chat_id, "add failed! : capacity stack overflow", "mm_add",0)766 await bot.send_message(msg.channel,text)767 if temp_swt == 3:768 text += "ì´ìíê² ë¼ì¬ìì´ì 못기ìµíê² ì´!"769 log_append(chat_id, "add failed! : forbidden string included", "mm_add",0)770 await bot.send_message(msg.channel,text)771async def memo_delete(msg,user):772 chat_id = msg.channel.id773 log_append(chat_id, str(msg.content), "mm_del",0)774 text = mention_user(user.user_id)+", "775 target = re.search('^ì¬ì½ì ((?:(?! ìì´ì¤).)*) ìì´ì¤', str(msg.content))776 target = target.groups()777 memo_status = quadra_memo(user.user_id)778 if target[0] == "ì ë¶":779 temp_swt = memo_status.purge()780 if temp_swt == 0:781 text += "ë©ëª¨ë¥¼ ì ë¶ ì§ì ì´!"782 log_append(chat_id, "purge success!", "mm_del",0)783 await bot.send_message(msg.channel,text)784 if temp_swt == 1:785 text += "ë©ëª¨ê° ìì´!"786 log_append(chat_id, "purge failed! : index out of range", "mm_del",0)787 await bot.send_message(msg.channel,text)788 else:789 target = (target[0].split('ë²'))[0]790 try : temp_swt = memo_status.delete(int(target))791 except Exception: temp_swt = 3792 if temp_swt == 0:793 text += "ë©ëª¨ë¥¼ ì§ì ì´! "+str(memo_status.memo_num - 1)+"ê°ì ë©ëª¨ê° ë¨ììì´!"794 log_append(chat_id, "del success! : current num = "+str(memo_status.memo_num - 1), "mm_del",0)795 await bot.send_message(msg.channel,text)796 if temp_swt == 1:797 text += "ê·¸ì ëë¡ ë§ì´ 기ìµíê³ ìì§ ìì!"798 log_append(chat_id, "del failed! : capacity stack overflow", "mm_del",0)799 await bot.send_message(msg.channel,text)800 if temp_swt == 2:801 text += "ê·¸ë° ë²í¸ë ìë¤êµ¬!"802 log_append(chat_id, "del failed! : num must be at least 1", "mm_del",0)803 await bot.send_message(msg.channel,text)804 if temp_swt == 3:805 text += "ë ìì´ë¬ë¼ëê±´ì§ ëª¨ë¥´ê² ì´!"806 log_append(chat_id, "del failed! : error occured", "mm_del",0)807 await bot.send_message(msg.channel,text)808async def memo_check(msg,user):809 chat_id = msg.channel.id810 log_append(chat_id, str(msg.content), "mm_ck",0)811 text = mention_user(user.user_id)+", "812 target = re.search('^ì¬ì½ì ((?:(?! ìë ¤ì¤).)*) ìë ¤ì¤', str(msg.content))813 target = target.groups()814 memo_status = quadra_memo(user.user_id)815 if target[0] == "ì ë¶":816 if memo_status.memo_num == 0:817 text += "기ìµíê³ ìëê² ìì´!"818 log_append(chat_id, "list failed! : no memo", "mm_ck",0)819 await bot.send_message(msg.channel,text)820 else :821 text += "ë©ëª¨ë¥¼ ì°¾ìì´!"822 log_append(chat_id, "list check!", "mm_ck",0)823 em = discord.Embed(title="ë´ê° 기ìµíê³ ìë ê²ë¤ì´ì¼!", colour=discord.Colour.blue())824 temp_int = 1825 for i in memo_status.memo_str:826 em.add_field(name=str(temp_int)+"ë²", value=i, inline=False)827 log_append(chat_id,str(temp_int)+" : "+i, "mm_ck",0)828 temp_int += 1829 await bot.send_message(msg.channel,text,embed=em)830 else:831 target = (target[0].split('ë²'))[0]832 try : temp_swt = memo_status.check(int(target))833 except Exception: temp_swt = 3834 if temp_swt == 1:835 text += "ê·¸ì ëë¡ ë§ì´ 기ìµíê³ ìì§ ìì!"836 log_append(chat_id, "check failed! : capacity stack overflow", "mm_ck",0)837 await bot.send_message(msg.channel,text)838 elif temp_swt == 2:839 text += "ê·¸ë° ë²í¸ë ìë¤êµ¬!"840 log_append(chat_id, "check failed! : num must be at least 1", "mm_ck",0)841 await bot.send_message(msg.channel,text)842 elif temp_swt == 3:843 text += "ë ìë ¤ë¬ë¼ëê±´ì§ ëª¨ë¥´ê² ì´!"844 log_append(chat_id, "check failed! : error occured", "mm_ck",0)845 await bot.send_message(msg.channel,text)846 else:847 text += "ë©ëª¨ë¥¼ ì°¾ìì´!"848 log_append(chat_id, "check success! : "+temp_swt, "mm_ck",0)849 em = discord.Embed(title=target+"ë² ë©ëª¨",description=temp_swt, colour=discord.Colour.blue())850 await bot.send_message(msg.channel,text,embed=em)851async def quadra_trans(msg,user,perm):852 chat_id = msg.channel.id853 log_append(chat_id, str(msg.content), "trans",0)854 target = re.search('^ì¬ì½ì (?:((?:(?!ë¡).)*)ë¡ )?((?:(?! ë²ìí´ì¤).)*) ë²ìí´ì¤', str(msg.content))855 target = target.groups()856 translator = Translator()857 lang_dest = "ko"858 if target[0] in quadra_search_list.lang_list.keys():859 lang_dest = quadra_search_list.lang_list[target[0]]860 elif target[0]:861 lang_dest = target[0]862 try:863 asw = translator.translate(target[1],dest = lang_dest)864 em = discord.Embed(title="ë²ìê²°ê³¼",description=asw.text, colour=discord.Colour.blue())865 if not(asw.dest == 'ko' or asw.dest == 'en'): em.add_field(name="ë°ì", value=asw.pronunciation, inline=False)866 em.add_field(name="ì문", value=asw.origin, inline=False)867 em.add_field(name="ììì¸ì´", value=asw.src, inline=True)868 em.add_field(name="ê²°ê³¼ì¸ì´", value=asw.dest, inline=True)869 text = mention_user(user.user_id)+", ë²ìì ë§ì³¤ì´!"870 log_append(chat_id, "Success! : "+asw.text, "trans",0)871 await bot.send_message(msg.channel,text,embed=em)872 return 0873 except Exception as ex:874 if ex == ValueError:875 log_append(chat_id, "Cannot understand dest language.", "trans",0)876 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ë ì¸ì´ë¡ ë²ìí ì§ ì ëë¡ ì´í´ëª»íì´!")877 return 0878 else:879 log_append(chat_id, "Unknown Error : "+str(ex), "trans",0)880 await bot.send_message(msg.channel,mention_user(user.user_id)+", 미ìí´! ë²ìì´ ì ìë¼..")881 return 0882async def general_system(msg,user,perm):883 while(True):884 if msg.content == "ì¬ì½ì ëìì¤":885 await version(msg,user,"main",bot)886 break887 re_target = re.search('^ì¬ì½ì ((?:(?! ëìì¤).)*) ëìì¤',msg.content)888 if re_target:889 re_target = re_target.groups()890 await version(msg,user,re_target[0],bot)891 break892 # for general usage893 if perm > 0 or (msg.channel.permissions_for(msg.author)).administrator :894 if msg.content == "ì¬ì½ì ë³´ê³ ì¶ì´":895 em = discord.Embed(title="Katinor, the Quadra Ears",description="Katiadea Selinor\nCharacter Illustrated by Muku, All Right Reserved.", colour=discord.Colour.blue())896 em.set_image(url="https://i.imgur.com/VyRXaJw.png")897 await bot.send_message(msg.channel,embed=em)898 break899 if msg.content == "ì¬ì½ì ë구ë":900 await credit_view(msg,user,bot)901 break902 if msg.content == "ì¬ì½ì ì ìê¶":903 await credit_view(msg,user,bot)904 break905 if msg.content.startswith("ì¬ì½ì ì´ì©ì½ê´"):906 await tou_view(msg,user,bot)907 break908 if msg.content == "ì¬ì½ì ëíë":909 await lifetime(msg,user)910 break911 if msg.content == "ì¬ì½ì ëìì¤":912 await lifetime(msg,user)913 break914 re_target = re.search('^ì¬ì½(ì*)$',msg.content)915 if re_target:916 await lifetime(msg,user)917 break918 re_target = re.search('^ì¬ì½ì ((?:(?! ì´ë).)*) ì´ë',msg.content)919 if re_target:920 await dialog_how(msg,user)921 break922 re_target = re.search('^ì¬ì½ì ((?:(?! (í´ì¤|í ë)).)*) (í´ì¤|í ë)',msg.content)923 if re_target:924 await dialog_please(msg,user)925 break926 re_target = re.search('^ì¬ì½ì ((?:(?! íì).)*) íì',msg.content)927 if re_target:928 await dialog_do(msg,user)929 break930 re_target = re.search('^ì¬ì½ì ((?:(?! ë§ì\?).)*) ë§ì\?',msg.content)931 if re_target:932 await game_prog(msg,user)933 break934 if msg.content == "ì¬ì½ì ê·¸ë§í ë":935 await game_end(msg,user)936 break937 if msg.content == "ì¬ì½ì ì©ëì¤":938 await get_supply(msg,user)939 break940 if msg.content == "ì¬ì½ì ëë´ë":941 await get_supply(msg,user)942 break943 re_target = re.search('^ì¬ì½ì (?:((?:(?!ìì).)*)ìì )?((?:(?! ì°¾ìì¤).)*) ì°¾ìì¤',msg.content)944 if re_target:945 await searching(msg,user,perm)946 break947 re_target = re.search('^ì¬ì½ì (?:((?:(?!ë¡).)*)ë¡ )?((?:(?! ë²ìí´ì¤).)*) ë²ìí´ì¤',msg.content)948 if re_target:949 await quadra_trans(msg,user,perm)950 break951 re_target = re.search('^ì¬ì½ì ((?:(?! 기ìµí´ì¤).)*) 기ìµí´ì¤',msg.content)952 if re_target:953 await memo_append(msg,user)954 break955 re_target = re.search('^ì¬ì½ì ((?:(?! ìì´ì¤).)*) ìì´ì¤',msg.content)956 if re_target:957 await memo_delete(msg,user)958 break959 re_target = re.search('^ì¬ì½ì ((?:(?! ìë ¤ì¤).)*) ìë ¤ì¤',msg.content)960 if re_target:961 await memo_check(msg,user)962 break963 if "ì¸ë¡ì" in msg.content:964 await dialog_lone(msg,user)965 break966 if "ìë
" in msg.content:967 await lifetime(msg,user)968 break969 if "ë¤ì½" in msg.content:970 log_append(msg.channel.id, str(msg.content), "neko",0)971 result = nsfw_m.neko_search(msg.content,user,perm)972 if result[2] >= 1:973 await bot.send_message(msg.channel, embed=result[0])974 log_append(msg.channel.id, "flag name : "+result[1], "neko",0)975 else : await bot.send_message(msg.channel, mention_user(user.user_id)+", "+result[3])976 break977 if "ì¼ì¹" in msg.content:978 log_append(msg.channel.id, str(msg.content), "neko",0)979 result = nsfw_m.neko_search(msg.content,user,perm)980 if result[2] >= 1:981 await bot.send_message(msg.channel, embed=result[0])982 log_append(msg.channel.id, "flag name : "+result[1], "neko",0)983 else : await bot.send_message(msg.channel, mention_user(user.user_id)+", "+result[3])984 break985 break986async def channel_system(msg,user,perm, user_perm):987 while(True):988 if "owner" in user_perm or "ch_admin" in user_perm:989 perm_class = server_permission(msg.server.id)990 re_target = re.search('^4ears channel help$',msg.content)991 if re_target:992 log_append(msg.channel.id, str(msg.content), "chl","help1")993 text = "start with \"4ears channel \"\n"994 text += "add : ì±ëì ê¶íì ì¶ê°í©ëë¤.\n"995 text += "del : ì±ëì ê¶íì ëºëë¤.\n"996 text += "purge : ì±ëì ì´ê¸°íí©ëë¤.\n"997 text += "stat : í ì±ëì ê¶íì íì¸í©ëë¤."998 em = discord.Embed(title="QuadraEarsBot channel manual",description=text, colour=discord.Colour.blue())999 em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")1000 await bot.send_message(msg.channel,embed=em)1001 break1002 re_target = re.search('^4ears channel add',msg.content)1003 if re_target:1004 log_append(msg.channel.id, str(msg.content), "chl","add")1005 if "-nsfw" in msg.content:1006 if perm_class.perm_check_admin("nsfw",msg.channel.id):1007 log_append(msg.channel.id, "already permissioned", "chl","add")1008 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¬ê¸´ ì´ë¯¸ íê°ëì´ìì´!")1009 else:1010 perm_class.add("nsfw",msg.channel.id)1011 log_append(msg.channel.id, "permission success", "chl","add")1012 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ì¬ê¸°ì ì«ê¸ í ê»!")1013 else:1014 if perm_class.perm_check_admin("basic",msg.channel.id):1015 log_append(msg.channel.id, "already permissioned", "chl","add")1016 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¬ê¸´ ì´ë¯¸ íê°ëì´ìì´!")1017 else:1018 perm_class.add("basic",msg.channel.id)1019 log_append(msg.channel.id, "permission success", "chl","add")1020 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ì¬ê¸°ì ì«ê¸ í ê»!")1021 break1022 re_target = re.search('^4ears channel del',msg.content)1023 if re_target:1024 log_append(msg.channel.id, str(msg.content), "chl","del")1025 if "-nsfw" in msg.content:1026 if perm_class.perm_check_admin("nsfw",msg.channel.id):1027 perm_class.delete("nsfw",msg.channel.id)1028 log_append(msg.channel.id, "permission delete", "chl","del")1029 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ë¶í° ì¬ê¸´ ìë¤ìê»!")1030 else:1031 log_append(msg.channel.id, "never heard", "chl","del")1032 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¬ê¸´ ìëë¶í° ìë£ê³ ììì´!")1033 else:1034 if perm_class.perm_check_admin("basic",msg.channel.id):1035 perm_class.delete("basic",msg.channel.id)1036 log_append(msg.channel.id, "permission delete", "chl","del")1037 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ë¶í° ì¬ê¸´ ìë¤ìê»!")1038 else:1039 log_append(msg.channel.id, "never heard", "chl","del")1040 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì¬ê¸´ ìëë¶í° ìë£ê³ ììì´!")1041 break1042 re_target = re.search('^4ears channel purge',msg.content)1043 if re_target:1044 log_append(msg.channel.id, str(msg.content), "chl","pg")1045 if "-nsfw" in msg.content:1046 perm_class.delete_all("nsfw")1047 log_append(msg.channel.id, "purged", "chl","pg")1048 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ë¶í° 모ë ì±ëì ìë¤ìê»!")1049 else:1050 perm_class.delete_all("basic")1051 log_append(msg.channel.id, "purged", "chl","pg")1052 await bot.send_message(msg.channel,mention_user(user.user_id)+", ì´ì ë¶í° 모ë ì±ëì ìë¤ìê»!")1053 break1054 re_target = re.search('^4ears channel stat',msg.content)1055 if re_target:1056 log_append(msg.channel.id, str(msg.content), "chl","st")1057 perm_list_str = ""1058 if perm_class.perm_check("basic",msg.channel.id): perm_list_str += "basic,"1059 if perm_class.perm_check("nsfw",msg.channel.id): perm_list_str += "nsfw,"1060 em = discord.Embed(title="QuadraEarsBot channel status", colour=discord.Colour.blue())1061 em.set_thumbnail(url="https://i.imgur.com/pg7K8cQ.png")1062 em.add_field(name="basic ê°¯ì", value=str(len(perm_class.allow_channel)), inline=True)1063 if len(perm_class.allow_nsfw) > 0 : em.add_field(name="nsfw ê°¯ì", value=str(len(perm_class.allow_nsfw)), inline=True)1064 em.add_field(name="본ì±ë", value=perm_list_str, inline=True)1065 await bot.send_message(msg.channel,embed=em)1066 break1067 else:1068 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ì´ ì±ëì ê¶íì´ ìì´!")1069 break1070@bot.event1071async def on_ready():1072 log_append('system', 'Bot running Start', 'system',0)1073 await bot.change_presence(game=discord.Game(name='ì¬ì½ì ëìì¤ <-- ëìë§'))1074@bot.event1075async def on_message(msg):1076 global server_sem1077 global user_sem1078 perm_rank = 01079 if msg.server:1080 if msg.server.id in server_sem:1081 return1082 else: server_sem.append(msg.server.id)1083 perm_class = server_permission(msg.server.id)1084 if perm_class.perm_check("nsfw",msg.channel.id): perm_rank = 21085 elif perm_class.perm_check("basic",msg.channel.id): perm_rank = 11086 else: perm_rank = 01087 else:1088 perm_rank = 11089 if msg.author.id in user_sem:1090 return1091 user_sem.append(msg.author.id)1092 if msg.author.bot == False :1093 said_user = quadra_user(msg.author.id)1094 author_perm = user_perm.check(msg, said_user.user_id)1095 if "user" in author_perm :1096 if msg.content.startswith("4ears admin"):1097 await admin_command(msg,said_user,perm_rank, user_perm, bot)1098 elif msg.content.startswith("4ears channel"):1099 await channel_system(msg,said_user, perm_rank, author_perm)1100 elif msg.content.startswith("ì¬ì½ì"):1101 await general_system(msg,said_user, perm_rank)1102 else :1103 said_user.general_exp_process(len(msg.content))1104 else :1105 profile_name = "user_database/"+str(msg.author.id)+".txt"1106 if os.path.exists(profile_name) == True:1107 os.remove(profile_name)1108 log_append(msg.channel.id,msg.author.name+"#"+str(msg.author.discriminator)+" ("+str(msg.author.id)+" ) is bot. remained userdata has been deleted.","system",0)1109 if int(msg.author.id) != 423338258055823360 and perm_rank > 0 :1110 rand_int = random.randrange(0,100)1111 if rand_int < 1:1112 log_append(msg.channel.id,"bot msg triggered","system",0)1113 await bot.send_message(msg.channel,msg.author.name+"ëë§ ëì§ë§ê³ ëëë ëìì¤!")1114 if msg.server:1115 server_sem.remove(msg.server.id)1116 user_sem.remove(msg.author.id)...
quadra_admin_command.py
Source:quadra_admin_command.py
...52 swt = True53 for i in ["-c","-s","-d","-g"]:54 if i in msg.content: swt = False55 if swt :56 log_append("notice_module", "option is unavailable", "adm","notice")57 await bot.send_message(msg.author,"ìµì
ì´ ì í¨íì§ ìì!")58 return 059 if "-c" in msg.content:60 profile_name = "quadra_notice.txt"61 if os.path.exists(profile_name):62 fp = open(profile_name,"r")63 log_append("notice_module", "file is exist. sended to owner", "adm","notice")64 await bot.send_message(msg.author,"ê³µì§íì¼ì ë¤ì´ìë ë´ì©ì´ì¼!\n\n"+fp.read())65 fp.close()66 else:67 log_append("notice_module", "there are no notice file.", "adm","notice")68 await bot.send_message(msg.author,"ê³µì§íì¼ì´ ì¡´ì¬íì§ ìì!")69 return 070 if "-s" in msg.content:71 profile_name = "quadra_notice.txt"72 fp = open(profile_name, "w")73 fp.write((msg.content.split("-s")[1])[1:])74 fp.close()75 fp = open(profile_name, "r")76 log_append("notice_module", "file is created", "adm","notice")77 await bot.send_message(msg.author,"ê³µì§íì¼ì ë¤ì´ìë ë´ì©ì´ì¼!\n\n"+fp.read())78 fp.close()79 return 080 log_append("notice_module", "check receiver", "adm","notice")81 temp_strarr = []82 target_owner = []83 dup_num = 084 for i in bot.servers:85 if i.owner in target_owner:86 temp_strarr.append((i.name, i.owner,"Duplicated"))87 dup_num += 188 else:89 temp_strarr.append((i.name, i.owner,"Saved"))90 target_owner.append(i.owner)91 del target_owner92 log_append("notice_module", "check receiver end : "+str(len(temp_strarr))+" servers, "+str(dup_num)+" dups", "adm","notice")93 if "-d" in msg.content:94 out_text = "ìë 목ë¡ì ìë ì¬ëë¤ìê² ë³´ë´ì§ê±°ì¼!\n\n"95 for i in temp_strarr:96 if i[2] == "Saved":97 out_text+= i[1].name+"#"+i[1].discriminator+" : "+i[0]98 else:99 out_text+= i[1].name+"#"+i[1].discriminator+" : "+i[0]+" *(ì¤ë³µë¨)*"100 out_text+="\n"101 out_text+="ì´ "+str(len(temp_strarr)-dup_num)+" ëª
ìê² ë³´ë¼ê±°ì¼. "+str(dup_num)+"ëª
ì ë¤ë¥¸ ìë²ë ê°ì§ê³ ìëë¼êµ¬."102 await bot.send_message(msg.author,out_text)103 log_append("notice_module", "receiver list has been transmitted", "adm","notice")104 return 0105 target_str = ""106 profile_name = "quadra_notice.txt"107 if os.path.exists(profile_name):108 fp = open(profile_name,"r")109 log_append("notice_module", "file is exist. load to memory.", "adm","notice")110 target_str = fp.read()111 fp.close112 else:113 log_append("notice_module", "there are no notice file.", "adm","notice")114 await bot.send_message(msg.author,"ê³µì§íì¼ì´ ì¡´ì¬íì§ ìì!")115 return 0116 117 dup_num = 0118 suc_num = 0119 err_num = 0120 log_append("notice_module", "file checked, start to send", "adm","notice")121 for i in temp_strarr:122 if i[2] == "Saved":123 try:124 await bot.send_message(i[1],target_str)125 log_append("notice_module", i[1].name+"#"+i[1].discriminator+" : "+i[0], "adm","notice")126 suc_num += 1127 except Exception as ex:128 log_append("notice_module", i[1].name+"#"+i[1].discriminator+" : "+i[0]+" :: "+str(ex), "adm","notice")129 await bot.send_message(msg.author,"[ERROR]"+i[1].name+"#"+i[1].discriminator+" : "+i[0]+" :: "+str(ex))130 err_num += 1131 else:132 log_append("notice_module", i[1].name+"#"+i[1].discriminator+" : "+i[0]+" (duplicated)", "adm","notice")133 dup_num += 1134 log_append("notice_module", "success : "+str(suc_num)+" success, "+str(dup_num)+" dups", "adm","notice")135 await bot.send_message(msg.author,str(suc_num)+"ëª
ìê² ë³´ëì´! "+str(dup_num)+"ëª
ì ë¤ë¥¸ ìë²ë ìì íê³ ììì´. "+str(err_num)+"ëª
ì ìë¬ê° ë°ìíì´.")136 return 0137async def admin_command(msg, user, channel_perm, user_perm, bot):138 author_perm = user_perm.check(msg, user.user_id)139 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id+" ["140 for i in author_perm:141 log_text += i+", "142 log_text += "]"143 log_append(msg.channel.id,"admin panel access : "+log_text, "adm","acc")144 while(True):145 if msg.content == '4ears admin copyright':146 log_append(msg.channel.id, str(msg.content), "adm","cpy")147 if "admin" in author_perm :148 await credit_view(msg,user,bot,perm = True)149 else:150 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id151 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")152 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ê¶íì´ ìì´!")153 break154 if msg.content == '4ears admin tou':155 log_append(msg.channel.id, str(msg.content), "adm","tou")156 if "admin" in author_perm :157 await tou_view(msg,user,bot,perm = True)158 else:159 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id160 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")161 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ê¶íì´ ìì´!")162 break163 if msg.content == '4ears admin help':164 log_append(msg.channel.id, str(msg.content), "adm","help")165 temp_cont = admin_help("main",user,author_perm)166 await bot.send_message(msg.channel,temp_cont[0],embed=temp_cont[1])167 break168 if msg.content == '4ears admin help admin':169 log_append(msg.channel.id, str(msg.content), "adm","help")170 temp_cont = admin_help("admin",user,author_perm)171 await bot.send_message(msg.channel,temp_cont[0],embed=temp_cont[1])172 break173 if msg.content == '4ears admin help block':174 log_append(msg.channel.id, str(msg.content), "adm","help")175 temp_cont = admin_help("block",user,author_perm)176 await bot.send_message(msg.channel,temp_cont[0],embed=temp_cont[1])177 break178 if msg.content == '4ears admin help user':179 log_append(msg.channel.id, str(msg.content), "adm","help")180 temp_cont = admin_help("user",user,author_perm)181 await bot.send_message(msg.channel,temp_cont[0],embed=temp_cont[1])182 break183 if msg.content == '4ears admin help notice':184 log_append(msg.channel.id, str(msg.content), "adm","help")185 temp_cont = admin_help("notice",user,author_perm)186 await bot.send_message(msg.channel,temp_cont[0],embed=temp_cont[1])187 break188 if msg.content.startswith("4ears admin add"):189 log_append(msg.channel.id, str(msg.content), "adm","add")190 if "owner" in author_perm:191 add_list = msg.mentions192 if add_list:193 temp_s1 = 0194 temp_s2 = 0195 temp_s0 = 0196 for i in add_list:197 temp_var = user_perm.admin_add(i)198 if temp_var == 0: temp_s0 += 1199 elif temp_var == 1: temp_s1 += 1200 elif temp_var == 2: temp_s2 += 1201 user_perm.admin_save()202 temp_txt = "ê¶íì ë¶ì¬íì´!"203 if temp_s0 > 0 : temp_txt += "\n"+str(temp_s0)+"ëª
ìê² ê¶íì ë¶ì¬íì´!"204 if temp_s1 > 0 : temp_txt += "\n"+str(temp_s1)+"ëª
ì ì´ë¯¸ ê¶íì´ ìì´!"205 if temp_s2 > 0 : temp_txt += "\n"+str(temp_s2)+"ëª
ì ë´ì´ì¼!"206 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+temp_txt)207 else: await bot.send_message(msg.channel,mention_user(user.user_id)+", ëìì´ ì못ëê±°ê°ìë°?")208 else:209 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id210 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")211 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìë!")212 break213 if msg.content.startswith("4ears admin del"):214 log_append(msg.channel.id, str(msg.content), "adm","del")215 if "owner" in author_perm:216 add_list = msg.mentions217 if add_list:218 temp_s1 = 0219 temp_s2 = 0220 temp_s0 = 0221 for i in add_list:222 temp_var = user_perm.admin_del(i)223 if temp_var == 0: temp_s0 += 1224 elif temp_var == 1: temp_s1 += 1225 elif temp_var == 2: temp_s2 += 1226 user_perm.admin_save()227 temp_txt = "ê¶íì íìíì´!"228 if temp_s0 > 0 : temp_txt += "\n"+str(temp_s0)+"ëª
ì ê¶íì íìíì´!"229 if temp_s1 > 0 : temp_txt += "\n"+str(temp_s1)+"ëª
ì ì ì´ì ê¶íì´ ìì´!"230 if temp_s2 > 0 : temp_txt += "\n"+str(temp_s2)+"ëª
ì ë´ì´ì¼!"231 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+temp_txt)232 else: await bot.send_message(msg.channel,mention_user(user.user_id)+", ëìì´ ì못ëê±°ê°ìë°?")233 else:234 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id235 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")236 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìë!")237 break238 if msg.content.startswith("4ears admin block"):239 log_append(msg.channel.id, str(msg.content), "bl","add")240 if "admin" in author_perm:241 add_list = msg.mentions242 if add_list:243 temp_s1 = 0244 temp_s2 = 0245 temp_s3 = 0246 temp_s4 = 0247 temp_s0 = 0248 for i in add_list:249 temp_var = user_perm.block(i,author_perm)250 if temp_var == 0: temp_s0 += 1251 elif temp_var == 1: temp_s1 += 1252 elif temp_var == 2: temp_s2 += 1253 elif temp_var == 3: temp_s3 += 1254 elif temp_var == 4: temp_s4 += 1255 user_perm.block_save()256 temp_txt = "ì°¨ë¨ì ìë£íì´!"257 if temp_s0 > 0 : temp_txt += "\n"+str(temp_s0)+"ëª
ì 무ìí ê»!"258 if temp_s4 > 0 : temp_txt += "\n"+str(temp_s4)+"ëª
ì 무ìí 겸 ê´ë¦¬ìë í´ê³ íì´!!"259 if temp_s3 > 0 : temp_txt += "\n"+str(temp_s3)+"ëª
ì ê´ë¦¬ìë¼ì 무ìí ì ìì´!"260 if temp_s1 > 0 : temp_txt += "\n"+str(temp_s1)+"ëª
ì ì´ë¯¸ 무ìíê³ ìì´!"261 if temp_s2 > 0 : temp_txt += "\n"+str(temp_s2)+"ëª
ì ë´ì´ì¼!"262 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+temp_txt)263 else: await bot.send_message(msg.channel,mention_user(user.user_id)+", ëìì´ ì못ëê±°ê°ìë°?")264 else:265 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id266 log_append(msg.channel.id,"access denied - "+log_text, "bl","err")267 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ê¶íì´ ìì´!")268 break269 if msg.content.startswith("4ears admin unblock"):270 log_append(msg.channel.id, str(msg.content), "bl","del")271 if "admin" in author_perm:272 add_list = msg.mentions273 if add_list:274 temp_s1 = 0275 temp_s2 = 0276 temp_s0 = 0277 for i in add_list:278 temp_var = user_perm.unblock(i)279 if temp_var == 0: temp_s0 += 1280 elif temp_var == 1: temp_s1 += 1281 elif temp_var == 2: temp_s2 += 1282 user_perm.block_save()283 temp_txt = "ì°¨ë¨ì í´ì íì´!"284 if temp_s0 > 0 : temp_txt += "\n"+str(temp_s0)+"ëª
ì ë§ì ë¤ì ë¤ìê»!"285 if temp_s1 > 0 : temp_txt += "\n"+str(temp_s1)+"ëª
ì ë£ê³ ììì´!"286 if temp_s2 > 0 : temp_txt += "\n"+str(temp_s2)+"ëª
ì ë´ì´ì¼!"287 await bot.send_message(msg.channel,mention_user(user.user_id)+", "+temp_txt)288 else: await bot.send_message(msg.channel,mention_user(user.user_id)+", ëìì´ ì못ëê±°ê°ìë°?")289 else:290 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id291 log_append(msg.channel.id,"access denied - "+log_text, "bl","err")292 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ê¶íì´ ìì´!")293 break294 if msg.content.startswith("4ears admin love"):295 log_append(msg.channel.id, str(msg.content), "adm","love")296 if "admin" in author_perm :297 trg_list = msg.mentions298 if len(trg_list) == 1:299 trg_id = trg_list[0].id300 trg_user = quadra_user(trg_id)301 love_stat = trg_user.love302 if "-server" in msg.content: await bot.send_message(msg.channel,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ì¹ë°ëë "+str(love_stat)+" ì´ì¼!")303 else: await bot.send_message(msg.author,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ì¹ë°ëë "+str(love_stat)+" ì´ì¼!")304 else: await bot.send_message(msg.channel,mention_user(user.user_id)+" íë²ì íëª
ë§ ë¬¼ì´ë´ì¤!")305 else:306 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id307 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")308 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ê°ë¥´ì³ ì¤ì ìì´!")309 break310 if msg.content.startswith("4ears admin lovcng"):311 log_append(msg.channel.id, str(msg.content), "adm","lovcng")312 if "owner" in author_perm:313 trg_list = msg.mentions314 if len(trg_list) == 1:315 trg_id = trg_list[0].id316 trg_user = quadra_user(trg_id)317 data = str(msg.content).split(" ")318 val1 = int(data[len(data)-1])319 if "-add" in msg.content: val1 = trg_user.love + val1 320 elif "-del" in msg.content : val1 = trg_user.love - val1321 if val1 > quadra_user_module.MAX_LOVE : val1 = quadra_user_module.MAX_LOVE322 if val1 < quadra_user_module.MIN_LOVE : val1 = quadra_user_module.MIN_LOVE323 trg_user.change(love = val1)324 await bot.send_message(msg.channel,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ì¹ë°ëë ì´ì "+str(val1)+" ì´ì¼!")325 else: await bot.send_message(msg.channel,mention_user(user.user_id)+" íë²ì íëª
ë§ ë¬¼ì´ë´ì¤!")326 else:327 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id328 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")329 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìëì¼!!")330 break331 if msg.content == '4ears admin stats':332 log_append(msg.channel.id, str(msg.content), "adm","stats")333 if "admin" in author_perm:334 fp = open("quadra_server_list.txt","w")335 for i in bot.servers:336 fp.write(i.name+"\n")337 fp.close()338 text = mention_user(user.user_id)+", íì¬ "+ str(len(bot.servers))+" ê°ì ìë²ìì ì¬ì©ì¤ì´ì¼! "+str(len(set(bot.get_all_members())))+" ëª
ì´ ë ë³´ê³ ìì´!"339 await bot.send_message(msg.channel,text)340 else:341 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id342 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")343 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ê° ì¸ì í ì¬ëì´ ìëì¼!")344 break345 if msg.content.startswith('4ears admin notice'):346 log_append(msg.channel.id, str(msg.content), "adm","notice")347 if "owner" in author_perm:348 await admin_notice(msg,bot)349 else:350 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id351 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")352 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ê° ì¸ì í ì¬ëì´ ìëì¼!")353 break354 if msg.content.startswith("4ears admin levcng"):355 log_append(msg.channel.id, str(msg.content), "adm","levcng")356 if "owner" in author_perm:357 trg_list = msg.mentions358 if len(trg_list) == 1:359 trg_id = trg_list[0].id360 trg_user = quadra_user(trg_id)361 data = str(msg.content).split(" ")362 val1 = int(data[len(data)-1])363 if "-add" in msg.content: val1 = trg_user.level + val1364 elif "-del" in msg.content: val1 = trg_user.level - val1365 if val1 < 0 : val1 = 0366 if val1 >= len(quadra_user_module.REQ_EXP) : val1 = len(quadra_user_module.REQ_EXP)367 trg_user.change(level = val1)368 await bot.send_message(msg.channel,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ë 벨ì ì´ì "+str(val1)+" ì´ì¼!\n")369 else: await bot.send_message(msg.channel,mention_user(user.user_id)+" íë²ì íëª
ë§ ë¬¼ì´ë´ì¤!")370 else:371 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id372 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")373 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìëì¼!!")374 break375 if msg.content.startswith("4ears admin expcng"):376 log_append(msg.channel.id, str(msg.content), "adm","expcng")377 if "owner" in author_perm:378 trg_list = msg.mentions379 if len(trg_list) == 1:380 trg_id = trg_list[0].id381 trg_user = quadra_user(trg_id)382 data = str(msg.content).split(" ")383 val1 = int(data[len(data)-1])384 if "-add" in msg.content: val1 = trg_user.exp + val1385 elif "-del" in msg.content: val1 = trg_user.exp - val1386 trg_user.change(exp = val1)387 await bot.send_message(msg.channel,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ê²½íì¹ë ì´ì "+str(val1)+" ì´ì¼!")388 else: await bot.send_message(msg.channel,mention_user(user.user_id)+" íë²ì íëª
ë§ ë¬¼ì´ë´ì¤!")389 else:390 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id391 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")392 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìëì¼!!")393 break394 if msg.content.startswith("4ears admin cachcng"):395 log_append(msg.channel.id, str(msg.content), "adm","cscng")396 if "owner" in author_perm:397 trg_list = msg.mentions398 if len(trg_list) == 1:399 trg_id = trg_list[0].id400 data = str(msg.content).split(" ")401 val1 = int(data[len(data)-1])402 trg_user = quadra_user(trg_id)403 if "-add" in msg.content: val1 = trg_user.cash + val1404 elif "-del" in msg.content: val1 = trg_user.cash - val1405 trg_user.change(cash = val1)406 await bot.send_message(msg.channel,mention_user(user.user_id)+"!\n"+"<@"+str(trg_id)+"> ì ëì ì´ì "+str(val1)+" ì´ì¼!")407 else: await bot.send_message(msg.channel,mention_user(user.user_id)+" íë²ì íëª
ë§ ë¬¼ì´ë´ì¤!")408 else:409 log_text = msg.author.name+"#"+msg.author.discriminator+" : "+msg.author.id410 log_append(msg.channel.id,"access denied - "+log_text, "adm","err")411 await bot.send_message(msg.channel,mention_user(user.user_id)+", ëë ë´ ì£¼ì¸ëì´ ìëì¼!!")412 break413 if msg.content.startswith("4ears admin memo"):414 log_append(msg.channel.id, str(msg.content), "adm","mm")415 if "admin" in author_perm or "ch_admin" in author_perm :416 trg_list = msg.mentions417 if len(trg_list) == 1:418 text = mention_user(user.user_id)+", "419 trg_id = trg_list[0].id420 memo_status = quadra_memo(trg_id)421 if memo_status.memo_num == 0:422 text += mention_user(trg_id)+"ë ë©ëª¨ë¥¼ ì´ê² ìì´!"423 log_append(msg.channel.id, "list failed! : no memo", "adm","mm")424 await bot.send_message(msg.channel,text)425 else :426 text += mention_user(trg_id)+"ì ë©ëª¨ë¥¼ ì°¾ìì´!"427 log_append(msg.channel.id, "list check!", "adm","mm")428 em = discord.Embed(title="ë´ê° 기ìµíê³ ìë ê²ë¤ì´ì¼!", colour=discord.Colour.blue())429 temp_int = 1430 for i in memo_status.memo_str:431 em.add_field(name=str(temp_int)+"ë²", value=i, inline=False)432 log_append(msg.channel.id,str(temp_int)+" : "+i, "mm_ck",0)433 temp_int += 1434 await bot.send_message(msg.channel,text,embed=em) 435 break...
ansyrun.py
Source:ansyrun.py
...20 global_env.MainWindow.ableAllButton(False)21 self.append_signal.connect(append_signal_do)22 self.status_signal.connect(status_signal_do)23 self.end_signal.connect(end_signal_do)24 def log_append(self, text):25 self.append_signal.emit(text)26 def run(self):27 try:28 name_id = random.randint(100000000000, 999999999999)29 infoList = []30 mainNameDir = os.path.join(self.maindir, str(name_id))31 self.log_append("å¼å§è·åè§é¢ä¿¡æ¯")32 for i in range(len(self.audiopathlist)):33 audiopath = self.audiopathlist[i]34 xmlpath = self.xmlpathlist[i]35 title = self.titlelist[i]36 try:37 video_duration = action_def.get_video_duration(audiopath)38 if video_duration <= 0:39 raise Exception("æ æ³è·åè§é¢æ¶é¿")40 video_duration = int(1000 * video_duration)41 except Exception as e:42 self.log_append("æªè·åå°" + audiopath + "çæ¶é¿")43 self.log_append(str(e))44 video_duration = 144000045 try:46 video_size = action_def.get_fileSize(audiopath)47 if video_size <= 0:48 raise Exception("æ æ³è·åè§é¢å¤§å°")49 except Exception as e:50 self.log_append("æªè·åå°" + audiopath + "ç大å°")51 self.log_append(str(e))52 video_size = 39110618053 try:54 danmu_len = action_def.get_xml_d_num(xmlpath)55 except Exception as e:56 self.log_append("æªè·åå°" + xmlpath + "çå¼¹å¹æ°é")57 self.log_append(str(e))58 danmu_len = 059 print(video_duration)60 print(video_size)61 print(danmu_len)62 info_dict = {}63 info_dict["page"] = i + 164 info_dict["audiopath"] = audiopath65 info_dict["xmlpath"] = xmlpath66 info_dict["title"] = title67 info_dict["video_duration"] = video_duration68 info_dict["video_size"] = video_size69 info_dict["danmu_len"] = danmu_len70 info_dict["cid"] = name_id + i71 infoList.append(info_dict)72 self.log_append("è§é¢ä¿¡æ¯è·åå®æ¯")73 self.log_append("å¼å§åå
¥é
ç½®æ件")74 os.makedirs(mainNameDir)75 for i in infoList:76 temp_json = json.loads(global_env.temp_json_text)77 temp_json["avid"] = name_id78 temp_json["downloaded_bytes"] = i["video_size"]79 temp_json["total_bytes"] = i["video_size"]80 temp_json["danmaku_count"] = i["danmu_len"]81 temp_json["title"] = self.name82 temp_json["total_time_milli"] = i["video_duration"]83 # temp_json["type_tag"] = i[]84 temp_json["page_data"]["cid"] = i["cid"]85 temp_json["page_data"]["page"] = i["page"]86 temp_json["page_data"]["part"] = i["title"]87 os.makedirs(os.path.join(mainNameDir, str(i["page"])))88 with open(os.path.join(mainNameDir, str(i["page"]), "entry.json"), "w", encoding='utf-8') as f:89 json.dump(temp_json, f, ensure_ascii=False)90 self.log_append("åå
¥é
ç½®æ件å®æ")91 self.log_append("å¼å§ç§»å
¥è§é¢ãå¼¹å¹")92 for i in infoList:93 self.log_append(i["audiopath"])94 s_copy(i["audiopath"], os.path.join(mainNameDir, str(i["page"]), "lua.flv.bapi.2_remux.mp4"))95 s_copy(i["xmlpath"], os.path.join(mainNameDir, str(i["page"]), "danmaku.xml"))96 self.log_append("移å
¥è§é¢ãå¼¹å¹å®æ")97 self.log_append("æå!")98 except Exception as e:99 print(e.args)100 print(str(e))101 print(repr(e))102 self.log_append(str(e))103 self.end_signal.emit()104def status_signal_do(text):105 global_env.mainWin.statusbar.showMessage(text)106def append_signal_do(text):107 textBrowser = global_env.MainWindow.tipstextBrowser108 textBrowser.insertPlainText(text + "\n")109 textBrowser.moveCursor(textBrowser.textCursor().End)110def end_signal_do():...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!