Merge pull request #161 from jmaliksi/jm_157

Throw error if draft isn't formatted with new lines
This commit is contained in:
Sakimori 2021-01-16 14:25:30 -05:00 committed by GitHub
commit 29b299d8ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -614,7 +614,7 @@ class StartDraftCommand(Command):
draft = Draft.make_draft() draft = Draft.make_draft()
mentions = {f'<@!{m.id}>' for m in msg.mentions} mentions = {f'<@!{m.id}>' for m in msg.mentions}
content = msg.content.split('\n')[1:] # drop command out of message content = msg.content.split('\n')[1:] # drop command out of message
if len(content) % 3: if not content or len(content) % 3:
await msg.channel.send('Invalid list') await msg.channel.send('Invalid list')
raise ValueError('Invalid length') raise ValueError('Invalid length')