import nerimity import bot import utils as u def setup(bot: bot.Bot): @bot.command(name="echo") async def echo(ctx: nerimity.Context, *text: str): print(bot.is_owner(ctx.author)) if not bot.is_owner(ctx.author): print("returned") return if not text: await ctx.send(u.error_msg("Contents are empty.")) return try: await ctx.send(" ".join(text)) except Exception as e: print(e) await ctx.send(u.error_msg(f"Unknown error:\n`{e}`")) @bot.command(name="post") async def post(ctx: nerimity.Context, *text: str): print(bot.is_owner(ctx.author)) if not bot.is_owner(ctx.author): print("returned") return if not text: await ctx.send(u.error_msg("Contents are empty.")) return try: await ctx.send(f"Creating post:\n```markdown\n{" ".join(text)}\n```") # post = nerimity.Post.create_post(content=" ".join(text)) # print(post) await ctx.send(u.good_msg(f"Post created!!")) except Exception as e: print(e) await ctx.send(u.error_msg(f"Unknown error:\n`{e}`"))