Skip to content

Commit 1cd2957

Browse files
committed
Added status command
1 parent 48ee329 commit 1cd2957

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

cogs/modmail.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
import datetime
44
from typing import Optional, Union
5-
import re
65

76
import discord
87
from discord.ext import commands
8+
from discord.enums import ActivityType
9+
910
import dateutil.parser
1011

1112
from core.decorators import trigger_typing
@@ -124,6 +125,19 @@ async def move(self, ctx, *, category: discord.CategoryChannel):
124125
await thread.channel.edit(category=category)
125126
await ctx.message.add_reaction('✅')
126127

128+
@commands.command()
129+
async def status(self, ctx, activity_type: str, *, message: str):
130+
activity_type = ActivityType[activity_type]
131+
self.bot: commands.Bot
132+
activity = discord.Activity(type=activity_type, name=message)
133+
await self.bot.change_presence(activity=activity)
134+
em = discord.Embed(
135+
title='Status Changed',
136+
description=f'{ActivityType(activity_type)}: {message}.',
137+
color=discord.Color.green()
138+
)
139+
await ctx.send(embed=em)
140+
127141
async def send_scheduled_close_message(self, ctx, after, silent=False):
128142
human_delta = human_timedelta(after.dt)
129143

0 commit comments

Comments
 (0)