Esempio n. 1
0
 async def del_toon(self, ctx, *, msg):
     if MiscFunctions.role_name_has_access(
             admin_role_names,
             ctx.author.roles) or MiscFunctions.role_id_has_access(
                 admin_role_ids, ctx.author.roles):
         if ctx.message.mentions:
             num = User.toon_delete_for_user(str(
                 ctx.message.mentions[0].id))
             if num > 0:
                 await ctx.message.channel.send(
                     "Deleted: " + str(num) + " characters for: <@!" +
                     str(ctx.message.mentions[0].id) + ">")
             else:
                 await ctx.message.channel.send(
                     "Could not find/delete any characters for: <@!" +
                     str(ctx.message.mentions[0].id) + ">")
         else:
             if User.toon_delete(msg.strip()) > 0:
                 await ctx.message.channel.send("Character: \"" +
                                                msg.strip() +
                                                "\"  Deleted.")
             else:
                 await ctx.message.channel.send(
                     "Character: \"" + msg.strip() +
                     "\" could not be found/deleted.")
Esempio n. 2
0
 async def toon(self, ctx, *, msg):
     if not ctx.message.mentions:
         user_toon = msg.strip()
         user = ctx.message.author.id
         if "," in user_toon:
             toons = user_toon.split(",")
             for x in toons:
                 User.toon_add(user, ctx.message.guild.id, x.strip(),
                               timestamp())
                 await ctx.message.channel.send(
                     ctx.message.author.display_name +
                     ", I have added characters: " + user_toon +
                     " to your profile.")
         else:
             User.toon_add(user, ctx.message.guild.id, user_toon,
                           timestamp())
             await ctx.message.channel.send(
                 ctx.message.author.display_name +
                 ", I have added character: " + user_toon +
                 " to your profile.")
     else:
         user = str(ctx.message.mentions[0].id)
         user_toon = msg.split(' ', 1)[1].strip()
         if MiscFunctions.role_name_has_access(admin_role_names, ctx.author.roles) or \
                 MiscFunctions.role_id_has_access(admin_role_ids, ctx.author.roles):
             if "," in user_toon:
                 toons = user_toon.split(",")
                 for x in toons:
                     User.toon_add(user, ctx.message.guild.id, x.strip(),
                                   timestamp())
                     await ctx.message.channel.send(
                         "Added characters: " + user_toon +
                         " to user: <@!" + str(ctx.message.mentions[0].id) +
                         ">")
             else:
                 User.toon_add(user, ctx.message.guild.id, user_toon,
                               timestamp())
                 await ctx.message.channel.send(
                     "Added character: " + user_toon + " to user: <@!" +
                     str(ctx.message.mentions[0].id) + ">")
         else:
             await ctx.message.channel.send(
                 ctx.message.author.name +
                 " Sorry, but you do not have access to this "
                 "function. Contact a bot admin.")