def remove(ctx):
msg = '**Error** Something went wrong. Are you using the command right? Example use: ``ap:remove anime One Punch Man S2``'
try:
toUnfollow = ctx.message.content.split('ap:remove')[1].strip()
status = removeKeyWords(toUnfollow, ctx.message.author.id)
if status == True:
await bot.send_message(ctx.message.channel, 'Successfully removed ``%s`` from ``%s``. View your list with ``ap:list``.' % (toUnfollow.split(' ', 1)[1].strip(), toUnfollow.split(' ', 1)[0].strip()))
await bot.send_message(discord.Object(id=config["log_location"]),
'User: ' + str(ctx.message.author) + '\nCmd: ' + str(ctx.message.content))
elif status == 'blacklist':
await bot.send_message(ctx.message.channel,
'Successfully removed all words from blacklist. View your list with ``ap:list``.')
await bot.send_message(discord.Object(id=config["log_location"]),
'User: ' + str(ctx.message.author) + '\nCmd: ' + str(ctx.message.content))
else:
await bot.send_message(ctx.message.channel, msg)
except Exception as e:
traceback.print_exc()
await bot.send_message(ctx.message.channel, msg)
评论列表
文章目录