Introducing the brand new API capable of not a lot at this time. But i am expanding it rn.
parent
9ba31e8284
commit
91a75ff9c8
@ -1,14 +1,24 @@
|
|||||||
import discord
|
import discord, datetime
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
class Greetings(commands.Cog):
|
class Greetings(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
|
|
||||||
@commands.slash_command(guild_ids=["823188238260633600"])
|
@commands.slash_command(guild_ids=["823188238260633600"])
|
||||||
async def hello(self, ctx):
|
async def hello(self, ctx):
|
||||||
|
self.bot.api.logger("inf", "hello from the cog!")
|
||||||
await ctx.send(f'Hello {ctx.author}')
|
await ctx.send(f'Hello {ctx.author}')
|
||||||
|
|
||||||
|
@commands.slash_command(guild_ids=["823188238260633600"])
|
||||||
|
async def uptime(self, ctx):
|
||||||
|
api = self.bot.api
|
||||||
|
api.logger("inf", "example.py: Getting uptime...")
|
||||||
|
uptime = api.uptime()
|
||||||
|
uptime = str(datetime.timedelta(seconds=uptime)).split(".")[0]
|
||||||
|
await ctx.respond(f"The uptime in H:MM:SS format: {uptime}")
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Greetings(bot))
|
bot.add_cog(Greetings(bot))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue