bots can't have custom statuses, sad. :(
This commit is contained in:
parent
3c8a9add74
commit
cf73726614
1 changed files with 6 additions and 2 deletions
|
@ -18,12 +18,16 @@ async def set_avatar(ctx: lightbulb.Context) -> None:
|
||||||
|
|
||||||
@plugin.command
|
@plugin.command
|
||||||
@lightbulb.option("text", "text to set as custom status", type=str, required=True)
|
@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.add_checks(lightbulb.owner_only)
|
||||||
@lightbulb.command("status", "set the bot status.", ephemeral=True)
|
@lightbulb.command("status", "set the bot status.", ephemeral=True)
|
||||||
@lightbulb.implements(lightbulb.SlashCommand)
|
@lightbulb.implements(lightbulb.SlashCommand)
|
||||||
async def set_status(ctx: lightbulb.Context) -> None:
|
async def set_status(ctx: lightbulb.Context) -> None:
|
||||||
await ctx.bot.update_presence(activity=hikari.Activity(name=ctx.options.text, type=hikari.ActivityType.CUSTOM))
|
choices = [hikari.ActivityType.PLAYING, hikari.ActivityType.WATCHING,
|
||||||
embed = hikari.Embed(title="New status set!", description=f"New Status: {ctx.options.text}")
|
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)
|
await ctx.respond(embed)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue