async def on_message(message): try: if message.author == client.user: return if "https://media.discordapp.net/attachments/529882894949416970/532391707971551236/vZajY9.gif" in message.content: await client.delete_message(message) return if message.author != os.environ["James"] and os.environ[ "test"] == "true": return authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) funcName = globalTools.getFunc(__.prefix, content) if funcName in funcMap.keys(): await funcMap[funcName](message) globalTools.log(message.author.display_name + " (" + message.author.name + ") " + message.channel.name + " (" + hex(int(message.channel.id)) + ") " + message.content) if authorId in ["159985870458322944", os.environ["James"]]: await functions.doRoles(message) if authorId == os.environ["Jackson"]: await functions.runIfJackson(message) if re.match("\\b(o{2,}g|o{3,}f)\\b", content): await functions.ooof(message) if message.mention_everyone: await functions.atEveryone(message) if re.match(r"^((yeah|o?k|oh?),? )?(one?|1) ?sec(ond)?[.!]?$", content, flags=re.I): await functions.oneSecond(message) await functions.robotRacism(message) except Exception as e: globalTools.log(e) await globalTools.msgMe(client, "Shit's f****d, check logs.")
async def atEveryone(message): authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) await client.send_message( message.channel, "Stop it with `@everyone`, you marrowey clog.") globalTools.log("(cancer) %s (%s) pinged everyone" % (authorId, authorName))
async def no(message): AID, ANAME = message.author.id, message.author.name if random.randint(1, 20) == 4: await client.send_file(message.channel, r"lolno.png") globalTools.log("(yn) %s (%s) tried to say no and died" % (AID, ANAME)) else: await client.send_file(message.channel, r"nonono.gif") globalTools.log("(yn) %s (%s) said no" % (AID, ANAME))
async def robotRacism(message): authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) robotRacism = re.match("((beep|boop|bop|bz+t) ?)+", content) if robotRacism != None: await client.send_message( message.channel, ">" + robotRacism[0] + "\nTHAT'S RACIST TOWARDS ROBOTS") globalTools.log("(cancer) %s (%s) is racist towards robots" % (authorId, authorName))
async def cowsay(message): authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) say = content[len(__.prefix) + 7:] say = " ".join(say.split("")) say = "```".join(say.split("```")) if say[0] == "\n": say = say[1:] say = say.replace("\n", "\\n") await client.send_message(message.channel, "```" + cowsaygen.cowsaygen(say) + "```") globalTools.log("(cancer) %s (%s) cowsayed %s" % (authorId, authorName, say))
async def on_message(message): try: if message.author == client.user: return if message.author != os.environ["James"] and os.environ[ "test"] == "true": return funcName = globalTools.getFunc(__.prefix, message.content) if funcName in funcMap.keys(): await funcMap[funcName](message) except Exception as e: globalTools.log(e) await globalTools.msgMe(client, "Shit's f****d, check logs.")
async def on_ready(): global ready, notSoBot, theRealSenko #people.designatedAtMod=await client.get_user_info("185220964810883072") # Thanatos people.notSoBot = await client.get_user_info("439205512425504771") people.theRealSenko = await client.get_user_info("335554170222542851" ) # Me globalTools.log('Senko-bot bot is ready (%s | %s)' % (client.user.id, client.user.name)) ready = True # Do the certifiedSenko thing #await rainbowRole() while True: try: await rainbowRole() except Exception as e: print(e)
async def on_message(message): try: if message.author == client.user: return if message.author != os.environ["James"] and os.environ[ "test"] == "true": return if message.author.id == os.environ["James"] and message.content.lower( ) == __.prefix + "debug": cmd = "" while cmd != "exit": cmd = input(">>>") exec(cmd) if message.content.lower().startswith(__.prefix + "caption"): if len(message.attachments) == 0 or message.attachments[0][ "url"].split(".")[-1].lower() not in ["png", "jpg"]: await client.send_message(message.channel, "No image attached") else: args = message.content[len(__.prefix) + len("caption") + 1:] print(args) ftype = message.attachments[0]["url"].split(".")[-1] urllib.request.urlretrieve(message.attachments[0]["url"], "meme/meme." + ftype) img = PIL.Image.open("meme/meme." + ftype) textHeight = drawWord.word_wrap_height( PIL.ImageDraw.Draw(img), args, img.size[0], PIL.ImageFont.truetype("arial.ttf", 16)) print(textHeight) newImg = PIL.Image.new("RGB", (img.size[0], img.size[1] + textHeight), (255, 255, 255)) newImg.paste(img, (0, textHeight)) newDraw = PIL.ImageDraw.Draw(newImg) drawWord.draw_word_wrap(newDraw, args, max_width=newImg.size[0], fill=(0, 0, 0), font=PIL.ImageFont.truetype( "arial.ttf", 16)) newImg.save("meme/meme.png") await client.send_file(message.channel, 'meme/meme.png') except Exception as e: globalTools.log(e) await globalTools.msgMe(client, "Shit's f****d, check logs.")
async def runIfJackson(message): return authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) global cooldown # Global warming fixed! # That's not even remotely funny, past me now = time.time() if "https://tenor.com/view/" in content: # Make Jackson able to use tenor, but not spam with it. globalTools.log("(cancer) Jackson used GIF") if now - __.cooldowns.jacksonGIF < 20: await client.delete_message(message) if now - __.cooldowns.fuckoff >= 20: await client.send_message( message.channel, "Cooldown remaining: %d seconds." % (20 - int(now - __.cooldowns.jacksonGIF))) globalTools.log("(cancer) It's not very effective") __.cooldowns.fuckoff = now else: __.cooldowns.jacksonGIF = now
async def on_ready(): globalTools.log('Memebot is ready! (%s | %s)' % (client.user.id, client.user.name))
async def on_ready(): print(isSecondWeek()) globalTools.log('WhereTheFuckIsThatBitchJames-bot is ready! (%s | %s)'%(client.user.id, client.user.name))
async def help(message): AID, ANAME = message.author.id, message.author.name await client.send_message( message.channel, "yn/yes => yesyesyes.gif\nyn/no => nonono.gif") globalTools.log("(yn) %s (%s) asked for help" % (AID, ANAME))
async def ooof(message): authorId, authorName, content = message.author.id, message.author.name, message.content.lower( ) await client.send_message(message.channel, "IT'S \"OOF\" YOU F*****G MORON") globalTools.log("(cancer) %s (%s) is a moron" % (authorId, authorName))
async def on_ready(): __.init() globalTools.log('Cancerbot is ready! (%s | %s)' % (client.user.id, client.user.name)) s = sched.scheduler(time.time, time.sleep) s.enter(1, 1, birthday, (s, ))