async def on_message(self, message): if message.author.bot: return if "scp" in message.content: scp_amount = 0 split_message = message.content.split("scp") for number in range(len(split_message)): if number > 0: includes_scp = False if split_message[number][0] == " " and us.can_be_int(split_message[number].split(" ")[1]): scp_number = int(split_message[number].split(" ")[1]) includes_scp = True elif split_message[number][0] == "-" and us.can_be_int(split_message[number].split("-")[1]): scp_number = int(split_message[number].split("-")[1]) includes_scp = True if includes_scp: scp_amount += 1 scp_number = scp_number if scp_number > 99 else ("0%s" % scp_number if scp_number > 9 else ("00%s" % scp_number)) embed = us.make_embed() scp_link = self.link + str(scp_number) embed.title = "__**SCP-%s**__" % scp_number embed.description = scp_link await message.channel.send(embed=embed) if scp_amount > 0: us.cprint(self.color, self.name, message, "%s SCP(S) RECOGNIZED" % scp_amount)
async def GET_WELCOME_MESSAGE(self, ctx): data = us.getData() try: welcome = data["server_welcomes"][str(ctx.guild.id)] except: welcome = "NONE" await ctx.send("__**WELCOME MESSAGE:**__\n%s" % welcome) us.cprint(self.color, self.name, ctx, "WELCOME MESSAGE RETRIEVED")
async def on_member_remove(self, ctx): system_channel = ctx.guild.system_channel if system_channel is not None: data = us.getData() try: message = data["server_goodbyes"][str(ctx.guild.id)].replace("[USER]", ctx.mention) except: message = "%s LEFT" % ctx.mention await system_channel.send(message) us.cprint(self.color, self.name, ctx, "USER LEFT SERVER", True)
async def GET_SCP_LINK(self, ctx, number=-1): if number == -1: number = randint(0, 5999) number = number if number > 99 else ("0%s" % number if number > 9 else "00%s" % number) link = self.link + str(number) embed = us.make_embed() embed.title = "__**SCP-%s**__" % number embed.description = link await ctx.send(embed=embed) us.cprint(self.color, self.name, ctx, "SCP-%s INFORMATION RETRIEVED" % number)
async def CHANGE_LEAVE_MESSAGE(self, ctx, message): data = us.getData() try: original_leave = data["server_goodbyes"][str(ctx.guild.id)] except: original_leave = "NONE" data["server_goodbyes"][str(ctx.guild.id)] = message new_goodbye = message us.cprint(self.color, self.name, ctx, "GOODBYE MESSAGE CHANGED FROM \"%s\" TO \"%s\"" % (original_leave, new_goodbye)) await ctx.send("GOODBYE MESSAGE CHANGED FROM **\"%s\"** TO **\"%s\"**" % (original_leave, new_goodbye)) us.setData(data)
async def CHANGE_WELCOME_MESSAGE(self, ctx, message): data = us.getData() try: original_welcome = data["server_welcomes"][str(ctx.guild.id)] except: original_welcome = "NONE" data["server_welcomes"][str(ctx.guild.id)] = message new_welcome = message us.cprint(self.color, self.name, ctx, "WELCOME MESSAGE CHANGED FROM \"%s\" TO \"%s\"" % (original_welcome, new_welcome)) await ctx.send("WELCOME MESSAGE CHANGED FROM **\"%s\"** TO **\"%s\"**" % (original_welcome, new_welcome)) us.setData(data)
async def ROLL(self, ctx): await ctx.send(randint(0, 6)) us.cprint(self.color, self.name, ctx, "RANDOM NUMBER ROLLED")