Skip to content
Permalink
5c09b1cfa3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
34 lines (27 sloc) 1.03 KB
import asyncio
from discord.ext import commands
from botClient import client
class BasicFunctions:
def __init__(self, client):
self.client = client
@commands.command()
async def test(self, ctx):
counter = 0
tmp = await ctx.message.channel.send('Calcuating messages...')
async for log in ctx.message.channel.history(limit = int(100)):
if log.author == ctx.message.author:
counter += 1
await tmp.edit(content=f'You have {counter} messages.')
@commands.command()
async def sleep(self, ctx):
await ctx.message.channel.send('Going to sleep for 10 seconds.')
await asyncio.sleep(10)
await ctx.message.channel.send('Done sleeping, thanks.')
@commands.command()
async def hello(self, ctx):
await ctx.message.channel.send(f'Hello, {ctx.message.author.mention}!')
@commands.command()
async def uok(self, ctx):
await ctx.message.channel.send('Yes I am.')
def setup(client):
client.add_cog(BasicFunctions(client))