Fix some brain farts

This commit is contained in:
Matthew Adams
2021-03-02 18:52:57 +10:00
parent b7d47701bf
commit f77eabf7c3

View File

@@ -14,12 +14,16 @@ async def on_ready():
@client.event @client.event
async def on_message(message): async def on_message(message):
if(not message.channel.name.startswith("tik-tok")):
return
if message.author == client.user: if message.author == client.user:
return return
if message.content.startswith('$hello'): if message.content.startswith('$hello'):
await message.channel.send('Hello!') await message.channel.send('Hello!')
downloadResult = ""
if message.content.startswith('https'): if message.content.startswith('https'):
await message.channel.send('TikBot downloading video now!') await message.channel.send('TikBot downloading video now!')
downloadResult = download(message.content) downloadResult = download(message.content)
@@ -28,6 +32,8 @@ async def on_message(message):
if(downloadResult.startswith("Error")): if(downloadResult.startswith("Error")):
await message.channel.send('TikBot has failed you. Consider berating my human if this was not expected.') await message.channel.send('TikBot has failed you. Consider berating my human if this was not expected.')
return return
else:
return
# Check file size, if it's small enough just send it! # Check file size, if it's small enough just send it!
fileSize = os.stat(downloadResult).st_size fileSize = os.stat(downloadResult).st_size