Spaces:
Sleeping
Sleeping
Rifat Azad commited on
Commit ·
9d93df9
1
Parent(s): fac4b6b
clock command update 1.2.4
Browse files- pydvpl_bot.py +17 -2
pydvpl_bot.py
CHANGED
|
@@ -23,7 +23,7 @@ load_dotenv()
|
|
| 23 |
# DEFINES ------------------------------------------------------ START
|
| 24 |
|
| 25 |
|
| 26 |
-
BOT_VERSION = '1.2.
|
| 27 |
|
| 28 |
AUTHORIZED_USER_ID = os.getenv('AUTHORIZED_ID')
|
| 29 |
|
|
@@ -300,7 +300,7 @@ async def help(ctx):
|
|
| 300 |
# Add commands to the embed with descriptions
|
| 301 |
embed.add_field(name="PyDVPL Prefix:", value="`/` - Discord's slash command prefix.\n`>>` - PyDVPL default prefix.")
|
| 302 |
embed.add_field(name="Dvpl Commands:", value="`compress` - Compresses files.\n`decompress` - Decompresses files.", inline=False)
|
| 303 |
-
embed.add_field(name="User Utility Commands:", value="`ping` - Checks the bot's latency.\n`invite` - Get the bot's invite link.\n`uptime` - Displays the bot's uptime.", inline=False)
|
| 304 |
embed.add_field(name="Moderator Commands:", value="`kick` - Kick a member from the server.\n`ban` - Ban a member from the server.\n`timeout` - Timeout a member for a specified duration.", inline=False)
|
| 305 |
embed.add_field(name="Admin Utility Commands:", value="`stats` - Displays bot statistics.\n`list` - Lists server members.\n`say` - Make the bot say something.\n`announce` - Announces a message to a channel.\n`activity` - Sets bot activity status.\n`online` - Sets bot status to online.\n`dnd` - Sets bot status to Do Not Disturb.\n`offline` - Sets bot status to offline.\n`clean` - Cleans up bot's messages.\n`update` - Update a Python package using pip.", inline=False)
|
| 306 |
embed.add_field(name="Feedback Commands:", value="`feedback` - Sends feedback to bot developers. (usage: >>feedback issues/requests <message>)", inline=False)
|
|
@@ -506,6 +506,21 @@ async def version(ctx):
|
|
| 506 |
await ctx.send(embed=embed)
|
| 507 |
|
| 508 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
# UTILITY USER_CMD ------------------------------------------------------ END
|
| 510 |
|
| 511 |
|
|
|
|
| 23 |
# DEFINES ------------------------------------------------------ START
|
| 24 |
|
| 25 |
|
| 26 |
+
BOT_VERSION = '1.2.4'
|
| 27 |
|
| 28 |
AUTHORIZED_USER_ID = os.getenv('AUTHORIZED_ID')
|
| 29 |
|
|
|
|
| 300 |
# Add commands to the embed with descriptions
|
| 301 |
embed.add_field(name="PyDVPL Prefix:", value="`/` - Discord's slash command prefix.\n`>>` - PyDVPL default prefix.")
|
| 302 |
embed.add_field(name="Dvpl Commands:", value="`compress` - Compresses files.\n`decompress` - Decompresses files.", inline=False)
|
| 303 |
+
embed.add_field(name="User Utility Commands:", value="`ping` - Checks the bot's latency.\n`invite` - Get the bot's invite link.\n`uptime` - Displays the bot's uptime.\n`clock` - Shows the current date and time.", inline=False)
|
| 304 |
embed.add_field(name="Moderator Commands:", value="`kick` - Kick a member from the server.\n`ban` - Ban a member from the server.\n`timeout` - Timeout a member for a specified duration.", inline=False)
|
| 305 |
embed.add_field(name="Admin Utility Commands:", value="`stats` - Displays bot statistics.\n`list` - Lists server members.\n`say` - Make the bot say something.\n`announce` - Announces a message to a channel.\n`activity` - Sets bot activity status.\n`online` - Sets bot status to online.\n`dnd` - Sets bot status to Do Not Disturb.\n`offline` - Sets bot status to offline.\n`clean` - Cleans up bot's messages.\n`update` - Update a Python package using pip.", inline=False)
|
| 306 |
embed.add_field(name="Feedback Commands:", value="`feedback` - Sends feedback to bot developers. (usage: >>feedback issues/requests <message>)", inline=False)
|
|
|
|
| 506 |
await ctx.send(embed=embed)
|
| 507 |
|
| 508 |
|
| 509 |
+
# FUNCTION ------------------------------------------------------ SPLIT
|
| 510 |
+
|
| 511 |
+
|
| 512 |
+
from datetime import datetime
|
| 513 |
+
|
| 514 |
+
@bot.hybrid_command(help="Shows the current date and time.")
|
| 515 |
+
async def clock(ctx):
|
| 516 |
+
# Get the current date and time
|
| 517 |
+
now = datetime.now()
|
| 518 |
+
# Format the date and time
|
| 519 |
+
formatted_now = now.strftime("%Y-%m-%d %H:%M:%S")
|
| 520 |
+
|
| 521 |
+
await ctx.send(f"Current date and time: `{formatted_now}`")
|
| 522 |
+
|
| 523 |
+
|
| 524 |
# UTILITY USER_CMD ------------------------------------------------------ END
|
| 525 |
|
| 526 |
|