v6d2ctx/v6d2ctx/handle_content.py
2022-12-28 07:37:52 +00:00

20 lines
513 B
Python

import shlex
from typing import Callable
import discord
from v6d2ctx.context import *
from v6d2ctx.handle_args import *
__all__ = ('handle_content',)
async def handle_content(of: Callable[[str], command_type], message: discord.Message, content: str, prefix: str, client: discord.Client):
if message.author.bot:
return
if not content.startswith(prefix):
return
content = content.removeprefix(prefix)
args = shlex.split(content)
await handle_args(of, message, args, client)