Browse Source

Update inbuild examples

pull/10109/head
dolfies 4 years ago
parent
commit
4743b959ec
  1. 6
      discord/__main__.py

6
discord/__main__.py

@ -57,7 +57,7 @@ from discord.ext import commands
import discord
import config
class Bot(commands.{base}):
class Bot(commands.Bot):
def __init__(self, **kwargs):
super().__init__(command_prefix=commands.when_mentioned_or('{prefix}'), **kwargs)
for cog in config.cogs:
@ -214,8 +214,7 @@ def newbot(parser, args):
try:
with open(str(new_directory / 'bot.py'), 'w', encoding='utf-8') as fp:
base = 'Bot' if not args.sharded else 'AutoShardedBot'
fp.write(_bot_template.format(base=base, prefix=args.prefix))
fp.write(_bot_template.format(prefix=args.prefix))
except OSError as exc:
parser.error(f'could not create bot file ({exc})')
@ -268,7 +267,6 @@ def add_newbot_args(subparser):
parser.add_argument('name', help='the bot project name')
parser.add_argument('directory', help='the directory to place it in (default: .)', nargs='?', default=Path.cwd())
parser.add_argument('--prefix', help='the bot prefix (default: $)', default='$', metavar='<prefix>')
parser.add_argument('--sharded', help='whether to use AutoShardedBot', action='store_true')
parser.add_argument('--no-git', help='do not create a .gitignore file', action='store_true', dest='no_git')
def add_newcog_args(subparser):

Loading…
Cancel
Save