Skip to content

Commit f0b598f

Browse files
committed
Add ping command
1 parent 711bd09 commit f0b598f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/cogs/misc.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import discord
2+
from discord.ext import commands
3+
4+
import utils as ut
5+
6+
7+
class Misc(commands.Cog):
8+
"""
9+
Various useful Commands for everyone
10+
"""
11+
12+
def __init__(self, bot):
13+
self.bot = bot
14+
15+
@commands.command(name='ping', help="Check if Bot available")
16+
async def ping(self, ctx):
17+
print(f"ping: {round(self.bot.latency * 1000)}")
18+
19+
await ctx.send(
20+
embed=ut.make_embed(
21+
name='Poll-Bot is available',
22+
value=f'`{round(self.bot.latency * 1000)}ms`')
23+
)
24+
25+
26+
def setup(bot):
27+
bot.add_cog(Misc(bot))

0 commit comments

Comments
 (0)