Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional removal of command system #61

Open
wants to merge 2 commits into
base: developer
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion discord/ext/commands/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __repr__(self):


class BotBase(GroupMixin):
def __init__(self, command_prefix, help_command=_default, description=None, **options):
def __init__(self, command_prefix=None, help_command=_default, description=None, **options):
super().__init__(**options)
self.command_prefix = command_prefix
self.extra_events = {}
Expand Down Expand Up @@ -1122,6 +1122,9 @@ async def get_prefix(self, message):
listening for.
"""
prefix = ret = self.command_prefix
if prefix is None:
return None

if callable(prefix):
ret = await discord.utils.maybe_coroutine(prefix, self, message)

Expand Down Expand Up @@ -1181,6 +1184,9 @@ class be provided, it must be similar enough to :class:`.Context`\'s
return ctx

prefix = await self.get_prefix(message)
if prefix is None:
return ctx

invoked_prefix = prefix

if isinstance(prefix, str):
Expand Down Expand Up @@ -1274,6 +1280,8 @@ async def process_commands(self, message):
return

ctx = await self.get_context(message)
if ctx.command is None:
return
await self.invoke(ctx)

async def on_message(self, message):
Expand Down