def off(ctx):
if not isFollowing(ctx.message.author.id):
await bot.send_message(ctx.message.channel, 'Use ``ap:follow`` first to subscribe to the bot. Do ``ap:commands`` for more help')
else:
f = open('%susers/user%s.txt' % (path, ctx.message.author.id), 'r+')
content = f.read()
f.seek(0)
if content.startswith('--disable--off'):
f.write(content)
elif content.startswith('off'):
f.write(content)
elif content.startswith('--disable--'):
f.write('--disable--off' + content[11:])
else:
f.write('off' + content)
f.close()
await bot.send_message(ctx.message.channel, 'The bot will no longer ping you on every message. Do ``ap:ping on`` to reverse this.')
await bot.send_message(discord.Object(id=config["log_location"]),
'User: ' + str(ctx.message.author) + '\nCmd: ' + str(ctx.message.content))
评论列表
文章目录