bots can't have custom statuses, sad. :(

This commit is contained in:
Riley Housden 2022-08-22 00:35:08 -04:00
parent 3c8a9add74
commit cf73726614
Signed by: InValidFire
GPG key ID: 0D6208F6DF56B4D8

View file

@ -18,12 +18,16 @@ async def set_avatar(ctx: lightbulb.Context) -> None:
@plugin.command
@lightbulb.option("text", "text to set as custom status", type=str, required=True)
@lightbulb.option("type", "type of status, 0 is Playing, 1 is Watching, 2 is Streaming, 3 is Listening, 4 is Competing", type=int, default=0)
@lightbulb.add_checks(lightbulb.owner_only)
@lightbulb.command("status", "set the bot status.", ephemeral=True)
@lightbulb.implements(lightbulb.SlashCommand)
async def set_status(ctx: lightbulb.Context) -> None:
await ctx.bot.update_presence(activity=hikari.Activity(name=ctx.options.text, type=hikari.ActivityType.CUSTOM))
embed = hikari.Embed(title="New status set!", description=f"New Status: {ctx.options.text}")
choices = [hikari.ActivityType.PLAYING, hikari.ActivityType.WATCHING,
hikari.ActivityType.STREAMING, hikari.ActivityType.LISTENING, hikari.ActivityType.COMPETING]
await ctx.bot.update_presence(activity=hikari.Activity(name=ctx.options.text, type=choices[ctx.options.type]))
embed = hikari.Embed(title="New status set!",
description=f"New Status: {ctx.options.text}")
await ctx.respond(embed)