Added a bump reminder command

pull/2/head
sgoudham 4 years ago
parent f8e55de84c
commit 1d2c7e4ee2

@ -1,5 +1,6 @@
import asyncio import asyncio
import datetime import datetime
from asyncio import sleep
import discord import discord
from decouple import config from decouple import config
@ -17,7 +18,8 @@ client.remove_command('help')
# Instantiates a list for all the cogs # Instantiates a list for all the cogs
extensions = ['cogs.WaifuImages', 'cogs.FunCommands', 'cogs.Music', extensions = ['cogs.WaifuImages', 'cogs.FunCommands', 'cogs.Music',
'cogs.HelpCommands', 'cogs.OwOText', 'cogs.Embeds', 'cogs.GetInfo'] 'cogs.HelpCommands', 'cogs.OwOText', 'cogs.Embeds',
'cogs.GetInfo', 'cogs.Reminder']
# Calls the cogs # Calls the cogs
if __name__ == '__main__': if __name__ == '__main__':
@ -25,6 +27,16 @@ if __name__ == '__main__':
client.load_extension(ext) client.load_extension(ext)
@client.command()
async def remind(ctx, time=None):
author = ctx.message.author
if time:
await sleep(float(time))
await author.send("uwu")
else:
await author.send("owo")
# Bot Status on Discord # Bot Status on Discord
@client.event @client.event
async def on_ready(): async def on_ready():
@ -248,7 +260,6 @@ async def on_raw_reaction_remove(payload):
except Exception as ex: except Exception as ex:
print(ex) print(ex)
# Run the bot, allowing to come online # Run the bot, allowing to come online
try: try:
client.run(API_TOKEN) client.run(API_TOKEN)

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 18:27:47 2020
@author: Lukas
"""
from datetime import datetime
from datetime import timedelta
from time import sleep
from discord.ext import commands
class Reminder(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def remindme(self, ctx):
time_left = [float(i) for i in str(datetime.now().time()).split(":")]
time_left = timedelta(hours=2) - timedelta(hours=time_left[0] % 2, minutes=time_left[1],
seconds=time_left[2])
sleep(round(time_left.total_seconds()))
while True:
await ctx.send("Bump the Server Idiots")
sleep(7200)
def setup(bot):
bot.add_cog(Reminder(bot))
Loading…
Cancel
Save